myBoost.vue 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <template>
  2. <view>
  3. <view class="bg-img" style="background-image: url('https://upload-file-data.obs.cn-south-1.myhuaweicloud.com/5f263a5a6e7c4f2493e0325f28ab659a-bgimg.png');height: 310upx;"></view>
  4. <block v-for="(item, index) in boostList" :key="index">
  5. <view class="flex align-center justify-between boder">
  6. <view class="flex align-center">
  7. <view class="padding-sm">
  8. <u-avatar :src="item.image" size="82"></u-avatar>
  9. </view>
  10. <view>
  11. <view class="name">{{item.name}}</view>
  12. <view class="time padding-top-xs">{{item.time}}</view>
  13. </view>
  14. </view>
  15. <view class="text-sm" style="color: #757575;">{{item.type}}</view>
  16. <view class="name padding-right flex justify-end" style="width: 180upx;">{{item.hotValue}}热力值</view>
  17. </view>
  18. </block>
  19. </view>
  20. </template>
  21. <script>
  22. export default {
  23. data() {
  24. return {
  25. boostList: [],
  26. userId: '',
  27. current: 0,
  28. size: 30,
  29. }
  30. },
  31. onLoad() {
  32. this.userId = uni.getStorageSync("userId") || -1;
  33. this.getMyBoostList();
  34. },
  35. onReachBottom() {
  36. if (this.boostList.length < this.current * this.size) {
  37. this.status = true;
  38. } else {
  39. this.current += 1;
  40. this.getMyBoostList();
  41. }
  42. },
  43. methods: {
  44. getMyBoostList() {
  45. this.$u.api.boost.myBoost({senderId: this.userId, current: this.current, size: this.size}).then(res => {
  46. this.boostList = [...this.boostList,...res.records];
  47. })
  48. }
  49. }
  50. }
  51. </script>
  52. <style lang="scss" scoped>
  53. .name {
  54. font-size: 26upx;
  55. font-family: PingFang SC;
  56. font-weight: bold;
  57. color: #111111;
  58. }
  59. .time {
  60. font-size: 16upx;
  61. font-family: PingFang SC;
  62. color: #9E9E9E;
  63. }
  64. .boder {
  65. margin: 20upx;
  66. box-shadow: -1upx -1upx 60upx #d0d0d0;
  67. border-radius: 30upx;
  68. }
  69. </style>