songRank.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  1. <template>
  2. <view>
  3. <view class="bg-img flex justify-center align-center" style="background-image: url('/static/songRank/songRankBgImg.png');height: 402upx;">
  4. <view class="title">歌曲排行榜</view>
  5. </view>
  6. <view class="flex justify-center align-center padding-bottom">
  7. <view class="search">
  8. <text class="cuIcon-search padding-right-xs"></text>
  9. {{searValue}}
  10. </view>
  11. </view>
  12. <u-sticky h5-nav-height="0">
  13. <u-tabs :list="list" active-color="#5c40e8" :bold="false" :is-scroll="false" :current="current" @change="change"></u-tabs>
  14. </u-sticky>
  15. <view class="flex align-center padding-left" style="margin-top: 40upx;">
  16. <image src="/static/songRank/medal.png" style="width: 32upx;height: 40upx"></image>
  17. <view style="font-size: 36upx;font-weight: 800;color: #000000;padding-left: 20upx;">提名歌曲</view>
  18. </view>
  19. <block v-for="(item, index) in rankList" :key="index">
  20. <block v-if="index == 0 || index == 1 || index == 2">
  21. <view class="margin-sm flex align-center" :class="index == 0 ? 'first' : index == 1 ? 'second' : index == 2 ? 'third' : '' ">
  22. <u-image width="200" height="200" :src="item.cover"></u-image>
  23. <view class="flex justify-between container" :style="{width: (index == 0 ? '70%': index == 1 ? '69%' : index == 2 ? '68%' : '60%')}">
  24. <view class="left" style="width: 65%;">
  25. <view class="name text-cut">{{item.title}}</view>
  26. <view class="padding-tb-sm text-sm">{{item.personName}}</view>
  27. <view class="hot-value">热力值 {{ +item.hotValue}}</view>
  28. </view>
  29. <view class="right">
  30. <view class="rank" :style="{coloar: (index == 0 ? '#ECDA47': index == 1 ? '#C1D4DA' : index == 2 ? '#C1D4DA' : '')}">
  31. NO.{{index + 1}}
  32. </view>
  33. <view>
  34. <button class="cu-btn round theme-bg-color sm text-white">
  35. <text class="cuIcon-hotfill"></text>
  36. <text class="padding-left-xs">打榜</text>
  37. </button>
  38. </view>
  39. </view>
  40. </view>
  41. </view>
  42. </block>
  43. <block v-else>
  44. <view class="flex" style="padding: 10upx 30upx 30upx 40upx;">
  45. <view class="flex justify-center align-center text-bold text-lg padding-right">{{index + 1}}</view>
  46. <image :src="item.cover" style="width: 120upx;height: 120upx;margin-right: 20upx;"></image>
  47. <view style="width: 70%;">
  48. <view class="flex justify-between">
  49. <view class="music" style="width: 75%;">
  50. <view class="name text-cut">{{item.title}}</view>
  51. <view class="author">{{item.personName}}</view>
  52. <view class="hot-vaule">热力值 {{ +item.hotValue}}</view>
  53. </view>
  54. <view class="flex align-end">
  55. <button class="cu-btn round lines-purple sm" style="width: 110upx;">打榜</button>
  56. </view>
  57. </view>
  58. <view class="margin-top-xs"><u-line color="#cacaca"></u-line> </view>
  59. </view>
  60. </view>
  61. </block>
  62. </block>
  63. </view>
  64. </template>
  65. <script>
  66. export default {
  67. data() {
  68. return {
  69. activityId:'1407016573251153922',
  70. current: 0,
  71. list: [{
  72. name: '全部'
  73. }],
  74. searValue: '不存在的关系 - XMASwu',
  75. rankList:[],
  76. }
  77. },
  78. onLoad() {
  79. this.getActivityDetail()
  80. this.getRankList()
  81. },
  82. methods: {
  83. change(index) {
  84. this.current = index;
  85. let name=this.list[index].name.replace("榜",'')
  86. if (name=='全部') {
  87. name=""
  88. }
  89. this.getRankList(name)
  90. },
  91. getActivityDetail(){
  92. this.$u.api.activity.detail({id:this.activityId}).then(res=>{
  93. let arr=res.classification.split(",")
  94. arr.forEach(item=>{
  95. let obj={
  96. name:item+'榜'
  97. }
  98. this.list.push(obj)
  99. })
  100. })
  101. },
  102. getRankList(name){
  103. let params={
  104. activityId:this.activityId
  105. }
  106. if (!this.$u.test.empty(name)) {
  107. params.personType=name
  108. }
  109. this.$u.api.production.list(params).then(res=>{
  110. this.rankList=res.records
  111. console.log(res.records);
  112. })
  113. }
  114. }
  115. }
  116. </script>
  117. <style lang="scss" scoped>
  118. .search {
  119. margin-top: -40upx;
  120. width: 80%;
  121. border-radius: 50upx;
  122. line-height: 60upx;
  123. background-color: #FFFFFF;
  124. display: flex;
  125. justify-content: center;
  126. align-items: center;
  127. color: #9D9D9D;
  128. font-size: 20upx;
  129. box-shadow: 10upx 20upx 60upx #d8d8d8;
  130. }
  131. .title {
  132. font-size: 56upx;
  133. font-family: PingFang SC;
  134. font-weight: 800;
  135. color: #FFFFFF;
  136. }
  137. .first {
  138. background-color: #fbf8e5;
  139. border-radius: 20upx;
  140. box-shadow: -1upx -1upx 60upx #d8d8d8;
  141. }
  142. .second {
  143. background-color: #f0f5f9;
  144. border-radius: 20upx;
  145. box-shadow: -1upx -1upx 60upx #d8d8d8;
  146. margin: 0 30upx;
  147. }
  148. .third {
  149. background-color: #fef0ef;
  150. border-radius: 20upx;
  151. box-shadow: -1upx -1upx 60upx #d8d8d8;
  152. margin: 20upx 40upx;
  153. }
  154. .container {
  155. .left {
  156. padding-left: 20upx;
  157. .name {
  158. font-size: 30upx;
  159. font-family: PingFang SC;
  160. font-weight: 800;
  161. color: #000000;
  162. }
  163. .hot-value {
  164. font-size: 24upx;
  165. font-family: PingFang SC;
  166. font-weight: 400;
  167. color: #3F372A;
  168. }
  169. }
  170. .right {
  171. text-align: center;
  172. padding-right: 10upx;
  173. .rank {
  174. height: 70%;
  175. font-size: 36upx;
  176. font-family: PingFang SC;
  177. font-weight: 800;
  178. font-style: italic;
  179. }
  180. }
  181. }
  182. .music {
  183. .name {
  184. font-size: 30upx;
  185. font-family: PingFang SC;
  186. font-weight: 400;
  187. color: #000000;
  188. }
  189. .author {
  190. font-size: 14upx;
  191. font-family: PingFang SC;
  192. font-weight: 400;
  193. color: #9A9A9A;
  194. }
  195. .hot-vaule {
  196. margin-top: 10upx;
  197. font-size: 14upx;
  198. font-family: PingFang SC;
  199. font-weight: 400;
  200. color: #3F372A;
  201. }
  202. }
  203. .lines-purple::after {
  204. border-color: #5a3ee8;
  205. }
  206. .lines-purple {
  207. color: #5a3ee8;
  208. }
  209. </style>