2025-01-07 09:35:24 +08:00
|
|
|
|
<template>
|
|
|
|
|
|
<view>
|
2025-02-19 09:34:34 +08:00
|
|
|
|
<Navbar title="充值记录" :goTo="paths.remainingSum" :showRightText="true" :isBack="false" :text="'充值日期'" @clickIcon="handleRightText"/>
|
2025-03-14 15:15:54 +08:00
|
|
|
|
<u-loading-page :loading="showLoading" loading-text="加载中..."></u-loading-page>
|
|
|
|
|
|
<view class="recharge-history" v-if="!showLoading">
|
2025-01-07 09:35:24 +08:00
|
|
|
|
<!-- 顶部标签导航 -->
|
2025-02-19 09:34:34 +08:00
|
|
|
|
<view class="tab-navigation">
|
2025-01-07 09:35:24 +08:00
|
|
|
|
<Tabs :tabList="tabList" @changeTab="changeTab" />
|
2025-03-14 15:15:54 +08:00
|
|
|
|
</view>
|
|
|
|
|
|
<!-- 充值记录列表 -->
|
2025-02-19 09:34:34 +08:00
|
|
|
|
<scroll-view scroll-y @scrolltolower="onScrollTolower" class="record-list">
|
|
|
|
|
|
<view v-for="(record, index) in rechargeRecords" :key="index" class="record-item">
|
2025-01-07 09:35:24 +08:00
|
|
|
|
<!-- 左侧图标 -->
|
2025-02-19 09:34:34 +08:00
|
|
|
|
<u-icon :name="getIconClass(record.type)" size="42"></u-icon>
|
|
|
|
|
|
<!-- <text>{{index}}</text> -->
|
2025-01-07 09:35:24 +08:00
|
|
|
|
<!-- 中间充值详情 -->
|
2025-02-19 09:34:34 +08:00
|
|
|
|
<view class="record-details">
|
|
|
|
|
|
<view class="status" v-if="record.payState<=3" style="color: seagreen;">{{ record.payStateName }}</view>
|
|
|
|
|
|
<view class="status" v-if="record.payState>3" style="color: red;">{{ record.payStateName }}</view>
|
|
|
|
|
|
<view class="time">充值方式:{{ record.payTypeName }}</view>
|
|
|
|
|
|
<view class="time">{{ record.tradeTime }}</view>
|
2025-03-14 15:15:54 +08:00
|
|
|
|
<view class="time" v-if="record.payState==4">失败原因:{{ record.failReason }}</view>
|
2025-02-19 09:34:34 +08:00
|
|
|
|
</view>
|
2025-01-07 09:35:24 +08:00
|
|
|
|
<!-- 右侧金额信息 -->
|
2025-02-19 09:34:34 +08:00
|
|
|
|
<view class="amount-info">
|
|
|
|
|
|
<view class="amount">¥{{ (record.amount/100).toFixed(2) }}</view>
|
2025-03-14 15:15:54 +08:00
|
|
|
|
<view class="balance" v-if="record.payState==3">余额: {{ (record.walletBalTotal/100).toFixed(2) }}</view>
|
|
|
|
|
|
<view class="query-btn" v-if="record.payState==2" @click="queryResult(record)">再次查询充值结果</view>
|
|
|
|
|
|
</view>
|
2025-02-19 09:34:34 +08:00
|
|
|
|
</view>
|
2025-03-14 15:15:54 +08:00
|
|
|
|
</scroll-view>
|
2025-02-19 09:34:34 +08:00
|
|
|
|
</view>
|
2025-03-14 15:15:54 +08:00
|
|
|
|
<u-datetime-picker
|
|
|
|
|
|
ref="datetimePicker"
|
|
|
|
|
|
:show="show"
|
|
|
|
|
|
v-model="dateValue"
|
|
|
|
|
|
title="选择日期"
|
|
|
|
|
|
:filter="filter"
|
|
|
|
|
|
mode="date"
|
|
|
|
|
|
closeOnClickOverlay
|
|
|
|
|
|
@confirm="confirm"
|
|
|
|
|
|
@cancel="cancel"
|
|
|
|
|
|
@change="change"
|
|
|
|
|
|
@close="close"
|
|
|
|
|
|
></u-datetime-picker>
|
2025-01-07 09:35:24 +08:00
|
|
|
|
</view>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
2025-03-14 15:15:54 +08:00
|
|
|
|
import { chargeRecordApi,getRechargeQueryResultApi } from '../../api/index/index'
|
2025-01-07 09:35:24 +08:00
|
|
|
|
import Tabs from '@/pages/components/Tabs.vue'
|
|
|
|
|
|
import UIcon from '../../uni_modules/uview-ui/components/u-icon/u-icon.vue'
|
|
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
|
name: 'rechargeRecord',
|
|
|
|
|
|
components: { UIcon, Tabs },
|
|
|
|
|
|
data() {
|
|
|
|
|
|
return {
|
2025-03-14 15:15:54 +08:00
|
|
|
|
showLoading:true,
|
2025-01-07 09:35:24 +08:00
|
|
|
|
paths: {
|
|
|
|
|
|
remainingSum: '/pages/remainingSum/index'
|
|
|
|
|
|
},
|
|
|
|
|
|
current: 0,
|
2025-02-19 09:34:34 +08:00
|
|
|
|
show: false,
|
2025-03-14 15:15:54 +08:00
|
|
|
|
dateValue:new Date(),
|
|
|
|
|
|
startDateTime:"",
|
|
|
|
|
|
endDateTime: "",
|
2025-01-07 09:35:24 +08:00
|
|
|
|
activeTab: 'all',
|
|
|
|
|
|
tabs: [
|
|
|
|
|
|
{ id: 'all', name: '全部' },
|
|
|
|
|
|
{ id: 'success', name: '充值成功' },
|
|
|
|
|
|
{ id: 'failed', name: '充值失败' },
|
|
|
|
|
|
{ id: 'timeout', name: '充值超时' }
|
|
|
|
|
|
],
|
2025-03-14 15:15:54 +08:00
|
|
|
|
tabList: ['全部', '充值成功', '充值失败', '充值超时'],
|
2025-02-19 09:34:34 +08:00
|
|
|
|
queryParam:{
|
|
|
|
|
|
pageNum:1,
|
|
|
|
|
|
pageSize:10
|
|
|
|
|
|
},
|
|
|
|
|
|
rechargeState:"",
|
|
|
|
|
|
total:0,
|
|
|
|
|
|
rechargeRecords: []
|
2025-01-07 09:35:24 +08:00
|
|
|
|
}
|
|
|
|
|
|
},
|
2025-02-19 09:34:34 +08:00
|
|
|
|
onLoad() {
|
|
|
|
|
|
this.getRecordList()
|
2025-03-14 15:15:54 +08:00
|
|
|
|
setTimeout(()=>{
|
|
|
|
|
|
this.showLoading=false
|
|
|
|
|
|
},500)
|
2025-02-19 09:34:34 +08:00
|
|
|
|
},
|
2025-01-07 09:35:24 +08:00
|
|
|
|
methods: {
|
2025-03-14 15:15:54 +08:00
|
|
|
|
//再次查询充值结果
|
|
|
|
|
|
async queryResult(item){
|
|
|
|
|
|
console.log(item)
|
|
|
|
|
|
let param = {
|
|
|
|
|
|
"accTradeId": item.tradeId,
|
|
|
|
|
|
}
|
|
|
|
|
|
const res = await getRechargeQueryResultApi(param)
|
|
|
|
|
|
if(res.code==200){
|
|
|
|
|
|
this.getRecordList()
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
2025-02-19 09:34:34 +08:00
|
|
|
|
onScrollTolower(){
|
|
|
|
|
|
if(this.total>this.rechargeRecords.length){
|
|
|
|
|
|
this.queryParam.pageNum++
|
|
|
|
|
|
this.getRecordList()
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
async getRecordList() {
|
|
|
|
|
|
let params = {
|
|
|
|
|
|
custId: uni.getStorageSync('custId'),
|
|
|
|
|
|
rechargeState:this.rechargeState,
|
|
|
|
|
|
current:this.queryParam.pageNum,
|
|
|
|
|
|
size:this.queryParam.pageSize,
|
2025-03-14 15:15:54 +08:00
|
|
|
|
startDateTime:this.startDateTime,
|
|
|
|
|
|
endDateTime:this.endDateTime
|
|
|
|
|
|
|
2025-02-19 09:34:34 +08:00
|
|
|
|
}
|
|
|
|
|
|
const res = await chargeRecordApi(params)
|
|
|
|
|
|
console.log('🚀 ~ getBalance ~ res', res)
|
|
|
|
|
|
// this.rechargeRecords = res.records;
|
|
|
|
|
|
this.total=res.total;
|
|
|
|
|
|
res.records.forEach(item=>{
|
|
|
|
|
|
item.tradeTime = item.tradeTime.replace('T', ' ')
|
|
|
|
|
|
})
|
|
|
|
|
|
if (this.queryParam.pageNum==1) {
|
|
|
|
|
|
this.rechargeRecords = res.records
|
|
|
|
|
|
} else {
|
|
|
|
|
|
this.rechargeRecords.push(...res.records)
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
},
|
2025-01-07 09:35:24 +08:00
|
|
|
|
changeTab(index) {
|
|
|
|
|
|
console.log('🚀 ~ changeTab ~ index:', index)
|
2025-02-19 09:34:34 +08:00
|
|
|
|
this.tabIndex = index;
|
|
|
|
|
|
if(index==0){
|
|
|
|
|
|
this.rechargeState="";
|
|
|
|
|
|
this.queryParam.pageNum=1;
|
|
|
|
|
|
this.getRecordList()
|
|
|
|
|
|
}else{
|
|
|
|
|
|
this.rechargeState=index;
|
|
|
|
|
|
this.queryParam.pageNum=1;
|
|
|
|
|
|
this.getRecordList()
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-01-07 09:35:24 +08:00
|
|
|
|
},
|
|
|
|
|
|
filter(type, options) {
|
2025-02-19 09:34:34 +08:00
|
|
|
|
// if (type === 'year') {
|
|
|
|
|
|
// return options.filter((option) => option % 2 === 0)
|
|
|
|
|
|
// }
|
2025-01-07 09:35:24 +08:00
|
|
|
|
return options
|
|
|
|
|
|
},
|
|
|
|
|
|
confirm(e) {
|
2025-03-14 15:15:54 +08:00
|
|
|
|
this.show = false;
|
2025-02-19 09:34:34 +08:00
|
|
|
|
if (!isNaN(e.value)) {
|
2025-03-14 15:15:54 +08:00
|
|
|
|
// const timestamp = parseInt(e.value);
|
|
|
|
|
|
const selectedDate = new Date(e.value);
|
|
|
|
|
|
console.log(selectedDate)
|
2025-02-19 09:34:34 +08:00
|
|
|
|
const year = selectedDate.getFullYear();
|
|
|
|
|
|
const month = ("0" + (selectedDate.getMonth() + 1)).slice(-2);
|
2025-03-14 15:15:54 +08:00
|
|
|
|
const day = ("0" + selectedDate.getDate()).slice(-2);
|
2025-02-19 09:34:34 +08:00
|
|
|
|
const hours = ("0" + selectedDate.getHours()).slice(-2);
|
|
|
|
|
|
const minutes = ("0" + selectedDate.getMinutes()).slice(-2);
|
2025-03-14 15:15:54 +08:00
|
|
|
|
const seconds = ("0" + selectedDate.getSeconds()).slice(-2);
|
|
|
|
|
|
this.startDateTime = `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
|
|
|
|
|
|
const endDate = new Date(selectedDate.getTime() + 86400000)
|
|
|
|
|
|
const year2 = endDate.getFullYear();
|
|
|
|
|
|
const month2 = ("0" + (endDate.getMonth() + 1)).slice(-2);
|
|
|
|
|
|
const day2 = ("0" + endDate.getDate()).slice(-2);
|
|
|
|
|
|
this.endDateTime = `${year2}-${month2}-${day2} 23:59:59`
|
2025-02-19 09:34:34 +08:00
|
|
|
|
this.show = false;
|
|
|
|
|
|
this.queryParam.pageNum=1;
|
|
|
|
|
|
this.getRecordList()
|
|
|
|
|
|
}
|
2025-03-14 15:15:54 +08:00
|
|
|
|
console.log(this.startDateTime)
|
|
|
|
|
|
console.log(this.endDateTime)
|
2025-01-07 09:35:24 +08:00
|
|
|
|
},
|
|
|
|
|
|
cancel() {
|
2025-02-19 09:34:34 +08:00
|
|
|
|
this.show = false;
|
2025-01-07 09:35:24 +08:00
|
|
|
|
},
|
|
|
|
|
|
change(e) {
|
|
|
|
|
|
console.log('change', e)
|
|
|
|
|
|
},
|
|
|
|
|
|
close() {
|
2025-02-19 09:34:34 +08:00
|
|
|
|
this.show = false;
|
2025-01-07 09:35:24 +08:00
|
|
|
|
},
|
|
|
|
|
|
handleRightText() {
|
|
|
|
|
|
console.log('🚀 ~ handleRightText ~ ')
|
|
|
|
|
|
this.current = 5
|
2025-02-19 09:34:34 +08:00
|
|
|
|
this.show = true
|
2025-01-07 09:35:24 +08:00
|
|
|
|
},
|
|
|
|
|
|
setActiveTab(tabId) {
|
|
|
|
|
|
this.activeTab = tabId
|
|
|
|
|
|
},
|
|
|
|
|
|
getIconClass(type) {
|
|
|
|
|
|
switch (type) {
|
|
|
|
|
|
case 'wechat':
|
|
|
|
|
|
return require('../../static/images/successful.png')
|
|
|
|
|
|
case 'wallet':
|
|
|
|
|
|
return require('../../static/images/lose.png')
|
|
|
|
|
|
default:
|
|
|
|
|
|
return require('../../static/images/delay.png')
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<style scoped lang="scss">
|
|
|
|
|
|
page {
|
|
|
|
|
|
background: #fff;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.recharge-history {
|
|
|
|
|
|
background: #fff;
|
|
|
|
|
|
//background-color: #f3f4f6;
|
2025-02-19 09:34:34 +08:00
|
|
|
|
min-height: 94vh;
|
2025-01-07 09:35:24 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.tab-navigation {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
background-color: white;
|
|
|
|
|
|
padding: 15px 16px 0 16px;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.tab {
|
|
|
|
|
|
padding: 12px 16px;
|
|
|
|
|
|
position: relative;
|
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.tab.active {
|
|
|
|
|
|
color: #f97316;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.tab.active::after {
|
|
|
|
|
|
content: '';
|
|
|
|
|
|
position: absolute;
|
|
|
|
|
|
bottom: 0;
|
|
|
|
|
|
left: 0;
|
|
|
|
|
|
width: 100%;
|
|
|
|
|
|
height: 2px;
|
|
|
|
|
|
background-color: #f97316;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.record-list {
|
2025-02-19 09:34:34 +08:00
|
|
|
|
// background-color: #22c55e;
|
|
|
|
|
|
height: 87vh;
|
2025-01-07 09:35:24 +08:00
|
|
|
|
//padding: 0 16px;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.record-item {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
background-color: white;
|
|
|
|
|
|
margin-top: 8px;
|
|
|
|
|
|
padding: 16px;
|
|
|
|
|
|
border-radius: 8px;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.icon {
|
|
|
|
|
|
width: 40px;
|
|
|
|
|
|
height: 40px;
|
|
|
|
|
|
border-radius: 50%;
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
justify-content: center;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.inner-circle {
|
|
|
|
|
|
width: 24px;
|
|
|
|
|
|
height: 24px;
|
|
|
|
|
|
background-color: white;
|
|
|
|
|
|
border-radius: 50%;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.default-icon {
|
|
|
|
|
|
background-color: #3b82f6;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.wechat-icon {
|
|
|
|
|
|
background-color: #22c55e;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.wallet-icon {
|
|
|
|
|
|
background-color: #f97316;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.record-details {
|
|
|
|
|
|
flex: 1;
|
|
|
|
|
|
margin-left: 12px;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.status {
|
|
|
|
|
|
font-size: 16px;
|
|
|
|
|
|
font-weight: 500;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.time {
|
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
|
color: #6b7280;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.amount-info {
|
|
|
|
|
|
text-align: right;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.amount {
|
|
|
|
|
|
color: #f97316;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.balance {
|
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
|
color: #6b7280;
|
|
|
|
|
|
}
|
2025-03-14 15:15:54 +08:00
|
|
|
|
.query-btn{
|
|
|
|
|
|
padding: 14rpx 10rpx;
|
|
|
|
|
|
font-size: 20rpx;
|
|
|
|
|
|
background: #f97316;
|
|
|
|
|
|
color: #FFF;
|
|
|
|
|
|
margin-top: 10rpx;
|
|
|
|
|
|
border-radius: 4rpx;
|
|
|
|
|
|
}
|
2025-01-07 09:35:24 +08:00
|
|
|
|
</style>
|