recharge-log.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  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"> {{ sheep.$helper.timeFormat(item.payTime, 'yyyy-mm-dd hh:MM:ss') }}</view>
  34. </view>
  35. </view>
  36. </view>
  37. <s-empty
  38. v-if="state.pagination.total === 0"
  39. icon="/static/comment-empty.png"
  40. text="暂无充值记录"
  41. />
  42. <uni-load-more
  43. v-if="state.pagination.total > 0"
  44. :status="state.loadStatus"
  45. :content-text="{
  46. contentdown: '上拉加载更多',
  47. }"
  48. @tap="loadMore"
  49. />
  50. </s-layout>
  51. </template>
  52. <script setup>
  53. import { reactive } from 'vue';
  54. import { onLoad, onReachBottom } from '@dcloudio/uni-app';
  55. import _ from 'lodash';
  56. import PayWalletApi from '@/sheep/api/pay/wallet';
  57. import sheep from '@/sheep';
  58. import { fen2yuan } from '../../sheep/hooks/useGoods';
  59. const state = reactive({
  60. pagination: {
  61. list: [],
  62. total: 0,
  63. pageNo: 1,
  64. pageSize: 5,
  65. },
  66. loadStatus: '',
  67. });
  68. async function getLogList(page = 1, list_rows = 5) {
  69. const { code, data } = await PayWalletApi.getWalletRechargePage({
  70. pageNo: page,
  71. pageSize: list_rows,
  72. });
  73. if (code !== 0) {
  74. return;
  75. }
  76. state.pagination.list = _.concat(state.pagination.list, data.list);
  77. state.pagination.total = data.total;
  78. state.loadStatus = state.pagination.list.length < state.pagination.total ? 'more' : 'noMore';
  79. }
  80. // 加载更多
  81. function loadMore() {
  82. if (state.loadStatus === 'noMore') {
  83. return;
  84. }
  85. state.pagination.pageNo++;
  86. getLogList();
  87. }
  88. onLoad(() => {
  89. getLogList();
  90. });
  91. onReachBottom(() => {
  92. loadMore();
  93. });
  94. </script>
  95. <style lang="scss" scoped>
  96. // 记录卡片
  97. .log-list {
  98. min-height: 213rpx;
  99. background: $white;
  100. margin-bottom: 10rpx;
  101. padding-bottom: 10rpx;
  102. .head {
  103. padding: 0 35rpx;
  104. height: 80rpx;
  105. border-bottom: 1rpx solid $gray-e;
  106. margin-bottom: 20rpx;
  107. .title {
  108. font-size: 28rpx;
  109. font-weight: 500;
  110. color: $dark-3;
  111. }
  112. .num {
  113. font-size: 28rpx;
  114. font-weight: 500;
  115. }
  116. }
  117. .item {
  118. padding: 0 30rpx 10rpx;
  119. .item-icon {
  120. color: $gray-d;
  121. font-size: 36rpx;
  122. margin-right: 8rpx;
  123. }
  124. .item-title {
  125. width: 180rpx;
  126. font-size: 24rpx;
  127. font-weight: 400;
  128. color: #666666;
  129. }
  130. .status-text {
  131. font-size: 24rpx;
  132. font-weight: 500;
  133. }
  134. .time {
  135. font-size: 24rpx;
  136. font-weight: 400;
  137. color: #c0c0c0;
  138. }
  139. }
  140. }
  141. .warning-color {
  142. color: #faad14;
  143. }
  144. .danger-color {
  145. color: #ff4d4f;
  146. }
  147. .success-color {
  148. color: #67c23a;
  149. }
  150. </style>