boostDetail.vue 1.7 KB

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