activity-view.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. <template>
  2. <view>
  3. <view class="searchBar">
  4. <search-bar :disabled="true"></search-bar>
  5. </view>
  6. <view class="padding-tb bg-white">
  7. <u-image width="100%" height="350" :src="activity.cover" @click="navByIcon('/pages/activityList/activity/activityDetail', 0)"></u-image>
  8. </view>
  9. <view class="flex justify-around text-center padding-tb bg-white">
  10. <block v-for="(item,index) in icons" :key="index">
  11. <view @click="navByIcon(item.url, index)">
  12. <image :src="item.image" style="width: 80upx;height: 80upx;"></image>
  13. <view class="margin-top-xs text-sm text-bold">{{item.name}}</view>
  14. </view>
  15. </block>
  16. </view>
  17. <view class="margin-top-sm bg-white flex justify-around align-end" style="height: 350upx;">
  18. <view class="second text-center" @click="navWithParm(rankList[1].userId)" v-if="!$u.test.isEmpty(rankList[1])">
  19. <view class="margin-top-sm">
  20. <u-avatar :src="rankList[1].avatar" size="120"></u-avatar>
  21. </view>
  22. <view class="text-bold text-lg text-black">{{rankList[1].totalHotValue}}</view>
  23. <view class="flex justify-center">
  24. <view class="hot-btn margin-top-xs">
  25. <text class="cuIcon-hotfill padding-right-xs"></text>
  26. <text>打榜</text>
  27. </view>
  28. </view>
  29. </view>
  30. <view class="first text-center" @click="navWithParm(rankList[0].userId)" v-if="!$u.test.isEmpty(rankList[0])">
  31. <view class="margin-top-sm">
  32. <u-avatar :src="rankList[0].avatar" size="130"></u-avatar>
  33. </view>
  34. <view class="margin-top-xs text-bold text-lg text-black">{{rankList[0].totalHotValue}}</view>
  35. <view class="flex justify-center">
  36. <view class="hot-btn margin-top-xs">
  37. <text class="cuIcon-hotfill padding-right-xs"></text>
  38. <text>打榜</text>
  39. </view>
  40. </view>
  41. </view>
  42. <view class="third text-center" @click="navWithParm(rankList[2].userId)" v-if="!$u.test.isEmpty(rankList[2])">
  43. <view class="margin-top-sm">
  44. <u-avatar :src="rankList[2].avatar" size="120"></u-avatar>
  45. </view>
  46. <view class="text-bold text-lg text-black">{{rankList[2].totalHotValue}}</view>
  47. <view class="flex justify-center">
  48. <view class="hot-btn margin-top-xs">
  49. <text class="cuIcon-hotfill padding-right-xs"></text>
  50. <text>打榜</text>
  51. </view>
  52. </view>
  53. </view>
  54. </view>
  55. <block v-for="(item, index) in rankList.slice(3, rankList.length + 1)" :key="index">
  56. <view class="padding-sm flex justify-between align-center bg-white" @click="navWithParm(item.userId)">
  57. <view class="flex justify-around align-center">
  58. <view class="padding-right text-black text-bold">{{index + 4}}</view>
  59. <view class="padding-right">
  60. <u-avatar :src="item.avatar" size="130"></u-avatar>
  61. </view>
  62. <view>
  63. <view class="text-bold text-black">{{item.name}}</view>
  64. <view class="margin-tb-xs">{{item.totalHotValue}} 热力值</view>
  65. </view>
  66. </view>
  67. <view class="padding-right">
  68. <button class="cu-btn round text-white" style="background-color: #583ce6;height: 68upx;">
  69. <text class="cuIcon-hotfill padding-right-xs"></text>
  70. <text>打榜</text>
  71. </button>
  72. </view>
  73. </view>
  74. </block>
  75. <view class="text-center bg-white" style="line-height: 80upx;" @click="navByIcon('/pages/activityList/activity/hot', 2)" v-if="!$u.test.isEmpty(rankList)">
  76. <text class="text-bold text-black">全部歌手</text>
  77. <text class="cuIcon-right"></text>
  78. </view>
  79. </view>
  80. </template>
  81. <script>
  82. import searchBar from "@/components/basic/search-bar.vue";
  83. export default {
  84. components: {
  85. searchBar,
  86. },
  87. props: {
  88. activityId: {
  89. type: String,
  90. default: ''
  91. },
  92. imgList: {
  93. type: Array,
  94. default() {
  95. return []
  96. }
  97. },
  98. },
  99. data() {
  100. return {
  101. icons: [
  102. {image: '/static/song.png', name: '活动介绍', url: '/pages/activityList/activity/activityDetail'},
  103. {image: '/static/signUp.png', name: '点击报名', url: '/pages/activityList/activity/signUp'},
  104. {image: '/static/hot.png', name: '热度榜', url: '/pages/activityList/activity/hot'},
  105. {image: '/static/activity.png', name: '我的奖金', url: '/pages/activityList/activity/awards'},
  106. {image: '/static/more.png', name: '更多', url: '/pages/activityList/activity/songRank'},
  107. ],
  108. activity: {},
  109. rankList: [],
  110. }
  111. },
  112. mounted() {
  113. this.getRankList();
  114. this.getActivityDetail();
  115. },
  116. methods: {
  117. getActivityDetail() {
  118. this.$u.api.activity.detail({id: this.activityId}).then(res => {
  119. this.activity = res;
  120. })
  121. },
  122. getRankList() {
  123. this.$u.api.activity.rankList({activityId: this.activityId}).then(res => {
  124. this.rankList = res.records;
  125. })
  126. },
  127. navByIcon(path, index) {
  128. let url;
  129. if (index == 0) { //图片 和 活动详情
  130. url = path + "?poster=" + this.activity.poster;
  131. }
  132. if (index == 1 || index == 2) { //报名 和 热榜
  133. url = path + "?activityId=" + this.activityId;
  134. }
  135. uni.navigateTo({
  136. url: url,
  137. })
  138. },
  139. //跳转需要带惨方法
  140. navWithParm(id) {
  141. uni.navigateTo({
  142. url: "/pages/activityList/activity/boost?activityId=" + this.activityId + "&userId=" + id,
  143. })
  144. },
  145. }
  146. }
  147. </script>
  148. <style lang="scss" scoped>
  149. .first {
  150. height: 300upx;
  151. width: 30%;
  152. border-radius: 30upx;
  153. box-shadow: -1upx -1upx 60upx #d8d8d8;
  154. }
  155. .second {
  156. height: 260upx;
  157. width: 27%;
  158. border-radius: 30upx;
  159. box-shadow: -1upx -1upx 60upx #d8d8d8;
  160. }
  161. .third {
  162. height: 260upx;
  163. width: 27%;
  164. border-radius: 30upx;
  165. box-shadow: -1upx -1upx 60upx #d8d8d8;
  166. }
  167. .hot-btn {
  168. color: #FFFFFF;
  169. line-height: 56upx;
  170. width: 70%;
  171. border-radius: 30upx;
  172. background-color: #583ce6;
  173. font-weight: bold;
  174. }
  175. </style>