hot.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. <template>
  2. <view>
  3. <view class="searchBar">
  4. <search-bar :disabled="false" @onSearch="onSearch"></search-bar>
  5. </view>
  6. <block v-for="(item, index) in hotList" :key="index">
  7. <u-line color="#e8e8e8"></u-line>
  8. <view class="padding-sm flex justify-between align-center bg-white" @click="navWithParm(item.loginWebVO.id)">
  9. <view class="flex justify-around align-center">
  10. <view class="padding-right text-center text-black text-bold" style="width: 60upx;">{{item.loginWebVO.rank}}</view>
  11. <view class="padding-right">
  12. <u-avatar :src="item.loginWebVO.avatar" size="130"></u-avatar>
  13. </view>
  14. <view>
  15. <view class="text-bold text-black">{{item.loginWebVO.nickName}}</view>
  16. <view class="margin-tb-xs">{{+item.totalHotValue}} 热力值</view>
  17. </view>
  18. </view>
  19. <view class="padding-right">
  20. <button class="cu-btn round text-white" style="background-color: #583ce6;height: 68upx;">
  21. <text class="cuIcon-hotfill padding-right-xs"></text>
  22. <text>打榜</text>
  23. </button>
  24. </view>
  25. </view>
  26. </block>
  27. <view style="height: 80rpx;" v-if="status">
  28. <u-divider bgColor="#f1f1f1;" height="80">到底了</u-divider>
  29. </view>
  30. </view>
  31. </template>
  32. <script>
  33. import searchBar from "@/components/basic/search-bar.vue";
  34. export default {
  35. components: {
  36. searchBar,
  37. },
  38. data() {
  39. return {
  40. activityId: '',
  41. hotList: [],
  42. current: 1,
  43. size: 30,
  44. status: false,
  45. }
  46. },
  47. onLoad(options) {
  48. this.activityId = options.activityId;
  49. this.getRankList();
  50. },
  51. onReachBottom() {
  52. if (this.hotList.length < this.current * this.size) {
  53. this.status = true;
  54. } else {
  55. this.current += 1;
  56. this.getRankList();
  57. }
  58. },
  59. methods: {
  60. getRankList() {
  61. this.$u.api.activity.rankList({activityId: this.activityId, size: this.size, current: this.current}).then(res => {
  62. this.hotList = [...this.hotList,...res.records];
  63. })
  64. },
  65. //跳转需要带惨方法
  66. navWithParm(id) {
  67. uni.navigateTo({
  68. url: "/pages/activityList/activity/boost?activityId=" + this.activityId + "&receiverId=" + id,
  69. })
  70. },
  71. onSearch(value) {
  72. console.log(value);
  73. }
  74. }
  75. }
  76. </script>
  77. <style>
  78. </style>