Commit 93a7eb4f authored by 袁玲利's avatar 袁玲利

浦发充值提现新逻辑

parent 88056c03
This diff is collapsed.
......@@ -4,8 +4,8 @@
<view class="left_">提现金额 </view>
<view class="right_">每日可提现一次</view>
</view>
<!-- 20211230渤海银行 -->
<view class="BankBohai" v-if="bankInfo_.accountType==4">
<!-- 20211230渤海银行 浦发银行 -->
<view class="BankBohai" v-if="bankInfo_.accountType==4 || bankInfo_.accountType==5">
<view class="BankBHL">提现至</view>
<view class="BankBHR">
<view class="">{{bankInfo_.bindCardName}}
......@@ -141,7 +141,9 @@
msCount: 60, //定时器
CodeMsg: "获取验证码",
RechargeSmsorderNoInfo: {}, //第三方合作交易标识
WithdrawInfo: null
WithdrawInfo: null,
bindcardList: [],
bindCardNo: "",
}
},
onLoad: function(options) {
......@@ -189,6 +191,9 @@
case 4:
withdrawSmsUrl = withdrawSmsUrl + '/bank-wechat/bohai/comprehensive/otpSms';
break;
case 5:
withdrawSmsUrl = withdrawSmsUrl + '/bank-wechat/spdb/passcodes';
break;
default:
Dialog({
title: '系统提示',
......@@ -197,11 +202,7 @@
throw ("银行账号类型错误!")
break;
}
$.ajax({
url: withdrawSmsUrl,
type: "POST",
contentType: "application/x-www-form-urlencoded",
data: {
let params = {
amount: (this.inputOtherM * 1).toFixed(2), //充值金额,单位元
schoolId: bankInfo.schoolId, //学校id
userId: userID, //用户id
......@@ -210,7 +211,29 @@
// 21211230渤海银行
mobilePhone: this.openCardPhon,
msg: "提现"
},
}
let params1 = {
mobileNum: this.openCardPhon,
schoolId: bankInfo.schoolId, //学校id
userId: userID, //用户id
sessionid: sessionID,
wechattype: 1
}
$.ajax({
url: withdrawSmsUrl,
type: "POST",
contentType: "application/x-www-form-urlencoded",
// data: {
// amount: (this.inputOtherM * 1).toFixed(2), //充值金额,单位元
// schoolId: bankInfo.schoolId, //学校id
// userId: userID, //用户id
// sessionid: sessionID,
// wechattype: 1,
// // 21211230渤海银行
// mobilePhone: this.openCardPhon,
// msg: "提现"
// },
data: bankInfo.accountType == 5 ? params1 : params,
headers: {
'sessionid': sessionID,
},
......@@ -308,12 +331,16 @@
return
}
this.openCardPhonSms = '';
if(bankInfo.accountType != 5) {
this.$refs.popup.open('top')
}else {
this.ExchangeWithdraw();
}
},
// 提现
async ExchangeWithdraw() {
let this_ = this;
if (bankInfo.accountType != 4) {
if (bankInfo.accountType != 4 && bankInfo.accountType != 5) {
if (!this.RechargeSmsorderNoInfo.orderNo) {
Dialog({
title: '系统提示',
......@@ -322,7 +349,7 @@
return
}
}
if (!this.openCardPhonSms) {
if (!this.openCardPhonSms && bankInfo.accountType != 5) {
Dialog({
title: '系统提示',
message: '请收入验证码!'
......@@ -332,6 +359,9 @@
let loading = weui.loading('请稍后');
// 20211230
let withdrawUrl = gHost;
if(bankInfo.accountType == 5){
await this.queryBindCardListBefore();
}
switch (bankInfo.accountType) {
case 3:
withdrawUrl = withdrawUrl + '/bank-wechat/bocom/exchange/withdraw';
......@@ -339,6 +369,9 @@
case 4:
withdrawUrl = withdrawUrl + '/bank-wechat/bohai/exchange/withdraw';
break;
case 5:
withdrawUrl = withdrawUrl + '/bank-wechat/spdb/withdrawals';
break;
default:
Dialog({
title: '系统提示',
......@@ -347,11 +380,7 @@
throw ("银行账号类型错误!")
break;
}
$.ajax({
url: withdrawUrl,
type: "POST",
contentType: "application/x-www-form-urlencoded",
data: {
let params = {
amount: (this.inputOtherM * 1).toFixed(2), //充值金额,单位元
orderNo: this_.RechargeSmsorderNoInfo.orderNo,
msgCodeSeq: this_.RechargeSmsorderNoInfo.msgCodeSeq,
......@@ -363,7 +392,30 @@
// 21211230渤海银行
transAmount: (this.inputOtherM * 1).toFixed(2),
verifyNo: this_.openCardPhonSms,
},
};
let bindingCardId = "";
if(this.bindcardList.length){
let arr = this.bindcardList.filter(x => x.bindCardNo == this_.bindCardNo);
if(arr.length){
bindingCardId = arr[0].bindCardId;
}
}
if (bankInfo.accountType == 5) {
params = {
amount: (this.inputOtherM * 1).toFixed(2), //充值金额,单位元
schoolId: bankInfo.schoolId,
bindingCardId: bindingCardId,
userId: userID,
sessionid: sessionID,
wechattype: 1,
};
}
$.ajax({
url: withdrawUrl,
type: "POST",
contentType: "application/x-www-form-urlencoded",
data: params,
headers: {
'sessionid': sessionID,
},
......@@ -376,10 +428,10 @@
content: '银行处理需要1-5分钟时间,充值结果以余额查询为准。',
showCancel: false,
success: function() {
if (bankInfo.accountType != 4) {
if (bankInfo.accountType != 4 && bankInfo.accountType != 5) {
this_.ExchangeWithdrawQuery();
}
if (bankInfo.accountType == 4) {
if (bankInfo.accountType == 4 && bankInfo.accountType != 5) {
window.location.reload()
}
}
......@@ -465,7 +517,7 @@
ReturnToTop() {
// 若最后一位为小数点则去掉
let str = this.inputOtherM + "";
if(str.lastIndexOf('.') == str.length - 1) {
if (str.lastIndexOf('.') == str.length - 1) {
this.inputOtherM = str.substring(0, str.length - 1)
}
this.$nextTick(function() {
......@@ -576,6 +628,9 @@
case 4:
queryBankInfoUrl = queryBankInfoUrl + '/bank-wechat/bohai/exchange/balanceQuery';
break;
case 5:
queryBankInfoUrl = queryBankInfoUrl + '/bank-wechat/spdb/balancesQuery';
break;
default:
Dialog({
title: '系统提示',
......@@ -584,18 +639,24 @@
throw ("银行账号类型错误!")
break;
}
let params = {
mediumId: bankInfo.accountNo || "",
schoolId: bankInfo.schoolId || "",
userId: bankInfo.userId || "",
sessionid: sessionID,
wechattype: 1,
};
if (bankInfo.accountType == 5) {
Object.assign(params, {
accountId: bankInfo.thirdId
})
}
$.ajax({
url: queryBankInfoUrl,
type: "POST",
timeout: 8000,
contentType: "application/x-www-form-urlencoded",
data: {
mediumId: bankInfo.accountNo || '',
schoolId: bankInfo.schoolId || '',
userId: bankInfo.userId || '',
sessionid: sessionID,
wechattype: 1,
},
data: params,
success: function(res3) {
loading.hide();
if (res3.code == "10000") {
......@@ -658,8 +719,10 @@
success: function(res2) {
if (res2.code == "10000") {
bankInfo = res2.results;
console.log(bankInfo, 'bankInfobankInfobankInfobankInfo')
bankInfo.sessionid = sessionID;
this_.bankInfo_ = bankInfo
this_.bindCardNo = res2.results.bindCardNo;
// 20211129
this_.openCardPhon = bankInfo.mobileNo
this_.queryBankInfo();
......@@ -672,6 +735,34 @@
},
});
},
async queryBindCardListBefore() {
let this_ = this;
let loading = weui.loading("请稍后");
await $.ajax({
url: gHost + "/bank-wechat/user/bank/bindingList",
type: "POST",
contentType: "application/x-www-form-urlencoded",
data: {
cardNo: bankInfo.accountNo,
schoolId: bankInfo.schoolId,
userId: userID,
sessionid: sessionID,
wechattype: 1,
},
success: function(res4) {
loading.hide();
if (res4.code == "10000") {
this_.bindcardList = res4.results;
console.log(this_.bindcardList, 'bindcardListbindcardListbindcardList')
} else {
weui.topTips(res4.message);
}
},
error: function(err) {
loading.hide();
},
});
},
//查询用户信息
QueryUserInfo() {
let this_ = this;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment