hxjl.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. <template>
  2. <view class="content">
  3. <view class="" style="height: 20rpx;"></view>
  4. <empty v-if="list.length === 0"></empty>
  5. <view class="hx-wrap" v-for="item in list">
  6. <view class="hx-tit flex">
  7. <view class="hx-time">核销时间:{{ item.add_time }}</view>
  8. <view class="hx-status">已核销</view>
  9. </view>
  10. <view class="hx-info flex">
  11. <view class="user-logo"><image :src="item.avatar" mode=""></image></view>
  12. <view class="user-info">
  13. <view class="info-name clamp">{{ item.nickname }}</view>
  14. <view class="info-phone clamp">{{item.coupon_title}}</view>
  15. <view class="info-info">实付:¥{{ item.coupon_price }} 数量:1</view>
  16. </view>
  17. </view>
  18. </view>
  19. <uni-load-more :status="loadingType"></uni-load-more>
  20. <view class="" style="height: 3rpx;"></view>
  21. </view>
  22. </template>
  23. <script>
  24. import empty from '@/components/empty';
  25. import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
  26. import { write_off } from '@/api/user.js';
  27. export default {
  28. components: {
  29. empty,
  30. uniLoadMore
  31. },
  32. data() {
  33. return {
  34. loadingType: 'more',
  35. list: [],
  36. page: 1,
  37. limit: 10
  38. };
  39. },
  40. onShow() {
  41. this.loadingType = 'more';
  42. this.list = [];
  43. this.page = 1;
  44. this.limit = 10;
  45. this.getList();
  46. },
  47. onReachBottom() {
  48. this.getList();
  49. },
  50. methods: {
  51. getList() {
  52. let obj = this;
  53. if (obj.loadingType == 'loading' || obj.loadingType == 'noMore') {
  54. return;
  55. }
  56. obj.loadingType = 'loading';
  57. write_off({
  58. page: obj.page,
  59. limit: obj.limit
  60. }).then(data => {
  61. console.log(data, '123456789');
  62. obj.list = obj.list.concat(data.data);
  63. if (obj.limit == data.data.length) {
  64. obj.page++;
  65. obj.loadingType = 'more';
  66. } else {
  67. obj.loadingType = 'noMore';
  68. }
  69. });
  70. }
  71. }
  72. };
  73. </script>
  74. <style lang="scss">
  75. .hx-wrap {
  76. width: 702rpx;
  77. height: 194rpx;
  78. background: #ffffff;
  79. box-shadow: 0px 0px 20rpx 0px rgba(50, 50, 52, 0.06);
  80. border-radius: 10rpx;
  81. margin: 0 auto 17rpx;
  82. padding: 30rpx 30rpx 0;
  83. .hx-tit {
  84. font-size: 26rpx;
  85. font-weight: 500;
  86. color: #999999;
  87. }
  88. .hx-info {
  89. justify-content: flex-start;
  90. padding-top: 20rpx;
  91. .user-logo {
  92. flex-shrink: 0;
  93. image {
  94. width: 64rpx;
  95. height: 64rpx;
  96. }
  97. }
  98. .user-info {
  99. padding-left: 26rpx;
  100. max-width: 500rpx;
  101. .info-name {
  102. font-size: 30rpx;
  103. font-weight: bold;
  104. color: #333333;
  105. }
  106. .info-phone {
  107. font-size: 30rpx;
  108. font-weight: 500;
  109. color: #666666;
  110. }
  111. .info-info {
  112. font-size: 22rpx;
  113. font-weight: 400;
  114. color: #999999;
  115. }
  116. }
  117. }
  118. }
  119. </style>