recharge-log.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. <template>
  2. <s-layout class="widthdraw-log-wrap" title="充值记录">
  3. <!-- 记录卡片 -->
  4. <view class="wallet-log-box ss-p-b-30">
  5. <view class="log-list" v-for="item in state.pagination.data" :key="item">
  6. <view class="head ss-flex ss-col-center ss-row-between">
  7. <view class="title">充值金额</view>
  8. <view
  9. class="num"
  10. :class="
  11. item.status === -1
  12. ? 'danger-color'
  13. : item.status === 2
  14. ? 'success-color'
  15. : 'warning-color'
  16. "
  17. >{{ item.pay_fee }}元</view
  18. >
  19. </view>
  20. <view class="status-box item ss-flex ss-col-center ss-row-between">
  21. <view class="item-title">支付状态</view>
  22. <view
  23. class="status-text"
  24. :class="
  25. item.status === -1
  26. ? 'danger-color'
  27. : item.status === 2
  28. ? 'success-color'
  29. : 'warning-color'
  30. "
  31. >{{ item.status_text }}</view
  32. >
  33. </view>
  34. <view class="time-box item ss-flex ss-col-center ss-row-between">
  35. <text class="item-title">充值渠道</text>
  36. <view class="time ss-ellipsis-1">{{ item.platform_text }}</view>
  37. </view>
  38. <view class="time-box item ss-flex ss-col-center ss-row-between">
  39. <text class="item-title">充值单号</text>
  40. <view class="time"> {{ item.order_sn }} </view>
  41. </view>
  42. <view class="time-box item ss-flex ss-col-center ss-row-between">
  43. <text class="item-title">充值时间</text>
  44. <view class="time"> {{ item.paid_time }}</view>
  45. </view>
  46. </view>
  47. </view>
  48. <s-empty
  49. v-if="state.pagination.total === 0"
  50. icon="/static/comment-empty.png"
  51. text="暂无充值记录"
  52. ></s-empty>
  53. <uni-load-more
  54. v-if="state.pagination.total > 0"
  55. :status="state.loadStatus"
  56. :content-text="{
  57. contentdown: '上拉加载更多',
  58. }"
  59. @tap="loadmore"
  60. />
  61. </s-layout>
  62. </template>
  63. <script setup>
  64. import { reactive } from 'vue';
  65. import sheep from '@/sheep';
  66. import { onLoad, onReachBottom } from '@dcloudio/uni-app';
  67. import _ from 'lodash';
  68. const state = reactive({
  69. currentTab: 0,
  70. pagination: {
  71. data: [],
  72. current_page: 1,
  73. total: 1,
  74. last_page: 1,
  75. },
  76. loadStatus: '',
  77. });
  78. async function getLogList(page = 1, list_rows = 5) {
  79. const res = await sheep.$api.trade.orderLog({ type: 'recharge', list_rows, page });
  80. if (res.error === 0) {
  81. let logList = _.concat(state.pagination.data, res.data.data);
  82. state.pagination = {
  83. ...res.data,
  84. data: logList,
  85. };
  86. if (state.pagination.current_page < state.pagination.last_page) {
  87. state.loadStatus = 'more';
  88. } else {
  89. state.loadStatus = 'noMore';
  90. }
  91. }
  92. }
  93. // 加载更多
  94. function loadmore() {
  95. if (state.loadStatus !== 'noMore') {
  96. getLogList(state.pagination.current_page + 1);
  97. }
  98. }
  99. onLoad(() => {
  100. getLogList();
  101. });
  102. onReachBottom(() => {
  103. loadmore();
  104. });
  105. </script>
  106. <style lang="scss" scoped>
  107. // 记录卡片
  108. .log-list {
  109. min-height: 213rpx;
  110. background: $white;
  111. margin-bottom: 10rpx;
  112. padding-bottom: 10rpx;
  113. .head {
  114. padding: 0 35rpx;
  115. height: 80rpx;
  116. border-bottom: 1rpx solid $gray-e;
  117. margin-bottom: 20rpx;
  118. .title {
  119. font-size: 28rpx;
  120. font-weight: 500;
  121. color: $dark-3;
  122. }
  123. .num {
  124. font-size: 28rpx;
  125. font-weight: 500;
  126. }
  127. }
  128. .item {
  129. padding: 0 30rpx 10rpx;
  130. .item-icon {
  131. color: $gray-d;
  132. font-size: 36rpx;
  133. margin-right: 8rpx;
  134. }
  135. .item-title {
  136. width: 180rpx;
  137. font-size: 24rpx;
  138. font-weight: 400;
  139. color: #666666;
  140. }
  141. .status-text {
  142. font-size: 24rpx;
  143. font-weight: 500;
  144. }
  145. .time {
  146. font-size: 24rpx;
  147. font-weight: 400;
  148. color: #c0c0c0;
  149. }
  150. }
  151. }
  152. .warning-color {
  153. color: #faad14;
  154. }
  155. .danger-color {
  156. color: #ff4d4f;
  157. }
  158. .success-color {
  159. color: #67c23a;
  160. }
  161. </style>