speardorder.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. <template>
  2. <view class="content">
  3. <view class="main" v-for="(item, index) in list">
  4. <view class="main-title">{{ item.time }}</view>
  5. <view class="main-item" v-for="(itm, ind) in item.child">
  6. <view class="main-item-top flex">
  7. <view class="main-userinfo">
  8. <image class="avatar" :src="itm.avatar" mode=""></image>
  9. <view class="main-name">{{ itm.nickname }}</view>
  10. </view>
  11. <view class="main-time">{{ itm.time }}</view>
  12. </view>
  13. <view class="main-item-bottom flex">
  14. <view class="orderId">订单号:{{ itm.order_id }}</view>
  15. <view class="money">
  16. 支付金额:
  17. <text>¥{{ itm.number }}</text>
  18. </view>
  19. </view>
  20. </view>
  21. </view>
  22. </view>
  23. </template>
  24. <script>
  25. import { spreadOrder } from '@/api/user.js';
  26. export default {
  27. data() {
  28. return {
  29. list: [],
  30. loadingType: 'more',
  31. orderList: [],
  32. page: 1, //当前页数
  33. limit: 10 //每次信息条数
  34. };
  35. },
  36. onLoad() {},
  37. onShow() {
  38. this.loadData();
  39. },
  40. onReachBottom() {
  41. this.loadData();
  42. },
  43. onReady() {},
  44. methods: {
  45. loadData() {
  46. if (this.loadingType === 'loading' || this.loadingType === 'noMore') {
  47. //防止重复加载
  48. return;
  49. }
  50. this.loadingType = 'loading';
  51. spreadOrder({ page: this.page, limit: this.limit }).then(({ data }) => {
  52. this.list = this.list.concat(data.list);
  53. this.page++;
  54. if (this.limit == data.list.length) {
  55. this.loadingType = 'more';
  56. } else {
  57. this.loadingType = 'noMore';
  58. }
  59. });
  60. }
  61. }
  62. };
  63. </script>
  64. <style lang="scss">
  65. page,
  66. .content {
  67. min-height: 100%;
  68. height: auto;
  69. }
  70. .main {
  71. padding: 10rpx 20rpx 0;
  72. .main-title {
  73. font-size: 30rpx;
  74. font-family: PingFang SC;
  75. font-weight: 500;
  76. color: #333333;
  77. }
  78. .main-item {
  79. background: #ffffff;
  80. margin: 20rpx auto 0;
  81. padding: 20rpx;
  82. border-radius: 10rpx;
  83. .main-userinfo {
  84. display: flex;
  85. align-items: center;
  86. .avatar {
  87. height: 60rpx;
  88. width: 60rpx;
  89. border-radius: 50%;
  90. }
  91. .main-name {
  92. margin-left: 10rpx;
  93. font-size: 28rpx;
  94. font-family: PingFang SC;
  95. font-weight: bolder;
  96. color: #333333;
  97. }
  98. }
  99. .main-time {
  100. font-size: 24rpx;
  101. font-family: PingFang SC;
  102. font-weight: 500;
  103. color: #929296;
  104. }
  105. .main-item-bottom {
  106. margin-top: 10rpx;
  107. .orderId {
  108. font-size: 24rpx;
  109. font-family: PingFang SC;
  110. font-weight: 500;
  111. color: #929296;
  112. }
  113. .money {
  114. font-size: 24rpx;
  115. font-family: PingFang SC;
  116. font-weight: bolder;
  117. color: #333333;
  118. text {
  119. color: #fd4c4d;
  120. }
  121. }
  122. }
  123. }
  124. }
  125. </style>