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

浦发充值提现新逻辑

parent 88056c03
...@@ -21,7 +21,8 @@ ...@@ -21,7 +21,8 @@
</view> </view>
<view class="right"> <view class="right">
<van-popover v-model="showPopover" trigger="click" placement="bottom-end"> <van-popover v-model="showPopover" trigger="click" placement="bottom-end">
<view class="popoverItem" v-for="(item, index) in actions" @click="onSelect(item)" :id="item.id ? item.id : '#item'+index"> <view class="popoverItem" v-for="(item, index) in actions" @click="onSelect(item)"
:id="item.id ? item.id : '#item'+index">
{{item.text}} {{item.text}}
</view> </view>
<template #reference> <template #reference>
...@@ -104,7 +105,8 @@ ...@@ -104,7 +105,8 @@
<view> {{ item.lable }}</view> <view> {{ item.lable }}</view>
</view> </view>
<view class="other"> <view class="other">
<input v-model="inputOtherM" @input="inputControl" @blur="ReturnToTop" placeholder="其他金额,最低3元" <input v-model="inputOtherM" @input="inputControl" @blur="ReturnToTop"
:placeholder="typeCode == 'SPDB' ? '其他金额,最低100元' : '其他金额,最低3元'"
placeholder-class="placeholderinputOtherM" type="text" maxlength="6" /> placeholder-class="placeholderinputOtherM" type="text" maxlength="6" />
</view> </view>
</view> </view>
...@@ -283,27 +285,30 @@ ...@@ -283,27 +285,30 @@
</template> </template>
<script> <script>
import { Dialog, Toast } from "vant"; import {
import keyboardPackage from "@/components/keyboard-package/keyboard-package.vue"; Dialog,
import cityData from "@/common/js/city.js"; Toast
var gHost = "https://" + window.location.host; } from "vant";
if (window.location.protocol != "https:") { import keyboardPackage from "@/components/keyboard-package/keyboard-package.vue";
import cityData from "@/common/js/city.js";
var gHost = "https://" + window.location.host;
if (window.location.protocol != "https:") {
gHost = "https://fpdev.xiaopay.net"; gHost = "https://fpdev.xiaopay.net";
// gHost = "/api"; // gHost = "/api";
} }
let times = 0; let times = 0;
var limitClick = false; //禁止重复点击 var limitClick = false; //禁止重复点击
var sessionID = "", var sessionID = "",
userID = ""; userID = "";
var payCardNumber = ""; //一类卡号 var payCardNumber = ""; //一类卡号
var orderSerialNo = ""; //提现结果查询 指令号 var orderSerialNo = ""; //提现结果查询 指令号
var businessNo = "", var businessNo = "",
otpOrderNo = "", otpOrderNo = "",
mobileNo = ""; mobileNo = "";
var MyTimer = null; var MyTimer = null;
var fromType = 0; //0转账 1提现 var fromType = 0; //0转账 1提现
var opeType = 0; //0充值 1提现 手机号验证 var opeType = 0; //0充值 1提现 手机号验证
var bankInfo = { var bankInfo = {
acctNoArray: "", acctNoArray: "",
idNo: "", idNo: "",
schoolId: "", schoolId: "",
...@@ -311,14 +316,14 @@ var bankInfo = { ...@@ -311,14 +316,14 @@ var bankInfo = {
userId: "", userId: "",
sessionid: "", sessionid: "",
wechattype: 1, wechattype: 1,
}; };
var accountType = ""; var accountType = "";
let orderApi = window.location.origin; let orderApi = window.location.origin;
/** /**
* 对象转拼接字符串 * 对象转拼接字符串
* @param {*} res Object 需要转换的数据对象 * @param {*} res Object 需要转换的数据对象
*/ */
function OforS(res) { function OforS(res) {
var resL = 0; var resL = 0;
var outS = ""; var outS = "";
for (var i in res) { for (var i in res) {
...@@ -330,14 +335,24 @@ function OforS(res) { ...@@ -330,14 +335,24 @@ function OforS(res) {
resL++; resL++;
} }
return outS; return outS;
} }
export default { export default {
components: { components: {
keyboardPackage, keyboardPackage,
}, },
name: "Recharge", name: "Recharge",
data() { data() {
return { return {
showPopover: false,
// 通过 actions 属性来定义菜单选项
actions: [{
text: "复制卡号",
id: "cardNumright"
}, {
text: "账户明细"
}, {
text: "常见问题"
}],
popshow: false, popshow: false,
// 输入其它金额 // 输入其它金额
isOtherMoney: false, isOtherMoney: false,
...@@ -363,8 +378,7 @@ export default { ...@@ -363,8 +378,7 @@ export default {
bindCardNo: "", bindCardNo: "",
}, },
ImgUrl: this.$ImgUrl, ImgUrl: this.$ImgUrl,
MoneyList: [ MoneyList: [{
{
lable: "", lable: "",
value: 100, value: 100,
}, },
...@@ -398,6 +412,7 @@ export default { ...@@ -398,6 +412,7 @@ export default {
2: "工商银行III类户", 2: "工商银行III类户",
3: "交通银行III类户", 3: "交通银行III类户",
4: "渤海银行II类户", 4: "渤海银行II类户",
5: "浦发银行III类户",
}, },
/** /**
* 20211129新增 * 20211129新增
...@@ -407,9 +422,10 @@ export default { ...@@ -407,9 +422,10 @@ export default {
openCardPhonSms: "", openCardPhonSms: "",
msCount: 60, //定时器 msCount: 60, //定时器
RechargeSmsorderNoInfo: {}, //第三方合作交易标识 RechargeSmsorderNoInfo: {}, //第三方合作交易标识
typeCode: "",
}; };
}, },
onLoad: function (options) { onLoad: function(options) {
console.log(options); console.log(options);
// 初始化 // 初始化
userID = options["userID"] || ""; userID = options["userID"] || "";
...@@ -418,9 +434,9 @@ export default { ...@@ -418,9 +434,9 @@ export default {
bankInfo.sessionid = sessionID || ""; bankInfo.sessionid = sessionID || "";
this.beforeQuerySignStatus(); this.beforeQuerySignStatus();
}, },
created: function () {}, created: function() {},
mounted: function () {}, mounted: function() {},
onShow: function () { onShow: function() {
if (bankInfo.userId) { if (bankInfo.userId) {
this.queryBankInfo(); this.queryBankInfo();
} }
...@@ -489,7 +505,11 @@ export default { ...@@ -489,7 +505,11 @@ export default {
this.msCount = 60; this.msCount = 60;
this.openCardPhonSms = ""; this.openCardPhonSms = "";
} }
if (bankInfo.typeCode != 'SPDB') {
this.$refs.popup.open("top"); this.$refs.popup.open("top");
}else {
this.ExchangeRecharge();
}
}, },
// 验证码弹出框关闭 // 验证码弹出框关闭
close() { close() {
...@@ -503,8 +523,7 @@ export default { ...@@ -503,8 +523,7 @@ export default {
$(".doBtnTx").html("提现"); $(".doBtnTx").html("提现");
opeType = 1; opeType = 1;
uni.navigateTo({ uni.navigateTo({
url: url: "../Reflect/Reflect?" +
"../Reflect/Reflect?" +
OforS({ OforS({
sessionID: sessionID, sessionID: sessionID,
userID: userID, userID: userID,
...@@ -522,7 +541,7 @@ export default { ...@@ -522,7 +541,7 @@ export default {
this_.MoneyIndex = -1; this_.MoneyIndex = -1;
this_.isOtherMoney = true; this_.isOtherMoney = true;
let obj = e.detail; let obj = e.detail;
this.$nextTick(function () { this.$nextTick(function() {
obj.value = obj.value.replace(/[^\d.]/g, ""); //清除"数字"和"."以外的字符 obj.value = obj.value.replace(/[^\d.]/g, ""); //清除"数字"和"."以外的字符
obj.value = obj.value.replace(/^\./g, ""); //验证第一个字符是数字而不是. obj.value = obj.value.replace(/^\./g, ""); //验证第一个字符是数字而不是.
obj.value = obj.value.replace(/\.{2,}/g, "."); //只保留第一个. 清除多余的. obj.value = obj.value.replace(/\.{2,}/g, "."); //只保留第一个. 清除多余的.
...@@ -533,7 +552,11 @@ export default { ...@@ -533,7 +552,11 @@ export default {
obj.value = obj.value.replace(/^(\-)*(\d+)\.(\d\d).*$/, "$1$2.$3"); //只能输入两个小数 obj.value = obj.value.replace(/^(\-)*(\d+)\.(\d\d).*$/, "$1$2.$3"); //只能输入两个小数
obj.value = obj.value =
obj.value * 1 > this_.RechargeMax ? this_.RechargeMax : obj.value; obj.value * 1 > this_.RechargeMax ? this_.RechargeMax : obj.value;
if (obj.value == "" || obj.value * 1 < 3) { let limitMoney = 3;
if (this_.typeCode == 'SPDB') {
limitMoney = 100;
}
if (obj.value == "" || obj.value * 1 < limitMoney) {
$(".DepositID").attr( $(".DepositID").attr(
"style", "style",
"background: rgb(230, 230, 230) !important;" "background: rgb(230, 230, 230) !important;"
...@@ -551,7 +574,7 @@ export default { ...@@ -551,7 +574,7 @@ export default {
if (str.lastIndexOf(".") == str.length - 1) { if (str.lastIndexOf(".") == str.length - 1) {
this.inputOtherM = str.substring(0, str.length - 1); this.inputOtherM = str.substring(0, str.length - 1);
} }
this.$nextTick(function () { this.$nextTick(function() {
document.scrollingElement.scrollTo(0, this.scrollTop); document.scrollingElement.scrollTo(0, this.scrollTop);
}); });
}, },
...@@ -588,7 +611,7 @@ export default { ...@@ -588,7 +611,7 @@ export default {
headers: { headers: {
sessionid: sessionID, sessionid: sessionID,
}, },
success: function (respes) { success: function(respes) {
loading.clear(); loading.clear();
if (respes.code == "10000") { if (respes.code == "10000") {
console.log(respes, "respes"); console.log(respes, "respes");
...@@ -596,8 +619,7 @@ export default { ...@@ -596,8 +619,7 @@ export default {
// 1已签约 // 1已签约
Dialog.alert({ Dialog.alert({
title: "使用说明", title: "使用说明",
message: message: "您暂未进行银行代扣签约,将影响电子校园卡的正常使用,请尽快前往签约",
"您暂未进行银行代扣签约,将影响电子校园卡的正常使用,请尽快前往签约",
theme: "round-button", theme: "round-button",
confirmButtonText: "前往签约", confirmButtonText: "前往签约",
confirmButtonColor: "#2ddbb6", confirmButtonColor: "#2ddbb6",
...@@ -618,7 +640,7 @@ export default { ...@@ -618,7 +640,7 @@ export default {
throw new Error("代扣状态查询,请重试!"); throw new Error("代扣状态查询,请重试!");
} }
}, },
error: function (err) { error: function(err) {
loading.clear(); loading.clear();
Toast(err || "代扣状态查询,请重试!"); Toast(err || "代扣状态查询,请重试!");
throw new Error("代扣状态查询,请重试!"); throw new Error("代扣状态查询,请重试!");
...@@ -654,6 +676,9 @@ export default { ...@@ -654,6 +676,9 @@ export default {
case 4: case 4:
exchangeUrl = exchangeUrl + "/bank-wechat/bohai/comprehensive/otpSms"; exchangeUrl = exchangeUrl + "/bank-wechat/bohai/comprehensive/otpSms";
break; break;
case 5:
exchangeUrl = exchangeUrl + "/bank-wechat/spdb/passcodes";
break;
default: default:
Dialog({ Dialog({
title: "系统提示", title: "系统提示",
...@@ -662,11 +687,7 @@ export default { ...@@ -662,11 +687,7 @@ export default {
throw "银行账号类型错误!"; throw "银行账号类型错误!";
break; break;
} }
$.ajax({ let params = {
url: exchangeUrl,
type: "POST",
contentType: "application/x-www-form-urlencoded",
data: {
amount: ((this.Money || this.inputOtherM) * 1).toFixed(2), //充值金额,单位元 amount: ((this.Money || this.inputOtherM) * 1).toFixed(2), //充值金额,单位元
schoolId: bankInfo.schoolId, //学校id schoolId: bankInfo.schoolId, //学校id
userId: userID, //用户id userId: userID, //用户id
...@@ -675,11 +696,23 @@ export default { ...@@ -675,11 +696,23 @@ export default {
// 20211230渤海 // 20211230渤海
mobilePhone: this.openCardPhon, mobilePhone: this.openCardPhon,
msg: "充值", msg: "充值",
}, }
let params1 = {
mobileNum: this.openCardPhon,
schoolId: bankInfo.schoolId, //学校id
userId: userID, //用户id
sessionid: sessionID,
wechattype: 1
}
$.ajax({
url: exchangeUrl,
type: "POST",
contentType: "application/x-www-form-urlencoded",
data: bankInfo.accountType == 5 ? params1 : params,
headers: { headers: {
sessionid: sessionID, sessionid: sessionID,
}, },
success: function (res5) { success: function(res5) {
loading.clear(); loading.clear();
if (res5.code == "10000") { if (res5.code == "10000") {
this_.IntervalFun(); this_.IntervalFun();
...@@ -693,7 +726,7 @@ export default { ...@@ -693,7 +726,7 @@ export default {
}); });
} }
}, },
error: function (err) { error: function(err) {
loading.clear(); loading.clear();
}, },
}); });
...@@ -728,7 +761,7 @@ export default { ...@@ -728,7 +761,7 @@ export default {
}); });
return; return;
} }
if (bankInfo.accountType != 4) { if (bankInfo.accountType != 4 && bankInfo.accountType != 5) {
if (!this.RechargeSmsorderNoInfo.orderNo) { if (!this.RechargeSmsorderNoInfo.orderNo) {
Dialog({ Dialog({
title: "系统提示", title: "系统提示",
...@@ -737,7 +770,7 @@ export default { ...@@ -737,7 +770,7 @@ export default {
return; return;
} }
} }
if (!this.openCardPhonSms) { if (!this.openCardPhonSms && bankInfo.accountType != 5) {
Dialog({ Dialog({
title: "系统提示", title: "系统提示",
message: "请收入验证码!", message: "请收入验证码!",
...@@ -757,6 +790,9 @@ export default { ...@@ -757,6 +790,9 @@ export default {
case 4: case 4:
exchangeUrl = exchangeUrl + "/bank-wechat/bohai/exchange/recharge"; exchangeUrl = exchangeUrl + "/bank-wechat/bohai/exchange/recharge";
break; break;
case 5:
exchangeUrl = exchangeUrl + "/bank-wechat/spdb/deposits";
break;
default: default:
Dialog({ Dialog({
title: "系统提示", title: "系统提示",
...@@ -765,11 +801,7 @@ export default { ...@@ -765,11 +801,7 @@ export default {
throw "银行账号类型错误!"; throw "银行账号类型错误!";
break; break;
} }
$.ajax({ let params = {
url: exchangeUrl,
type: "POST",
contentType: "application/x-www-form-urlencoded",
data: {
amount: (amount * 1).toFixed(2), //充值金额,单位元 amount: (amount * 1).toFixed(2), //充值金额,单位元
mobileCode: this.openCardPhonSms, //短信验证码 mobileCode: this.openCardPhonSms, //短信验证码
orderNo: this_.RechargeSmsorderNoInfo.orderNo, //第三方合作交易标识,取充值短信返回的orderNo值 orderNo: this_.RechargeSmsorderNoInfo.orderNo, //第三方合作交易标识,取充值短信返回的orderNo值
...@@ -780,11 +812,35 @@ export default { ...@@ -780,11 +812,35 @@ export default {
// 21211230渤海银行 // 21211230渤海银行
transAmount: (amount * 1).toFixed(2), transAmount: (amount * 1).toFixed(2),
verifyNo: this.openCardPhonSms, verifyNo: this.openCardPhonSms,
}, };
let bindingCardId = "";
console.log(bankInfo.bindCardNo, 'bindCardNobindCardNobindCardNobindCardNo')
if (this.bindcardList.length) {
let arr = this.bindcardList.filter(x => x.bindCardNo == bankInfo.bindCardNo);
console.log(arr[0],'绑定卡绑定卡')
if(arr.length){
bindingCardId = arr[0].bindCardId;
}
}
let params1 = {
// 浦发银行
amount: (amount * 1).toFixed(2), //充值金额,单位元
schoolId: bankInfo.schoolId, //学校id
userId: userID, //用户id
sessionid: sessionID,
wechattype: 1,
bindingCardId: bindingCardId,
// ipAdress: '110.53.253.164'
};
$.ajax({
url: exchangeUrl,
type: "POST",
contentType: "application/x-www-form-urlencoded",
data: this_.typeCode == 'SPDB' ? params1 : params,
headers: { headers: {
sessionid: sessionID, sessionid: sessionID,
}, },
success: function (res5) { success: function(res5) {
uni.hideLoading(); uni.hideLoading();
if (res5.code == "10000") { if (res5.code == "10000") {
this_.close(); this_.close();
...@@ -796,9 +852,9 @@ export default { ...@@ -796,9 +852,9 @@ export default {
let accountNo = this_.bankInfo_.bindCardNo; let accountNo = this_.bankInfo_.bindCardNo;
accountNo = accountNo.slice(accountNo.length - 4, accountNo.length); accountNo = accountNo.slice(accountNo.length - 4, accountNo.length);
let minutes_ = let minutes_ =
thiTime.getMinutes().toString().length < 2 thiTime.getMinutes().toString().length < 2 ?
? thiTime.getMinutes().toString().padStart(2, "0") thiTime.getMinutes().toString().padStart(2, "0") :
: thiTime.getMinutes().toString(); thiTime.getMinutes().toString();
switch (bankInfo.accountType) { switch (bankInfo.accountType) {
case 3: case 3:
if (thiTime.getMinutes() + 20 >= 60) { if (thiTime.getMinutes() + 20 >= 60) {
...@@ -811,7 +867,7 @@ export default { ...@@ -811,7 +867,7 @@ export default {
title: "充值申请已提交", title: "充值申请已提交",
content: "银行处理需要1-20分钟时间,充值结果以余额查询为准。", content: "银行处理需要1-20分钟时间,充值结果以余额查询为准。",
showCancel: false, showCancel: false,
success: function () { success: function() {
uni.navigateTo({ uni.navigateTo({
url: `../../recharging/recharging?bankName=${ url: `../../recharging/recharging?bankName=${
this_.bankInfo_.bindCardName this_.bankInfo_.bindCardName
...@@ -999,6 +1055,10 @@ export default { ...@@ -999,6 +1055,10 @@ export default {
}, },
//查询一类卡绑定列表 //查询一类卡绑定列表
queryBindCardList() { queryBindCardList() {
this.queryBindCardListBefore();
this_.popshow = true;
},
queryBindCardListBefore() {
let this_ = this; let this_ = this;
let loading = weui.loading("请稍后"); let loading = weui.loading("请稍后");
$.ajax({ $.ajax({
...@@ -1016,7 +1076,6 @@ export default { ...@@ -1016,7 +1076,6 @@ export default {
loading.hide(); loading.hide();
if (res4.code == "10000") { if (res4.code == "10000") {
this_.bindcardList = res4.results; this_.bindcardList = res4.results;
this_.popshow = true;
} else { } else {
weui.topTips(res4.message); weui.topTips(res4.message);
} }
...@@ -1030,6 +1089,9 @@ export default { ...@@ -1030,6 +1089,9 @@ export default {
queryBankInfo() { queryBankInfo() {
let this_ = this; let this_ = this;
let queryBankInfoUrl = gHost; let queryBankInfoUrl = gHost;
if (bankInfo.accountType == 5) {
this.queryBindCardListBefore();
}
// 20211230 // 20211230
switch (bankInfo.accountType) { switch (bankInfo.accountType) {
case 3: case 3:
...@@ -1041,6 +1103,10 @@ export default { ...@@ -1041,6 +1103,10 @@ export default {
queryBankInfoUrl = queryBankInfoUrl =
queryBankInfoUrl + "/bank-wechat/bohai/exchange/balanceQuery"; queryBankInfoUrl + "/bank-wechat/bohai/exchange/balanceQuery";
break; break;
case 5:
queryBankInfoUrl =
queryBankInfoUrl + "/bank-wechat/spdb/balancesQuery";
break;
default: default:
Dialog({ Dialog({
title: "系统提示", title: "系统提示",
...@@ -1050,18 +1116,24 @@ export default { ...@@ -1050,18 +1116,24 @@ export default {
break; break;
} }
// let loading = weui.loading('请稍后'); // let loading = weui.loading('请稍后');
$.ajax({ let params = {
url: queryBankInfoUrl,
type: "POST",
timeout: 8000,
contentType: "application/x-www-form-urlencoded",
data: {
mediumId: bankInfo.accountNo || "", mediumId: bankInfo.accountNo || "",
schoolId: bankInfo.schoolId || "", schoolId: bankInfo.schoolId || "",
userId: bankInfo.userId || "", userId: bankInfo.userId || "",
sessionid: sessionID, sessionid: sessionID,
wechattype: 1, 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: params,
success: function(res3) { success: function(res3) {
// loading.hide(); // loading.hide();
if (res3.code == "10000") { if (res3.code == "10000") {
...@@ -1133,6 +1205,7 @@ export default { ...@@ -1133,6 +1205,7 @@ export default {
return; return;
} }
bankInfo = res2.results; bankInfo = res2.results;
this_.typeCode = res2.results.typeCode;
bankInfo.sessionid = sessionID; bankInfo.sessionid = sessionID;
this_.queryBankInfo(); //查余额 this_.queryBankInfo(); //查余额
this_.bankInfo_ = bankInfo; this_.bankInfo_ = bankInfo;
...@@ -1563,6 +1636,7 @@ export default { ...@@ -1563,6 +1636,7 @@ export default {
font-family: PingFangSC-Medium, PingFang SC; font-family: PingFangSC-Medium, PingFang SC;
margin-bottom: 24rpx; margin-bottom: 24rpx;
border: 3rpx solid transparent; border: 3rpx solid transparent;
view { view {
align-self: center; align-self: center;
color: #333333; color: #333333;
...@@ -1598,6 +1672,7 @@ export default { ...@@ -1598,6 +1672,7 @@ export default {
background: #f8f8f8; background: #f8f8f8;
border-radius: 12rpx; border-radius: 12rpx;
border: 3rpx solid transparent; border: 3rpx solid transparent;
/deep/.uni-input-wrapper { /deep/.uni-input-wrapper {
position: absolute; position: absolute;
width: 444rpx; width: 444rpx;
...@@ -2199,6 +2274,7 @@ export default { ...@@ -2199,6 +2274,7 @@ export default {
line-height: 120rpx; line-height: 120rpx;
font-weight: 600; font-weight: 600;
} }
.popoverItem { .popoverItem {
width: 225rpx; width: 225rpx;
margin: 0 20rpx; margin: 0 20rpx;
...@@ -2210,6 +2286,7 @@ export default { ...@@ -2210,6 +2286,7 @@ export default {
color: #000000; color: #000000;
border-bottom: 1rpx solid #dddddd; border-bottom: 1rpx solid #dddddd;
} }
.popoverItem:last-child { .popoverItem:last-child {
border-bottom: 0; border-bottom: 0;
} }
......
...@@ -4,8 +4,8 @@ ...@@ -4,8 +4,8 @@
<view class="left_">提现金额 </view> <view class="left_">提现金额 </view>
<view class="right_">每日可提现一次</view> <view class="right_">每日可提现一次</view>
</view> </view>
<!-- 20211230渤海银行 --> <!-- 20211230渤海银行 浦发银行 -->
<view class="BankBohai" v-if="bankInfo_.accountType==4"> <view class="BankBohai" v-if="bankInfo_.accountType==4 || bankInfo_.accountType==5">
<view class="BankBHL">提现至</view> <view class="BankBHL">提现至</view>
<view class="BankBHR"> <view class="BankBHR">
<view class="">{{bankInfo_.bindCardName}} <view class="">{{bankInfo_.bindCardName}}
...@@ -141,7 +141,9 @@ ...@@ -141,7 +141,9 @@
msCount: 60, //定时器 msCount: 60, //定时器
CodeMsg: "获取验证码", CodeMsg: "获取验证码",
RechargeSmsorderNoInfo: {}, //第三方合作交易标识 RechargeSmsorderNoInfo: {}, //第三方合作交易标识
WithdrawInfo: null WithdrawInfo: null,
bindcardList: [],
bindCardNo: "",
} }
}, },
onLoad: function(options) { onLoad: function(options) {
...@@ -189,6 +191,9 @@ ...@@ -189,6 +191,9 @@
case 4: case 4:
withdrawSmsUrl = withdrawSmsUrl + '/bank-wechat/bohai/comprehensive/otpSms'; withdrawSmsUrl = withdrawSmsUrl + '/bank-wechat/bohai/comprehensive/otpSms';
break; break;
case 5:
withdrawSmsUrl = withdrawSmsUrl + '/bank-wechat/spdb/passcodes';
break;
default: default:
Dialog({ Dialog({
title: '系统提示', title: '系统提示',
...@@ -197,11 +202,7 @@ ...@@ -197,11 +202,7 @@
throw ("银行账号类型错误!") throw ("银行账号类型错误!")
break; break;
} }
$.ajax({ let params = {
url: withdrawSmsUrl,
type: "POST",
contentType: "application/x-www-form-urlencoded",
data: {
amount: (this.inputOtherM * 1).toFixed(2), //充值金额,单位元 amount: (this.inputOtherM * 1).toFixed(2), //充值金额,单位元
schoolId: bankInfo.schoolId, //学校id schoolId: bankInfo.schoolId, //学校id
userId: userID, //用户id userId: userID, //用户id
...@@ -210,7 +211,29 @@ ...@@ -210,7 +211,29 @@
// 21211230渤海银行 // 21211230渤海银行
mobilePhone: this.openCardPhon, mobilePhone: this.openCardPhon,
msg: "提现" 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: { headers: {
'sessionid': sessionID, 'sessionid': sessionID,
}, },
...@@ -308,12 +331,16 @@ ...@@ -308,12 +331,16 @@
return return
} }
this.openCardPhonSms = ''; this.openCardPhonSms = '';
if(bankInfo.accountType != 5) {
this.$refs.popup.open('top') this.$refs.popup.open('top')
}else {
this.ExchangeWithdraw();
}
}, },
// 提现 // 提现
async ExchangeWithdraw() { async ExchangeWithdraw() {
let this_ = this; let this_ = this;
if (bankInfo.accountType != 4) { if (bankInfo.accountType != 4 && bankInfo.accountType != 5) {
if (!this.RechargeSmsorderNoInfo.orderNo) { if (!this.RechargeSmsorderNoInfo.orderNo) {
Dialog({ Dialog({
title: '系统提示', title: '系统提示',
...@@ -322,7 +349,7 @@ ...@@ -322,7 +349,7 @@
return return
} }
} }
if (!this.openCardPhonSms) { if (!this.openCardPhonSms && bankInfo.accountType != 5) {
Dialog({ Dialog({
title: '系统提示', title: '系统提示',
message: '请收入验证码!' message: '请收入验证码!'
...@@ -332,6 +359,9 @@ ...@@ -332,6 +359,9 @@
let loading = weui.loading('请稍后'); let loading = weui.loading('请稍后');
// 20211230 // 20211230
let withdrawUrl = gHost; let withdrawUrl = gHost;
if(bankInfo.accountType == 5){
await this.queryBindCardListBefore();
}
switch (bankInfo.accountType) { switch (bankInfo.accountType) {
case 3: case 3:
withdrawUrl = withdrawUrl + '/bank-wechat/bocom/exchange/withdraw'; withdrawUrl = withdrawUrl + '/bank-wechat/bocom/exchange/withdraw';
...@@ -339,6 +369,9 @@ ...@@ -339,6 +369,9 @@
case 4: case 4:
withdrawUrl = withdrawUrl + '/bank-wechat/bohai/exchange/withdraw'; withdrawUrl = withdrawUrl + '/bank-wechat/bohai/exchange/withdraw';
break; break;
case 5:
withdrawUrl = withdrawUrl + '/bank-wechat/spdb/withdrawals';
break;
default: default:
Dialog({ Dialog({
title: '系统提示', title: '系统提示',
...@@ -347,11 +380,7 @@ ...@@ -347,11 +380,7 @@
throw ("银行账号类型错误!") throw ("银行账号类型错误!")
break; break;
} }
$.ajax({ let params = {
url: withdrawUrl,
type: "POST",
contentType: "application/x-www-form-urlencoded",
data: {
amount: (this.inputOtherM * 1).toFixed(2), //充值金额,单位元 amount: (this.inputOtherM * 1).toFixed(2), //充值金额,单位元
orderNo: this_.RechargeSmsorderNoInfo.orderNo, orderNo: this_.RechargeSmsorderNoInfo.orderNo,
msgCodeSeq: this_.RechargeSmsorderNoInfo.msgCodeSeq, msgCodeSeq: this_.RechargeSmsorderNoInfo.msgCodeSeq,
...@@ -363,7 +392,30 @@ ...@@ -363,7 +392,30 @@
// 21211230渤海银行 // 21211230渤海银行
transAmount: (this.inputOtherM * 1).toFixed(2), transAmount: (this.inputOtherM * 1).toFixed(2),
verifyNo: this_.openCardPhonSms, 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: { headers: {
'sessionid': sessionID, 'sessionid': sessionID,
}, },
...@@ -376,10 +428,10 @@ ...@@ -376,10 +428,10 @@
content: '银行处理需要1-5分钟时间,充值结果以余额查询为准。', content: '银行处理需要1-5分钟时间,充值结果以余额查询为准。',
showCancel: false, showCancel: false,
success: function() { success: function() {
if (bankInfo.accountType != 4) { if (bankInfo.accountType != 4 && bankInfo.accountType != 5) {
this_.ExchangeWithdrawQuery(); this_.ExchangeWithdrawQuery();
} }
if (bankInfo.accountType == 4) { if (bankInfo.accountType == 4 && bankInfo.accountType != 5) {
window.location.reload() window.location.reload()
} }
} }
...@@ -465,7 +517,7 @@ ...@@ -465,7 +517,7 @@
ReturnToTop() { ReturnToTop() {
// 若最后一位为小数点则去掉 // 若最后一位为小数点则去掉
let str = this.inputOtherM + ""; 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.inputOtherM = str.substring(0, str.length - 1)
} }
this.$nextTick(function() { this.$nextTick(function() {
...@@ -576,6 +628,9 @@ ...@@ -576,6 +628,9 @@
case 4: case 4:
queryBankInfoUrl = queryBankInfoUrl + '/bank-wechat/bohai/exchange/balanceQuery'; queryBankInfoUrl = queryBankInfoUrl + '/bank-wechat/bohai/exchange/balanceQuery';
break; break;
case 5:
queryBankInfoUrl = queryBankInfoUrl + '/bank-wechat/spdb/balancesQuery';
break;
default: default:
Dialog({ Dialog({
title: '系统提示', title: '系统提示',
...@@ -584,18 +639,24 @@ ...@@ -584,18 +639,24 @@
throw ("银行账号类型错误!") throw ("银行账号类型错误!")
break; 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({ $.ajax({
url: queryBankInfoUrl, url: queryBankInfoUrl,
type: "POST", type: "POST",
timeout: 8000, timeout: 8000,
contentType: "application/x-www-form-urlencoded", contentType: "application/x-www-form-urlencoded",
data: { data: params,
mediumId: bankInfo.accountNo || '',
schoolId: bankInfo.schoolId || '',
userId: bankInfo.userId || '',
sessionid: sessionID,
wechattype: 1,
},
success: function(res3) { success: function(res3) {
loading.hide(); loading.hide();
if (res3.code == "10000") { if (res3.code == "10000") {
...@@ -658,8 +719,10 @@ ...@@ -658,8 +719,10 @@
success: function(res2) { success: function(res2) {
if (res2.code == "10000") { if (res2.code == "10000") {
bankInfo = res2.results; bankInfo = res2.results;
console.log(bankInfo, 'bankInfobankInfobankInfobankInfo')
bankInfo.sessionid = sessionID; bankInfo.sessionid = sessionID;
this_.bankInfo_ = bankInfo this_.bankInfo_ = bankInfo
this_.bindCardNo = res2.results.bindCardNo;
// 20211129 // 20211129
this_.openCardPhon = bankInfo.mobileNo this_.openCardPhon = bankInfo.mobileNo
this_.queryBankInfo(); this_.queryBankInfo();
...@@ -672,6 +735,34 @@ ...@@ -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() { QueryUserInfo() {
let this_ = this; 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