暂时将消费返补充值到本地余额关闭

This commit is contained in:
wangxiaowei 2024-08-28 22:47:18 +08:00
parent 6d294f618b
commit 944cf8f4fd

@ -5,7 +5,7 @@
active-color="#333333" inactive-color="#666666" :bar-style="styleTabsBarStyle" @change="changeTab" />
<view class="m-b-35">
<view v-if="currentTab == 0">
<!-- <view v-if="currentTab == 0">
<view class="withdraw-money-wrap m-t-20 bg-white">
<view class="flex withdraw-money p-b-20">
<view class="flex flex-1">
@ -28,9 +28,10 @@
<navigator url="/bundle_b/pages/subsidy_shop/recharge_record" hover-class="none">充值记录</navigator>
</view>
</view>
</view>
</view> -->
<view v-if="currentTab == 1">
<!-- <view v-if="currentTab == 1"> -->
<view v-if="currentTab == 0">
<view class="withdraw-money-wrap m-t-20 bg-white">
<view class="flex withdraw-money p-b-20">
<view class="flex flex-1">
@ -56,15 +57,13 @@
<view class="unreadBlock" style="position: relative;">
<tabs :current="active" @change="changeShow" bar-width="60" :is-scroll="false">
<tab v-for="(item, index) in order" :key="index" :name="item.name">
<tab v-for="(item, index) in order" :key="index" :name="item.name" :num="item.num">
<subsidy-list :i="index" :index="active" @changeUnreadBillions="changeUnreadBillions"></subsidy-list>
</tab>
</tabs>
<view class="unreadNum" v-if="dot">
{{dot > 99 ? '99+' : dot}}
</view>
</view>
<!-- <pay-keyboard :show="true"></pay-keyboard> -->
<!-- 充值成功 -->
<u-popup class="pay-popup" v-model="showPopup" closeable round mode="center">
@ -94,8 +93,11 @@
},
data() {
return {
// tabsList: [
// {name: '充值到本地余额'},
// {name: '补贴提现'}
// ],
tabsList: [
{name: '充值到本地余额'},
{name: '补贴提现'}
],
currentTab: 0,
@ -110,9 +112,11 @@
},
active: -1,
order: [{
name: '排队中'
name: '排队中',
num: 0
}, {
name: '已完成'
name: '已完成',
num: 0
}],
dot: 0,
widthDrawConfig: [],
@ -129,10 +133,6 @@
this.changeShow(0);
this.getBillionsWithdrawConfigFun();
uni.$on('refreshBillionsWithdrawConfigFun', this.getBillionsWithdrawConfigFun)
if (options && options.unread) {
this.order[1].dot = options.unread
}
},
onUnload() {
uni.$off('refreshBillionsWithdrawConfigFun')
@ -189,99 +189,145 @@
const data = {
...this.form
}
if (this.currentTab == 0){
// 充值
if (!Number(data.recharge_money)) {
this.$toast({
title: '请输入充值金额'
});
return;
}
// if (this.currentTab == 0){
// // 充值
// if (!Number(data.recharge_money)) {
// this.$toast({
// title: '请输入充值金额'
// });
// return;
// }
if (!uni.$u.test.amount(data.recharge_money)) {
this.$toast({
title: '充值金额格式错误'
});
return;
}
// if (!uni.$u.test.amount(data.recharge_money)) {
// this.$toast({
// title: '充值金额格式错误'
// });
// return;
// }
if (Number(data.recharge_money) < Number(this.widthDrawConfig.min_recharge)) {
this.$toast({
title: '最小充值金额为¥' + this.widthDrawConfig.min_recharge
});
return;
}
// if (Number(data.recharge_money) < Number(this.widthDrawConfig.min_recharge)) {
// this.$toast({
// title: '最小充值金额为¥' + this.widthDrawConfig.min_recharge
// });
// return;
// }
if (Number(data.recharge_money) > Number(this.widthDrawConfig.able_withdraw)) {
this.$toast({
title: '可充值金额不足'
});
return;
}
// if (Number(data.recharge_money) > Number(this.widthDrawConfig.able_withdraw)) {
// this.$toast({
// title: '可充值金额不足'
// });
// return;
// }
uni.showLoading({
title: '加载中...',
mask: true
})
// uni.showLoading({
// title: '加载中...',
// mask: true
// })
data.money = data.recharge_money
const result = await rechargeBalance(data)
// data.money = data.recharge_money
// const result = await rechargeBalance(data)
if (result.code == 1) {
uni.$emit('refreshSubsidyPage')
this.showPopup = true
this.tipsText = '已成功充值¥' + data.recharge_money
}
// if (result.code == 1) {
// uni.$emit('refreshSubsidyPage')
// this.showPopup = true
// this.tipsText = '已成功充值¥' + data.recharge_money
// }
this.form.recharge_money = ''
uni.hideLoading()
} else if(this.currentTab == 1) {
// 提现
if (!data.withdrawl_money) {
this.$toast({
title: '请输入提现金额'
});
return;
}
// this.form.recharge_money = ''
// uni.hideLoading()
// } else if(this.currentTab == 1) {
// // 提现
// if (!data.withdrawl_money) {
// this.$toast({
// title: '请输入提现金额'
// });
// return;
// }
if (!uni.$u.test.amount(data.withdrawl_money)) {
this.$toast({
title: '提现金额格式错误'
});
return;
}
// if (!uni.$u.test.amount(data.withdrawl_money)) {
// this.$toast({
// title: '提现金额格式错误'
// });
// return;
// }
if (data.withdrawl_money < this.widthDrawConfig.min_withdraw) {
this.$toast({
title: '最小提现金额为¥' + this.widthDrawConfig.min_withdraw
});
return;
}
// if (data.withdrawl_money < this.widthDrawConfig.min_withdraw) {
// this.$toast({
// title: '最小提现金额为¥' + this.widthDrawConfig.min_withdraw
// });
// return;
// }
if (data.withdrawl_money > this.widthDrawConfig.able_withdraw) {
this.$toast({
title: '可提现金额不足'
});
return;
}
// if (data.withdrawl_money > this.widthDrawConfig.able_withdraw) {
// this.$toast({
// title: '可提现金额不足'
// });
// return;
// }
uni.showLoading({
title: '加载中...',
mask: true
})
// uni.showLoading({
// title: '加载中...',
// mask: true
// })
data.money = data.withdrawl_money
const result = await applyBillionsWithdrawl(data);
// data.money = data.withdrawl_money
// const result = await applyBillionsWithdrawl(data);
if (result.code == 1) {
uni.$emit('refreshSubsidyPage')
this.showPopup = true
this.tipsText = '已成功提现¥' + data.withdrawl_money + '至微信零钱'
}
// if (result.code == 1) {
// uni.$emit('refreshSubsidyPage')
// this.showPopup = true
// this.tipsText = '已成功提现¥' + data.withdrawl_money + '至微信零钱'
// }
this.form.withdrawl_money = ''
uni.hideLoading()
// this.form.withdrawl_money = ''
// uni.hideLoading()
// }
// 提现
if (!data.withdrawl_money) {
this.$toast({
title: '请输入提现金额'
});
return;
}
if (!uni.$u.test.amount(data.withdrawl_money)) {
this.$toast({
title: '提现金额格式错误'
});
return;
}
if (data.withdrawl_money < this.widthDrawConfig.min_withdraw) {
this.$toast({
title: '最小提现金额为¥' + this.widthDrawConfig.min_withdraw
});
return;
}
if (data.withdrawl_money > this.widthDrawConfig.able_withdraw) {
this.$toast({
title: '可提现金额不足'
});
return;
}
uni.showLoading({
title: '加载中...',
mask: true
})
data.money = data.withdrawl_money
const result = await applyBillionsWithdrawl(data);
if (result.code == 1) {
uni.$emit('refreshSubsidyPage')
this.showPopup = true
this.tipsText = '已成功提现¥' + data.withdrawl_money + '至微信零钱'
}
this.form.withdrawl_money = ''
uni.hideLoading()
this.getBillionsWithdrawConfigFun();
},
onShowPopup() {
@ -297,7 +343,7 @@
}
},
changeUnreadBillions(e) {
this.dot = e
this.order[1].num = e
}
},
watch: {