boostDetail.vue 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <template>
  2. <view>
  3. <block v-if="$u.test.isEmpty(boostList)">
  4. <u-empty margin-top="300" text="暂无数据" mode="list"></u-empty>
  5. </block>
  6. <block v-else>
  7. <block v-for="(item, index) in boostList" :key="index">
  8. <view class="flex align-center justify-between boder">
  9. <view class="flex align-center" style="width: 55%;">
  10. <view class="padding-sm">
  11. <u-avatar :src="item.avatar" size="82"></u-avatar>
  12. </view>
  13. <view>
  14. <view class="name">{{item.nickName}}</view>
  15. <view class="time padding-top-xs">{{item.createTime}}</view>
  16. </view>
  17. </view>
  18. <view class="text-sm" style="color: #757575;">{{item.typeSub == 1 ? '打榜' : '打赏'}}</view>
  19. <view class="name padding-right flex justify-end" style="width: 180upx;">{{+item.totalHotValue}}热力值</view>
  20. </view>
  21. </block>
  22. <view style="height: 80rpx;" v-if="status">
  23. <u-divider bgColor="#f1f1f1;" height="80">到底了</u-divider>
  24. </view>
  25. </block>
  26. </view>
  27. </template>
  28. <script>
  29. export default {
  30. data() {
  31. return {
  32. current: 1,
  33. size: 30,
  34. status: false,
  35. boostList: [],
  36. }
  37. },
  38. onLoad() {
  39. this.userId = uni.getStorageSync("userId") || -1;
  40. this.getBoostDetail();
  41. },
  42. onReachBottom() {
  43. if (this.boostList.length < this.current * this.size) {
  44. this.status = true;
  45. } else {
  46. this.current += 1;
  47. this.getBoostDetail();
  48. }
  49. },
  50. methods: {
  51. getBoostDetail() {
  52. this.$u.api.boost.list({receiverId: this.userId, current: this.current, size: this.size}).then(res => {
  53. this.boostList = [...this.boostList,...res.records];
  54. })
  55. }
  56. }
  57. }
  58. </script>
  59. <style>
  60. .name {
  61. font-size: 26upx;
  62. font-family: PingFang SC;
  63. font-weight: bold;
  64. color: #111111;
  65. }
  66. .time {
  67. font-size: 22upx;
  68. font-family: PingFang SC;
  69. color: #9E9E9E;
  70. }
  71. .boder {
  72. margin: 20upx;
  73. box-shadow: -1upx -1upx 60upx #d0d0d0;
  74. border-radius: 30upx;
  75. }
  76. </style>