top-up-log.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. <!-- 充值记录 -->
  2. <template>
  3. <view class="wallet-log-box u-p-b-30">
  4. <view class="log-list" v-for="item in rechargeLog" :key="item.id">
  5. <view class="head u-flex u-col-center u-row-between">
  6. <view class="title">{{item.pay_type_text}}充值</view>
  7. <view class="num">{{ item.total_fee }} 元</view>
  8. </view>
  9. <view class="time-box item u-flex u-col-center u-row-between">
  10. <view class="item-title u-flex u-col-center"><text class="u-iconfont uicon-order u-m-r-10"></text>充值单号
  11. </view>
  12. <view class="time">{{item.order_sn}}</view>
  13. </view>
  14. <view class="time-box item u-flex u-col-center u-row-between">
  15. <view class="item-title u-flex u-col-center"><text class="u-iconfont uicon-clock u-m-r-10"></text>充值时间
  16. </view>
  17. <view class="time">{{$u.timeFormat(item.createtime, 'yyyy.mm.dd hh:MM:ss')}}</view>
  18. </view>
  19. </view>
  20. <!-- 更多 -->
  21. <u-loadmore v-show="!isEmpty" height="80rpx" :status="loadStatus" icon-type="flower" color="#ccc" />
  22. <!-- 空置页 -->
  23. <shopro-empty v-if="isEmpty" marginTop="300rpx" :image="$IMG_URL + '/imgs/empty/no_data.png'" tipText="暂无数据~">
  24. </shopro-empty>
  25. </view>
  26. </template>
  27. <script>
  28. export default {
  29. components: {},
  30. data() {
  31. return {
  32. rechargeLog: [],
  33. loadStatus: 'loadmore', //loadmore-加载前的状态,loading-加载中的状态,nomore-没有更多的状态
  34. currentPage: 1,
  35. lastPage: 1,
  36. isEmpty: false,
  37. };
  38. },
  39. computed: {},
  40. onLoad() {
  41. this.getLog();
  42. },
  43. // 触底加载更多
  44. onReachBottom() {
  45. if (this.currentPage < this.lastPage) {
  46. this.currentPage += 1;
  47. this.getLog();
  48. }
  49. },
  50. methods: {
  51. // 确认提交表单
  52. getLog() {
  53. let that = this;
  54. that.loadStatus = 'loading';
  55. that.$http('money.rechargeLog', {
  56. page: that.currentPage
  57. }).then(res => {
  58. if (res.code === 1) {
  59. that.rechargeLog = [...that.rechargeLog, ...res.data.data];
  60. that.isEmpty = !that.rechargeLog.length;
  61. that.lastPage = res.data.last_page;
  62. that.loadStatus = that.currentPage < res.data.last_page ? 'loadmore' : 'nomore';
  63. }
  64. });
  65. }
  66. }
  67. };
  68. </script>
  69. <style lang="scss">
  70. // 记录卡片
  71. .log-list {
  72. min-height: 213rpx;
  73. background: #ffffff;
  74. margin-bottom: 10rpx;
  75. padding-bottom: 10rpx;
  76. .head {
  77. padding: 0 35rpx;
  78. height: 80rpx;
  79. border-bottom: 1rpx solid #eee;
  80. margin-bottom: 20rpx;
  81. .title {
  82. font-size: 28rpx;
  83. font-weight: 500;
  84. color: #333333;
  85. }
  86. .num {
  87. font-size: 28rpx;
  88. font-weight: 500;
  89. color: #7063d2;
  90. }
  91. }
  92. .item {
  93. padding: 0 30rpx 10rpx;
  94. .item-icon {
  95. color: #c0c0c0;
  96. font-size: 36rpx;
  97. margin-right: 8rpx;
  98. }
  99. .item-title {
  100. width: 180rpx;
  101. font-size: 24rpx;
  102. font-weight: 400;
  103. color: #c0c0c0;
  104. }
  105. .status-text {
  106. font-size: 24rpx;
  107. font-weight: 500;
  108. color: #05c3a1;
  109. }
  110. .time {
  111. font-size: 24rpx;
  112. font-weight: 400;
  113. color: #c0c0c0;
  114. }
  115. }
  116. }
  117. </style>