mall-uniapp/pages/pay/recharge-log.vue

168 lines
4.2 KiB
Vue
Raw Normal View History

2023-12-18 15:04:24 +00:00
<!-- 充值记录 -->
2022-11-22 07:45:36 +00:00
<template>
<s-layout class="widthdraw-log-wrap" title="充值记录">
<!-- 记录卡片 -->
<view class="wallet-log-box ss-p-b-30">
2023-12-18 15:04:24 +00:00
<view class="log-list" v-for="item in state.pagination.list" :key="item">
2022-11-22 07:45:36 +00:00
<view class="head ss-flex ss-col-center ss-row-between">
<view class="title">充值金额</view>
2023-12-18 15:04:24 +00:00
<view class="num" :class="item.refundStatus === 10 ? 'danger-color' : 'success-color'">
{{ fen2yuan(item.payPrice) }}
<text v-if="item.bonusPrice > 0"> {{ fen2yuan(item.bonusPrice) }} </text>
2023-12-18 15:04:24 +00:00
</view>
2022-11-22 07:45:36 +00:00
</view>
<view class="status-box item ss-flex ss-col-center ss-row-between">
<view class="item-title">支付状态</view>
<view
class="status-text"
2023-12-18 15:04:24 +00:00
:class="item.refundStatus === 10 ? 'danger-color' : 'success-color'"
2022-11-22 07:45:36 +00:00
>
2023-12-18 15:04:24 +00:00
{{ item.refundStatus === 10 ? '已退款' : '已支付' }}
</view>
2022-11-22 07:45:36 +00:00
</view>
<view class="time-box item ss-flex ss-col-center ss-row-between">
<text class="item-title">充值渠道</text>
2023-12-18 15:04:24 +00:00
<view class="time ss-ellipsis-1">{{ item.payChannelName }}</view>
2022-11-22 07:45:36 +00:00
</view>
<view class="time-box item ss-flex ss-col-center ss-row-between">
<text class="item-title">充值单号</text>
2023-12-18 15:04:24 +00:00
<view class="time"> {{ item.payOrderChannelOrderNo }} </view>
2022-11-22 07:45:36 +00:00
</view>
<view class="time-box item ss-flex ss-col-center ss-row-between">
<text class="item-title">充值时间</text>
<view class="time">
{{ sheep.$helper.timeFormat(item.payTime, 'yyyy-mm-dd hh:MM:ss') }}</view
>
2022-11-22 07:45:36 +00:00
</view>
</view>
</view>
<s-empty
v-if="state.pagination.total === 0"
icon="/static/comment-empty.png"
text="暂无充值记录"
2023-12-18 15:04:24 +00:00
/>
2022-11-22 07:45:36 +00:00
<uni-load-more
v-if="state.pagination.total > 0"
:status="state.loadStatus"
:content-text="{
contentdown: '上拉加载更多',
}"
2023-12-18 15:04:24 +00:00
@tap="loadMore"
2022-11-22 07:45:36 +00:00
/>
</s-layout>
</template>
<script setup>
import { reactive } from 'vue';
import { onLoad, onReachBottom } from '@dcloudio/uni-app';
import _ from 'lodash-es';
2023-12-18 15:04:24 +00:00
import PayWalletApi from '@/sheep/api/pay/wallet';
import sheep from '@/sheep';
import { fen2yuan } from '../../sheep/hooks/useGoods';
2022-11-22 07:45:36 +00:00
const state = reactive({
pagination: {
2023-12-18 15:04:24 +00:00
list: [],
total: 0,
pageNo: 1,
pageSize: 5,
2022-11-22 07:45:36 +00:00
},
loadStatus: '',
});
2023-12-18 15:04:24 +00:00
2022-11-22 07:45:36 +00:00
async function getLogList(page = 1, list_rows = 5) {
2023-12-18 15:04:24 +00:00
const { code, data } = await PayWalletApi.getWalletRechargePage({
pageNo: page,
pageSize: list_rows,
});
if (code !== 0) {
return;
2022-11-22 07:45:36 +00:00
}
2023-12-18 15:04:24 +00:00
state.pagination.list = _.concat(state.pagination.list, data.list);
state.pagination.total = data.total;
state.loadStatus = state.pagination.list.length < state.pagination.total ? 'more' : 'noMore';
2022-11-22 07:45:36 +00:00
}
2023-12-18 15:04:24 +00:00
2022-11-22 07:45:36 +00:00
// 加载更多
2023-12-18 15:04:24 +00:00
function loadMore() {
if (state.loadStatus === 'noMore') {
return;
2022-11-22 07:45:36 +00:00
}
2023-12-18 15:04:24 +00:00
state.pagination.pageNo++;
getLogList();
2022-11-22 07:45:36 +00:00
}
2023-12-18 15:04:24 +00:00
2022-11-22 07:45:36 +00:00
onLoad(() => {
getLogList();
});
2023-12-18 15:04:24 +00:00
2022-11-22 07:45:36 +00:00
onReachBottom(() => {
2023-12-18 15:04:24 +00:00
loadMore();
2022-11-22 07:45:36 +00:00
});
</script>
<style lang="scss" scoped>
// 记录卡片
.log-list {
min-height: 213rpx;
background: $white;
margin-bottom: 10rpx;
padding-bottom: 10rpx;
.head {
padding: 0 35rpx;
height: 80rpx;
border-bottom: 1rpx solid $gray-e;
margin-bottom: 20rpx;
.title {
font-size: 28rpx;
font-weight: 500;
color: $dark-3;
}
.num {
font-size: 28rpx;
font-weight: 500;
}
}
.item {
padding: 0 30rpx 10rpx;
.item-icon {
color: $gray-d;
font-size: 36rpx;
margin-right: 8rpx;
}
.item-title {
width: 180rpx;
font-size: 24rpx;
font-weight: 400;
color: #666666;
}
.status-text {
font-size: 24rpx;
font-weight: 500;
}
.time {
font-size: 24rpx;
font-weight: 400;
color: #c0c0c0;
}
}
}
.warning-color {
color: #faad14;
}
.danger-color {
color: #ff4d4f;
}
.success-color {
color: #67c23a;
}
</style>