songRank.vue 5.7 KB

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