|
|
@@ -26,7 +26,7 @@
|
|
|
<view class="t-bri">{{ styleHintText(settlementInfo.legalCertId) }}</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
- <view class="li ddflex" @click="jumpUrl('/promote/withdrawal/cardList/cardList?cardType='+cardType+'&id='+settlementInfo.id)">
|
|
|
+ <view class="li ddflex" @click="cardType==1?toaddCard():jumpUrl('/promote/withdrawal/cardList/cardList?cardType='+cardType+'&id='+settlementInfo.id)">
|
|
|
<view class="yhk">
|
|
|
<image src="/static/pages/images/yhk.png" mode="aspectFit" class="txico"></image>
|
|
|
</view>
|
|
|
@@ -48,10 +48,10 @@
|
|
|
<view class="pdlr20 pd50 bgfff cont">
|
|
|
<view class="txje ddflex">
|
|
|
<view class="fflex">提现金额</view>
|
|
|
- <navigator url="/promote/withdrawal/income/income" hover-class="none" class="ddflex">
|
|
|
+ <!-- <navigator url="/promote/withdrawal/income/income" hover-class="none" class="ddflex">
|
|
|
收益账户明细
|
|
|
<image src="../../../static/pages/images/crico1.png" class="rico"></image>
|
|
|
- </navigator>
|
|
|
+ </navigator> -->
|
|
|
</view>
|
|
|
<view class="dflex money pd50">
|
|
|
<text>¥</text>
|
|
|
@@ -103,6 +103,7 @@ export default {
|
|
|
* 生命周期函数--监听页面加载
|
|
|
*/
|
|
|
onLoad: function(options) {
|
|
|
+ if(options.cardType) this.cardType = options.cardType
|
|
|
// 门店
|
|
|
if(req.getStorage('userInfo').merchantId){
|
|
|
this.userId = req.getStorage('userInfo').merchantId
|
|
|
@@ -113,7 +114,7 @@ export default {
|
|
|
this.userId = req.getStorage('userInfo').storeId
|
|
|
this.userType = 1
|
|
|
}
|
|
|
- if(options.cardType) this.cardType = options.cardType
|
|
|
+ // 获取系统参数配置的最小提现金额
|
|
|
this.getminMoney();
|
|
|
this.bankList = hfParams.bank();
|
|
|
},
|
|
|
@@ -131,12 +132,13 @@ export default {
|
|
|
url:url
|
|
|
})
|
|
|
},
|
|
|
+ // 银行卡号
|
|
|
getbankNo(bankNo) {
|
|
|
if (bankNo) {
|
|
|
return bankNo.substring(bankNo.length - 4, bankNo.length);
|
|
|
}
|
|
|
},
|
|
|
-
|
|
|
+ // 银行
|
|
|
getBankName(code) {
|
|
|
if (code) {
|
|
|
for (var i = 0; i < this.bankList.length; i++) {
|
|
|
@@ -147,36 +149,27 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
-
|
|
|
+ // 审核状态 0、待审核 1、审核通过 2、审核失败
|
|
|
getStateText() {
|
|
|
var text = '待审核';
|
|
|
//银行卡状态 - 0、待审核 1、审核通过 2、审核失败
|
|
|
if (this.settlementInfo.status == 0) {
|
|
|
text = '待审核';
|
|
|
} else if (this.settlementInfo.status == 1) {
|
|
|
- text = '审核通过';
|
|
|
+ if(this.cardType==1) text = '已绑定';
|
|
|
+ if(this.cardType==2) text = '更换';
|
|
|
+ // text = '审核通过';
|
|
|
} else if (this.settlementInfo.status == 2) {
|
|
|
text = '审核失败';
|
|
|
}
|
|
|
return text;
|
|
|
},
|
|
|
-
|
|
|
+
|
|
|
+ // 身份证
|
|
|
styleHintText(str) {
|
|
|
return util.styleHintText(str);
|
|
|
},
|
|
|
|
|
|
- //是否可提现
|
|
|
- isOkState() {
|
|
|
- var is = false;
|
|
|
- if (this.settlementInfo && this.settlementInfo.channelList && this.settlementInfo.channelList.length > 0) {
|
|
|
- var obj = this.settlementInfo.channelList[0];
|
|
|
- if (obj.state == 1 && obj.settlementState == 1) {
|
|
|
- is = true;
|
|
|
- }
|
|
|
- }
|
|
|
- return is;
|
|
|
- },
|
|
|
-
|
|
|
getProfit() {
|
|
|
req.getRequest('/admin/v2/merchant/balance', {id:this.userId,type:this.userType}, res => {
|
|
|
this.countMoney = res?res.balance:0;
|
|
|
@@ -203,7 +196,7 @@ export default {
|
|
|
let d = {
|
|
|
bindId:this.userId,
|
|
|
bindType:this.userType,
|
|
|
- type:2
|
|
|
+ type:this.cardType
|
|
|
}
|
|
|
req.getRequest('/admin/v2/bank/defaultBank', d, data => {
|
|
|
this.settlementInfo = data;
|
|
|
@@ -212,9 +205,8 @@ export default {
|
|
|
|
|
|
// 提现
|
|
|
withdrawmoney() {
|
|
|
- if (!this.isOkState()) {
|
|
|
- return req.msg('请先添加正确的银行卡信息');
|
|
|
- }
|
|
|
+ if(!this.settlementInfo) return req.msg('请先添加正确的银行卡信息');
|
|
|
+ if(!this.settlementInfo.status) return req.msg('该银行卡审核中');
|
|
|
if (this.txmoney == 0) {
|
|
|
return req.msg('请输入提现金额');
|
|
|
} else if (this.txmoney > this.countMoney) {
|
|
|
@@ -222,18 +214,40 @@ export default {
|
|
|
} else if (this.txmoney < this.minMoney) {
|
|
|
return req.msg('提现金额不能低于最小提现金额');
|
|
|
} else if (this.txmoney > 0 && this.txmoney <= this.countMoney && +this.txmoney >= +this.minMoney) {
|
|
|
+ if(this.posting) return false
|
|
|
+ this.posting = true
|
|
|
req.postRequest(
|
|
|
- '/api/withdraw',
|
|
|
+ '/admin/v2/withdraw/apply',
|
|
|
{
|
|
|
- money: this.txmoney
|
|
|
+ money: this.txmoney,
|
|
|
+ settlementId:this.settlementInfo.id,
|
|
|
+ bindId:this.userId,
|
|
|
+ bindType:this.userType,
|
|
|
+ type:this.cardType
|
|
|
},
|
|
|
res => {
|
|
|
- console.log(res);
|
|
|
- req.msg('您的提现申请已受理,请等待平台打款', success => {
|
|
|
- setTimeout(function() {
|
|
|
- uni.navigateBack();
|
|
|
- }, 1500);
|
|
|
- });
|
|
|
+ if(this.cardType==1){
|
|
|
+ req.postRequest(
|
|
|
+ '/admin/v2/withdraw/payCashToHf',
|
|
|
+ res,
|
|
|
+ data => {
|
|
|
+ this.posting = false
|
|
|
+ req.msg('您的提现申请已受理,请等待平台打款', success => {
|
|
|
+ setTimeout(function() {
|
|
|
+ uni.navigateBack();
|
|
|
+ }, 1500);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ );
|
|
|
+ }else{
|
|
|
+ this.posting = false
|
|
|
+ console.log(res);
|
|
|
+ req.msg('您的提现申请已受理,请等待平台打款', success => {
|
|
|
+ setTimeout(function() {
|
|
|
+ uni.navigateBack();
|
|
|
+ }, 1500);
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|
|
|
);
|
|
|
}
|
|
|
@@ -255,14 +269,10 @@ export default {
|
|
|
},
|
|
|
|
|
|
toaddCard() {
|
|
|
- var url = '/promote/withdrawal/bindCard/bindCard?cardType='+this.cardType+'&id='+this.settlementInfo.id;
|
|
|
- // if (this.settlementInfo) {
|
|
|
- // if (this.isOkState()) {
|
|
|
- // url = '/promote/withdrawal/bindCardCheck/bindCardCheck';
|
|
|
- // } else {
|
|
|
- // url = url + '?isEnd=true';
|
|
|
- // }
|
|
|
- // }
|
|
|
+ var url = '/promote/withdrawal/bindCard/bindCard?cardType='+this.cardType
|
|
|
+ if (this.settlementInfo) {
|
|
|
+ url = url +'&id='+this.settlementInfo.id;
|
|
|
+ }
|
|
|
uni.navigateTo({
|
|
|
url: url
|
|
|
});
|