BLive.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  1. <template>
  2. <div class="b-live">
  3. <div class="b-l">
  4. <div class="b-head">
  5. <div class="left">
  6. <span class="b-head-i"></span>
  7. <span class="b-head-t">
  8. <a href="//live.bilibili.com/" target="_blank">
  9. <h2>正在直播</h2>
  10. </a>
  11. </span>
  12. <span class="b-head-s">
  13. 当前共有<em>{{online_total}}</em>个在线直播
  14. </span>
  15. </div>
  16. <div class="right">
  17. <div class="b-link-more">
  18. <a href="//live.bilibili.com" target="_blank">更多<i class="b-icon b-icon-arrow-r"></i></a>
  19. </div>
  20. </div>
  21. <div class="read-push">
  22. <span class="icon-refresh"></span>
  23. <span class="info">
  24. <b>{{dynamic}}</b>
  25. <em>条新动态</em>
  26. </span>
  27. </div>
  28. </div>
  29. <div class="b-body">
  30. <ul class="v-list-live" v-if="recommend">
  31. <li v-for="item in recommend">
  32. <BLiveItem :live="item"></BLiveItem>
  33. </li>
  34. </ul>
  35. </div>
  36. </div>
  37. <div class="b-r"></div>
  38. </div>
  39. </template>
  40. <script>
  41. import BLiveItem from 'components/live/BLiveItem'
  42. import { mapGetters } from 'vuex'
  43. export default {
  44. components: {
  45. BLiveItem
  46. },
  47. computed: {
  48. ...mapGetters([
  49. 'requesting',
  50. 'error',
  51. 'online_total',
  52. 'dynamic',
  53. 'recommend',
  54. 'ranking',
  55. 'preview',
  56. 'recommendAnchor'
  57. ])
  58. },
  59. mounted() {
  60. this.$store.dispatch('live')
  61. }
  62. }
  63. </script>
  64. <style lang="stylus">
  65. .b-live
  66. .b-l
  67. float left
  68. width 700px
  69. .b-head
  70. position relative
  71. height 24px
  72. white-space nowrap
  73. .left
  74. float left
  75. .b-head-i
  76. position absolute
  77. left 0px
  78. top -8px
  79. width 40px
  80. height 39px
  81. display inline-block
  82. background url(../../assets/images/icons.png) no-repeat
  83. background-position -141px -652px
  84. vertical-align middle
  85. margin-right 10px
  86. .b-head-t
  87. margin-left 46px
  88. float left
  89. vertical-align middle
  90. display inline-block
  91. font-size 18px
  92. line-height 24px
  93. color #222
  94. a
  95. color #222
  96. h2
  97. font-size 24px!important
  98. line-height 24px
  99. font-weight normal
  100. .b-head-s
  101. float left
  102. margin-top 10px
  103. color #99a2aa
  104. margin-left 20px
  105. display inline-block
  106. vertical-align bottom
  107. font-family "Lucida Console",Monaco,monospace
  108. em
  109. color #00a1d6
  110. font-style normal
  111. font-weight normal
  112. padding 0
  113. margin 0
  114. .right
  115. float right
  116. .b-link-more
  117. float right
  118. text-align center
  119. margin-left 10px
  120. a
  121. display block
  122. width 52px
  123. height 22px
  124. line-height 22px
  125. background-color #fff
  126. border 1px solid #ccd0d7
  127. color #555
  128. border-radius 4px
  129. &:hover
  130. background-color #ccd0d7
  131. .b-icon-arrow-r
  132. display inline-block
  133. vertical-align middle
  134. background url(../../assets/images/icons.png) no-repeat
  135. width 6px
  136. height 12px
  137. margin -2px 0 0 5px
  138. background-position -478px -218px
  139. .read-push
  140. float right
  141. cursor pointer
  142. background-color #fff
  143. border 1px solid #ccd0d7
  144. border-radius 4px
  145. height 22px
  146. padding 0 10px
  147. &:hover
  148. background-color #ccd0d7
  149. &:after
  150. content ''
  151. display block
  152. visibility hidden
  153. height 0
  154. clear both
  155. font-size 0
  156. .icon-refresh
  157. background url(../../assets/images/icons.png) -475px -89px no-repeat
  158. display inline-block
  159. width 12px
  160. height 13px
  161. vertical-align top
  162. transition .2s
  163. margin-top 5px
  164. .info
  165. display inline-block
  166. vertical-align top
  167. line-height 22px
  168. margin-left 5px
  169. b
  170. font-weight bold
  171. em
  172. font-style normal
  173. font-weight normal
  174. .b-body
  175. margin-right -20px
  176. &:after
  177. content ''
  178. display block
  179. visibility hidden
  180. height 0
  181. clear both
  182. font-size 0
  183. .v-list-live
  184. padding-top 20px
  185. height 316px
  186. overflow hidden
  187. li
  188. float left
  189. margin 0 20px 20px 0
  190. height 148px
  191. overflow hidden
  192. .b-r
  193. float right
  194. width 260px
  195. margin-bottom 50px
  196. min-height 360px
  197. height 360px
  198. overflow hidden
  199. &:after
  200. content ''
  201. display block
  202. visibility hidden
  203. height 0
  204. clear both
  205. font-size 0
  206. </style>