activity-view.vue 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. <template>
  2. <view>
  3. <view class="searchBar">
  4. <search-bar :disabled="true" @onNavigator="navByIcon('/pages/activityList/activity/hot', 2)"></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].loginWebVO.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].loginWebVO.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].loginWebVO.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.loginWebVO.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 {authUrl} from '@/common/conf/config.js'
  83. import searchBar from "@/components/basic/search-bar.vue";
  84. export default {
  85. components: {
  86. searchBar,
  87. },
  88. props: {
  89. activityId: {
  90. type: String,
  91. default: ''
  92. },
  93. imgList: {
  94. type: Array,
  95. default() {
  96. return []
  97. }
  98. },
  99. },
  100. data() {
  101. return {
  102. icons: [
  103. {image: '/static/song.png', name: '活动介绍', url: '/pages/activityList/activity/activityDetail'},
  104. {image: '/static/signUp.png', name: '点击报名', url: '/pages/activityList/activity/signUp'},
  105. {image: '/static/hot.png', name: '热度榜', url: '/pages/activityList/activity/hot'},
  106. {image: '/static/activity.png', name: '我的奖金', url: '/pages/activityList/activity/awards'},
  107. {image: '/static/more.png', name: '更多', url: '/pages/activityList/activity/songRank'},
  108. ],
  109. activity: {},
  110. rankList: [],
  111. }
  112. },
  113. mounted() {
  114. this.getRankList();
  115. this.getActivityDetail();
  116. },
  117. methods: {
  118. getActivityDetail() {
  119. this.$u.api.activity.detail({id: this.activityId}).then(res => {
  120. this.activity = res;
  121. })
  122. },
  123. getRankList() {
  124. this.$u.api.activity.rankList({activityId: this.activityId}).then(res => {
  125. this.rankList = res.records;
  126. })
  127. },
  128. navByIcon(path, index) {
  129. let url;
  130. if (index == 0) { //图片 和 活动详情
  131. url = path + "?poster=" + this.activity.poster;
  132. }
  133. if (index == 1) { //报名
  134. let userId = uni.getStorageSync("userId")
  135. if (this.$u.test.isEmpty(userId)) {
  136. let param = "pages/activityList/home/home?activityId=" + this.activityId;
  137. window.location.href = authUrl(param);
  138. } else {
  139. url = path + "?activityId=" + this.activityId;
  140. }
  141. }
  142. if (index == 2) { //热榜
  143. url = path + "?activityId=" + this.activityId;
  144. }
  145. if (index == 3) { //我的奖金
  146. url = path;
  147. }
  148. if (index == 4) { //更多
  149. url = path;
  150. }
  151. uni.navigateTo({
  152. url: url,
  153. })
  154. },
  155. //跳转需要带惨方法
  156. navWithParm(id) {
  157. uni.navigateTo({
  158. url: "/pages/activityList/activity/boost?activityId=" + this.activityId + "&receiverId=" + id,
  159. })
  160. },
  161. }
  162. }
  163. </script>
  164. <style lang="scss" scoped>
  165. .first {
  166. height: 300upx;
  167. width: 30%;
  168. border-radius: 30upx;
  169. box-shadow: -1upx -1upx 60upx #d8d8d8;
  170. }
  171. .second {
  172. height: 260upx;
  173. width: 27%;
  174. border-radius: 30upx;
  175. box-shadow: -1upx -1upx 60upx #d8d8d8;
  176. }
  177. .third {
  178. height: 260upx;
  179. width: 27%;
  180. border-radius: 30upx;
  181. box-shadow: -1upx -1upx 60upx #d8d8d8;
  182. }
  183. .hot-btn {
  184. color: #FFFFFF;
  185. line-height: 56upx;
  186. width: 70%;
  187. border-radius: 30upx;
  188. background-color: #583ce6;
  189. font-weight: bold;
  190. }
  191. </style>