BLiveRankItem.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. <template>
  2. <li class="live-item">
  3. <div class="r-item r-ranking">
  4. <div class="lv-num" :class="{n: index === 0 || index === 1 || index === 2}">{{index + 1}}</div>
  5. <a href="" class="preview" target="_blank" :title="rank.uname">
  6. <img :src="rank.face" :alt="rank.uname">
  7. </a>
  8. <a href="" target="_blank" :title="rank.uname">
  9. <div class="r-i">
  10. <p class="r-i-t">
  11. <span class="u-name">{{rank.uname}}</span>
  12. <span class="u-online">
  13. <i class="b-icon b-icon-live-online"></i><em>{{online}}万</em>
  14. </span>
  15. <div class="r-i-st">
  16. {{rank.title}}
  17. </div>
  18. </p>
  19. </div>
  20. </a>
  21. </div>
  22. </li>
  23. </template>
  24. <script>
  25. export default {
  26. props: {
  27. rank: {
  28. type: Object
  29. },
  30. index: {
  31. }
  32. },
  33. computed: {
  34. online() {
  35. return (this.rank.online / 10000).toFixed(1)
  36. }
  37. }
  38. }
  39. </script>
  40. <style lang="stylus">
  41. .live-item
  42. margin 0 0 14px 0
  43. .r-item
  44. overflow hidden
  45. position relative
  46. &.r-ranking
  47. padding-left 25px
  48. .lv-num
  49. position absolute
  50. color #fff
  51. height 18px
  52. line-height 17px
  53. top 0px
  54. left 0px
  55. font-size 12px
  56. min-width 12px
  57. text-align center
  58. background-color #b8c0cc
  59. border-radius 4px
  60. z-index 20
  61. padding 0 3px 0 3px
  62. font-weight bolder
  63. &.n
  64. background-color #f25d8e
  65. .preview
  66. display block
  67. float left
  68. position relative
  69. margin-right 12px
  70. img
  71. display block
  72. img
  73. width 40px
  74. height 40px
  75. border-radius 20px
  76. .r-i
  77. float left
  78. width 180px
  79. &:hover
  80. .u-name
  81. color #00a1d6
  82. .r-i-t
  83. line-height 16px
  84. overflow hidden
  85. .u-name
  86. max-width 115px
  87. float left
  88. white-space nowrap
  89. text-overflow ellipsis
  90. color #222
  91. .u-online
  92. max-width 60px
  93. float right
  94. color #99a2aa
  95. line-height 16px
  96. overflow hidden
  97. white-space nowrap
  98. text-overflow ellipsis
  99. .b-icon
  100. display inline-block
  101. width 12px
  102. height 12px
  103. vertical-align top
  104. margin-right 5px
  105. margin-top 2px
  106. font-style normal
  107. font-weight normal
  108. &.b-icon-live-online
  109. background url(../../assets/images/live-eye.png)
  110. em
  111. font-style normal
  112. font-weight normal
  113. .r-i-st
  114. margin-top 4px
  115. color #99a2aa
  116. overflow hidden
  117. white-space nowrap
  118. text-overflow ellipsis
  119. max-width 190px
  120. height 16px
  121. line-height 16px
  122. </style>