recharge-log.vue 4.4 KB

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