|
@@ -1,38 +1,46 @@
|
|
|
<template>
|
|
|
<view class="box">
|
|
|
<view class="tixiancs">
|
|
|
- <view class="tixiancsLeft">本月已提现{{detail.count}}次</view>
|
|
|
- <view class="tixiancsRight" @click="goRouter('../referral/extractList')">提现明细</view>
|
|
|
+ <view class="tixiancsLeft"></view>
|
|
|
+ <view class="tixiancsRight" @click="goRouter('../referral/extractList?type=2')">提现明细</view>
|
|
|
</view>
|
|
|
<view class="header">
|
|
|
<view class="title">提现金额</view>
|
|
|
<view class="moneyView">
|
|
|
- <text class="icon">¥</text>
|
|
|
+ <text class="icon"></text>
|
|
|
<input type="digit" class="moneyInput" placeholder-style="color:#999999; font-size:30rpx"
|
|
|
- placeholder="请输入提现金额" v-model="money" @input="inputValue" />
|
|
|
+ placeholder="请输入" v-model="money" @input="inputValue" />
|
|
|
<view class="allBtn" @click="allBtn">全部提现</view>
|
|
|
</view>
|
|
|
- <view class="zongMoney">可提现金额: <span style="color: #EC0F0A;padding-right: 10rpx;">¥{{detail.canMoney}} </span> (冻结金额:{{detail.freezeMoney}}) </view>
|
|
|
+ <view class="zongMoney">可提现金额: <span style="color: rgb(255,102, 0);padding-right: 10rpx;">¥{{canMoney}} </span> </view>
|
|
|
|
|
|
|
|
|
</view>
|
|
|
|
|
|
+ <view class="sureBtn" @click="sure">申请提现</view>
|
|
|
+
|
|
|
<view class="tishi" style="padding:20rpx 20rpx 100rpx 20rpx ; ">
|
|
|
+ <view class="tishi-title" style="color: rgb(255,102, 0);padding-left: 18rpx;">
|
|
|
+ 提现说明:
|
|
|
+ </view>
|
|
|
<view class="tishiLine">
|
|
|
- <view class="tishiY"></view>
|
|
|
- <view class="tishiTxt">提现冻结天数:{{detail.explain&&detail.explain.freezeDay}}天</view>
|
|
|
+ <view class="tishiTxt">1.最小提现金额:<span class="tishiTxtColor">{{minCash}}</span>元</view>
|
|
|
</view>
|
|
|
<view class="tishiLine">
|
|
|
- <view class="tishiY"></view>
|
|
|
- <view class="tishiTxt">最小提现金额:{{detail.explain&&detail.explain.singleLow}}元</view>
|
|
|
+ <view class="tishiTxt">2.只允许一笔提现在途</view>
|
|
|
+ </view>
|
|
|
+ <!-- <view class="tishiLine">
|
|
|
+ <view class="tishiTxt">1.提现冻结天数:<span class="tishiTxtColor">{{detail.explain&&detail.explain.freezeDay}}</span>天</view>
|
|
|
</view>
|
|
|
<view class="tishiLine">
|
|
|
- <view class="tishiY"></view>
|
|
|
- <view class="tishiTxt">每月可提现次数:{{detail.explain&&detail.explain.monthlyMost}}次</view>
|
|
|
+ <view class="tishiTxt">2.最小提现金额:<span class="tishiTxtColor">{{detail.explain&&detail.explain.singleLow}}</span>元</view>
|
|
|
</view>
|
|
|
+ <view class="tishiLine">
|
|
|
+ <view class="tishiTxt">3.每月可提现次数:<span class="tishiTxtColor">{{detail.explain&&detail.explain.monthlyMost}}</span>次</view>
|
|
|
+ </view> -->
|
|
|
</view>
|
|
|
|
|
|
- <view class="sureBtn" @click="sure">申请提现</view>
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
@@ -48,7 +56,20 @@
|
|
|
name: '',
|
|
|
account: '',
|
|
|
detail: {},
|
|
|
+ alreadyMoney: 0,
|
|
|
+ canMoney: 0,
|
|
|
+ inMoney: 0,
|
|
|
+ sumMoney: 0,
|
|
|
+ minCash: 0.1,
|
|
|
couContent: '', //提现规则
|
|
|
+ cashState:null,
|
|
|
+ timer :null,
|
|
|
+ appId:'',
|
|
|
+ mchId:'',
|
|
|
+ outBatchNo:'',
|
|
|
+ packageInfo:'',
|
|
|
+ state:'',
|
|
|
+ jkcashid:'',
|
|
|
}
|
|
|
},
|
|
|
onLoad() {
|
|
@@ -65,10 +86,14 @@
|
|
|
title: '加载中'
|
|
|
})
|
|
|
|
|
|
- this.$http('openMCustomer/getWithdrawalInfo', {}, 'GET').then(res => {
|
|
|
+ this.$http('jkCashout/getCashoutData', {}, 'GET').then(res => {
|
|
|
uni.hideLoading();
|
|
|
- this.detail = res.data;
|
|
|
- this.okMoney=this.detail.canMoney
|
|
|
+ this.alreadyMoney = res.data.AlreadyMoney
|
|
|
+ this.canMoney = res.data.CanMoney
|
|
|
+ this.inMoney = res.data.InMoney
|
|
|
+ this.sumMoney = res.data.SumMoney
|
|
|
+ this.minCash = res.data.MinCash
|
|
|
+ this.cashState = res.data.CashState
|
|
|
|
|
|
})
|
|
|
},
|
|
@@ -85,14 +110,12 @@
|
|
|
allBtn() {
|
|
|
|
|
|
setTimeout(() => {
|
|
|
- this.money = this.okMoney; // 解决
|
|
|
+ this.money = this.canMoney; // 解决
|
|
|
}, 0)
|
|
|
|
|
|
-
|
|
|
- console.log('money,allmoney', this.money, this.okMoney);
|
|
|
},
|
|
|
sure() {
|
|
|
- if (this.money > this.okMoney) {
|
|
|
+ if (this.money > this.canMoney) {
|
|
|
uni.showToast({
|
|
|
title: '提现金额不能大于可提现金额',
|
|
|
icon: 'none',
|
|
@@ -108,47 +131,134 @@
|
|
|
});
|
|
|
return;
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
+ if (this.money < this.minCash) {
|
|
|
+ uni.showToast({
|
|
|
+ title: '提现金额最低为'+this.minCash,
|
|
|
+ icon: 'none',
|
|
|
+ duration: 3000,
|
|
|
+ });
|
|
|
+ return;
|
|
|
+ }
|
|
|
this.postData();
|
|
|
},
|
|
|
postData() {
|
|
|
- // uni.showLoading({
|
|
|
- // title: '提现中'
|
|
|
- // })
|
|
|
- let url = 'openMCustomer/applyWithdrawal',
|
|
|
+ uni.showLoading({
|
|
|
+ title: '提现申请中..'
|
|
|
+ })
|
|
|
+ let url = 'jkCashout/applyJkCashout',
|
|
|
params = {
|
|
|
money: this.money,
|
|
|
|
|
|
}
|
|
|
this.$http(url, params, 'POST').then(res => {
|
|
|
//uni.hideLoading();
|
|
|
- if(res.code==0){
|
|
|
+ console.log(res)
|
|
|
+ if(res.code ==0){
|
|
|
+ this.canMoney = this.canMoney - this.money
|
|
|
+ }
|
|
|
+ //人工审核
|
|
|
+ if(res.code==0 && this.cashState==1){
|
|
|
uni.showModal({
|
|
|
title: '提交成功',
|
|
|
content: '请耐心等待平台审核',
|
|
|
showCancel:false,
|
|
|
confirmText:'知道了',
|
|
|
success: function(res) {
|
|
|
-
|
|
|
- uni.navigateBack({
|
|
|
-
|
|
|
- })
|
|
|
+ uni.hideLoading();
|
|
|
}
|
|
|
});
|
|
|
- }else{
|
|
|
- // uni.showToast({
|
|
|
- // title: '提现金额不能为空',
|
|
|
- // icon: 'none',
|
|
|
- // duration: 3000,
|
|
|
- // });
|
|
|
+ }else if(res.code==0 && this.cashState==0){
|
|
|
+ //自动审核
|
|
|
+ //轮询查询状态
|
|
|
+ uni.showToast({
|
|
|
+ title: '审核成功请等待..',
|
|
|
+ icon: 'success',
|
|
|
+ duration: 3000,
|
|
|
+ });
|
|
|
+ this.appId = res.data.appId
|
|
|
+ this.mchId = res.data.mchId
|
|
|
+ this.outBatchNo = res.data.outBatchNo
|
|
|
+ this.packageInfo = res.data.packageInfo
|
|
|
+ this.state = res.data.state
|
|
|
+ this.jkcashid = res.data.jkcashid
|
|
|
+ if(res.data.state =='WAIT_USER_CONFIRM'){
|
|
|
+ this.getWechatMoney()
|
|
|
+ }else{
|
|
|
+ this.checkOrderStatus()
|
|
|
+ }
|
|
|
+ }else if(res.code==0 && this.cashState==2){
|
|
|
+ //线下
|
|
|
+ uni.showToast({
|
|
|
+ title: '申请成功请等待平台审核',
|
|
|
+ icon: 'success',
|
|
|
+ duration: 3000,
|
|
|
+ });
|
|
|
+
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
})
|
|
|
},
|
|
|
+ async checkOrderStatus() {
|
|
|
+ try {
|
|
|
+ this.$http('jkCashout/checkJkCashoutState', {
|
|
|
+ outBatchNo:this.outBatchNo,
|
|
|
+ jkcashid:this.jkcashid
|
|
|
+ }, 'POST').then(res => {
|
|
|
+ console.log(res);
|
|
|
+ if(res.code == 0 && res.data.state =='WAIT_USER_CONFIRM'){
|
|
|
+ uni.hideLoading();
|
|
|
+ clearTimeout(this.timer);
|
|
|
+ this.getWechatMoney();
|
|
|
+ }
|
|
|
+ else if(res.code == 0 && res.data.state =='SUCCESS'){
|
|
|
+ //成功页面
|
|
|
+ console.log("领取成功-跳转成功页面");
|
|
|
+ clearTimeout(this.timer);
|
|
|
+ this.goRouter('../subPack/extractSuccess?money='+this.money);
|
|
|
+ }
|
|
|
+ else if(res.code == 0 && res.data.state =='FAIL'){
|
|
|
+ //失败页面
|
|
|
+ console.log("领取失败-跳转失败页面");
|
|
|
+ clearTimeout(this.timer);
|
|
|
+ this.goRouter('../subPack/extractFail?money='+this.money)
|
|
|
+ }else if(res.code == 1){
|
|
|
+ clearTimeout(this.timer);
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ this.timer = setTimeout(this.checkOrderStatus, 2000);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } catch (error) {
|
|
|
+ console.error('查询订单状态失败:', error);
|
|
|
+ // 出错时也继续轮询
|
|
|
+ clearTimeout(this.timer);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ checkOrderStatusMounted() {
|
|
|
+ this.checkOrderStatus(); // 立即执行第一次查询
|
|
|
+ },
|
|
|
+ beforeDestroy() {
|
|
|
+ clearTimeout(this.timer);
|
|
|
+ },
|
|
|
+ getWechatMoney(){
|
|
|
+ if (wx.canIUse('requestMerchantTransfer')) {
|
|
|
+ wx.requestMerchantTransfer({
|
|
|
+ mchId: this.mchId,
|
|
|
+ appId: this.appId,
|
|
|
+ package: this.packageInfo,
|
|
|
+ success: (res) => {
|
|
|
+ // res.err_msg将在页面展示成功后返回应用时返回ok,并不代表付款成功
|
|
|
+ console.log(res);
|
|
|
+ if (res.errMsg === 'requestMerchantTransfer:ok') {
|
|
|
+ this.checkOrderStatusMounted();
|
|
|
+ }
|
|
|
+
|
|
|
+ },
|
|
|
+ fail: (res) => {
|
|
|
+
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
@@ -171,6 +281,7 @@
|
|
|
}
|
|
|
.tishiTxt{
|
|
|
padding-left: 18rpx;
|
|
|
+ color: #222222;
|
|
|
}
|
|
|
.tixiancs{
|
|
|
display: flex;
|
|
@@ -184,7 +295,10 @@
|
|
|
color: #999999;
|
|
|
}
|
|
|
.tixiancsRight{
|
|
|
- color: #1677FF;
|
|
|
+ color:rgb(255,102, 0);
|
|
|
+}
|
|
|
+.tishiTxtColor{
|
|
|
+ color: rgb(255,102, 0);
|
|
|
}
|
|
|
.header {
|
|
|
background-color: #FFFFFF;
|
|
@@ -223,8 +337,8 @@
|
|
|
}
|
|
|
|
|
|
.allBtn {
|
|
|
- font-size: 26rpx;
|
|
|
- color: #EC0F0A;
|
|
|
+ font-size: 30rpx;
|
|
|
+ color: rgb(255,102, 0);
|
|
|
width: 200rpx;
|
|
|
height: 50rpx;
|
|
|
line-height: 50rpx;
|
|
@@ -234,8 +348,9 @@
|
|
|
|
|
|
.zongMoney {
|
|
|
font-size: 26rpx;
|
|
|
- color: #999999;
|
|
|
-
|
|
|
+ color: #222222;
|
|
|
+ border-top: solid 3rpx #999999;
|
|
|
+ padding-top: 15rpx;
|
|
|
}
|
|
|
|
|
|
.line {
|
|
@@ -267,16 +382,17 @@
|
|
|
font-size: 26rpx;
|
|
|
color: #999999;
|
|
|
line-height: 1.5;
|
|
|
+
|
|
|
}
|
|
|
|
|
|
.sureBtn {
|
|
|
width: 690rpx;
|
|
|
margin: 20rpx 30rpx;
|
|
|
- border-radius: 37rpx;
|
|
|
+ border-radius: 15rpx;
|
|
|
height: 74rpx;
|
|
|
- background: #EC0F0A;
|
|
|
+ background: rgb(255,102, 0);
|
|
|
color: #FFFFFF;
|
|
|
- font-size: 30rpx;
|
|
|
+ font-size: 25rpx;
|
|
|
text-align: center;
|
|
|
line-height: 74rpx;
|
|
|
}
|