新增提现记录功能

This commit is contained in:
weipengfei 2023-07-24 17:40:58 +08:00
parent cbdaca6a7e
commit 00b3f1a498
4 changed files with 212 additions and 20 deletions

View File

@ -243,6 +243,23 @@
"navigationBarTitleText": "提现余额",
"enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#3175f9",
"navigationBarTextStyle": "white",
"app-plus": {
"titleNView": {
"buttons": [{
"color": "#fff",
"text": "提现记录",
"fontSize": "15"
}]
}
}
}
}, {
"path": "withdrawList/withdrawList",
"style": {
"navigationBarTitleText": "提现记录",
"enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#3175f9",
"navigationBarTextStyle": "white"
}

View File

@ -150,7 +150,7 @@ export default {
let res = await accountLogLists({
type: 'um', //
page_no: this.loadConfig.page,
page_size: this.loadConfig.page_size
page_size: this.loadConfig.limit
});
this.loadConfig.status="loadmore"
if(res.data.lists.length<this.loadConfig.limit){

View File

@ -20,12 +20,14 @@
<view class="item" :class="index==changeMoney?'active':''" @click="changePrice(index)"
v-for="(item, index) in priceList" :key="index">{{item}}</view>
</view>
<input v-if="priceList[changeMoney]=='自定义'" class="input" type="digit" placeholder="输入充值金额(元)" v-model="payMoney.money" />
<input v-if="priceList[changeMoney]=='自定义'" class="input" type="digit" placeholder="输入充值金额(元)"
v-model="payMoney.money" />
<button class="btn" @click="pay">申请提现</button>
</view>
<view class="tip">
<view class="title">备注</view>
<view class="text">提现后将会由后台审核,审核通过后会直接往您所上传的银行卡汇款,请耐心等待,如由疑问也可拨打商城客服热线<text @click="copyPhone('4008888888')">4008888888</text></view>
<view class="text">提现后将会由后台审核,审核通过后会直接往您所上传的银行卡汇款,请耐心等待,如由疑问也可拨打商城客服热线<text
@click="copyPhone('4008888888')">4008888888</text></view>
</view>
</view>
</template>
@ -47,12 +49,20 @@
timeCount: 5,
}
},
//
onNavigationBarButtonTap(res){
if (res.index === 0) {
uni.navigateTo({
url: '/subpkg/withdrawList/withdrawList'
})
}
},
onLoad() {},
onShow() {},
methods: {
copyPhone(str=""){
copyPhone(str = "") {
uni.setClipboardData({
data:str+"",
data: str + "",
success: (e) => {
Toast('号码已复制')
},
@ -61,36 +71,40 @@
}
})
},
changePrice(index){
if(this.changeMoney == index)this.changeMoney = -1;
changePrice(index) {
if (this.changeMoney == index) this.changeMoney = -1;
else this.changeMoney = index;
if(this.priceList[index]=='自定义')this.payMoney.money = '';
else if(this.priceList[index]=='全部')this.payMoney.money = this.$store.state.app.userInfo.user_money||0;
if (this.priceList[index] == '自定义') this.payMoney.money = '';
else if (this.priceList[index] == '全部') this.payMoney.money = this.$store.state.app.userInfo.user_money || 0;
else this.payMoney.money = this.priceList[index].split('元')[0];
},
//
pay(){
if(!this.payMoney.money)return Toast('请先填写提现金额!')
if(+this.payMoney.money<=0)return Toast('提现金额不能小于0!')
if(+this.payMoney.money>+this.$store.state.app.userInfo.user_money)return Toast('提现金额不能大于余额!')
if(!this.payTimer){
pay() {
if (!this.payMoney.money) return Toast('请先填写提现金额!')
if (+this.payMoney.money <= 0) return Toast('提现金额不能小于0!')
if (+this.payMoney.money > +this.$store.state.app.userInfo.user_money) return Toast('提现金额不能大于余额!')
if (!this.payTimer) {
this.goApply();
this.payTimer = setInterval(()=>{
this.payTimer = setInterval(() => {
this.timeCount--;
if(this.timeCount<=0){
if (this.timeCount <= 0) {
clearInterval(this.payTimer);
this.payTimer = null;
this.timeCount = 5;
}
}, 1000)
}
else Toast(this.timeCount+'秒后再提现!')
} else Toast(this.timeCount + '秒后再提现!')
},
async goApply(){
//
async goApply() {
let res = await userWithdraw({
amount: this.payMoney.money
});
Toast(res.msg)
Toast(res.msg);
//
let info = this.$store.state.app.userInfo;
info.user_money -= this.payMoney.money;
this.$store.commit('setUserInfo', info);
}
},
onPullDownRefresh() {

View File

@ -0,0 +1,161 @@
<template>
<view class="">
<view class="list">
<view class="card" v-for="(item, index) in list" :key="index">
<view class="top">
<view class="tips" :class="typeList[item.status].class">{{typeList[item.status].text}}</view>
<view>提现日期{{item.create_time}}</view>
</view>
<view class="bottom">
<view class="left">
<view>提现金额()</view>
<view class="num">{{item.amount}}</view>
</view>
<view class="right">
<view>订单编号:</view>
<view>{{item.order_sn}}</view>
</view>
</view>
</view>
</view>
<u-loadmore :status="loadConfig.status" :loading-text="loadConfig.loadingText" :loadmore-text="loadConfig.loadmoreText" :nomore-text="loadConfig.nomoreText" />
</view>
</template>
<script>
import {userWithdrawList} from "@/api/pay.js"
export default {
data() {
return {
list:[],
typeList:[
{
text: '审核中',
class: 'audit'
},
{
text: '已通过',
class: 'pass'
},
{
text: '已拒绝',
class: 'no_pass'
},
{
text: '已转账',
class: 'ok'
}
],
loadConfig:{
page: 1,
limit: 15,
loadingText: '努力加载中',
loadmoreText: '轻轻上拉',
nomoreText: '没有更多记录了~~',
status: 'loadmore'
},
}
},
onLoad() {
this.loadList();
},
onShow() {},
onReachBottom() {
this.loadList()
},
methods: {
async loadList(){
if(this.loadConfig.status=="nomore")return;
this.loadConfig.status="loading"
let res = await userWithdrawList({
page: this.loadConfig.page,
limit: this.loadConfig.limit
});
this.loadConfig.status="loadmore"
if(res.data.data.length<this.loadConfig.limit){
this.loadConfig.status="nomore"
}else {
this.loadConfig.page++;
}
this.list = [...this.list, ...res.data.data];
}
},
onPullDownRefresh() {
uni.stopPullDownRefresh()
}
}
</script>
<style lang="scss">
.list{
// background-color: #f5f5f5;
display: flex;
flex-direction: column;
align-items: center;
padding-top: 28rpx;
.card{
padding: 28rpx;
width: 694rpx;
background-color: #fff;
margin-bottom: 21rpx;
.top{
display: flex;
align-items: center;
font-size: 25rpx;
font-weight: 400;
color: #333333FF;
line-height: 39rpx;
.tips{
width: 137rpx;
height: 49rpx;
background: #3274F9;
border-radius: 26rpx 26rpx 26rpx 26rpx;
font-size: 25rpx;
font-weight: 400;
color: #FFFFFF;
line-height: 39rpx;
display: flex;
justify-content: center;
align-items: center;
margin-right: 28rpx;
}
.pass{
background-color: #FF8C1A;
}
.no_pass{
background-color: #F02828;
}
.ok{
background-color: #47B347;
}
}
.bottom{
display: flex;
justify-content: space-between;
align-items: center;
height: 160rpx;
.left{
flex: 1;
text-align: center;
font-size: 25rpx;
font-weight: 400;
color: #666666;
line-height: 39rpx;
.num{
font-size: 39rpx;
font-weight: 500;
color: #F02828;
line-height: 39rpx;
}
}
.right{
flex: 1;
font-size: 25rpx;
font-weight: 400;
color: #666666;
line-height: 39rpx;
}
}
}
}
</style>