boostDetail.vue 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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.loginWebVO.avatar" size="82"></u-avatar>
  12. </view>
  13. <view>
  14. <view class="name">{{item.loginWebVO.nickName}}</view>
  15. <view class="time padding-top-xs">{{item.createTime}}</view>
  16. </view>
  17. </view>
  18. <view class="text-sm" style="color: #757575;" v-if="item.type==1">{{item.note}}</view>
  19. <view class="text-sm" style="color: #757575;" v-if="item.type==2">商品兑换</view>
  20. <view class="text-sm" style="color: #757575;" v-if="item.type==3">奖金提现</view>
  21. <view class="name padding-right flex justify-end" style="width: 180upx;">{{+item.hotValue}}热力值</view>
  22. </view>
  23. </block>
  24. <view style="height: 80rpx;" v-if="status">
  25. <u-divider bgColor="#f1f1f1;" height="80">到底了</u-divider>
  26. </view>
  27. </block>
  28. </view>
  29. </template>
  30. <script>
  31. export default {
  32. data() {
  33. return {
  34. current: 1,
  35. size: 30,
  36. status: false,
  37. boostList: [],
  38. }
  39. },
  40. onLoad() {
  41. this.userId = uni.getStorageSync("userId");
  42. this.getBoostDetail();
  43. },
  44. onReachBottom() {
  45. if (this.boostList.length < this.current * this.size) {
  46. this.status = true;
  47. } else {
  48. this.current += 1;
  49. this.getBoostDetail();
  50. }
  51. },
  52. methods: {
  53. getBoostDetail() {
  54. this.$u.api.boost.list({userId: this.userId, current: this.current, size: this.size}).then(res => {
  55. this.boostList = [...this.boostList,...res.records];
  56. })
  57. }
  58. }
  59. }
  60. </script>
  61. <style>
  62. .name {
  63. font-size: 26upx;
  64. font-family: PingFang SC;
  65. font-weight: bold;
  66. color: #111111;
  67. }
  68. .time {
  69. font-size: 22upx;
  70. font-family: PingFang SC;
  71. color: #9E9E9E;
  72. }
  73. .boder {
  74. margin: 20upx;
  75. box-shadow: -1upx -1upx 60upx #d0d0d0;
  76. border-radius: 30upx;
  77. }
  78. </style>