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,537 +285,591 @@ ...@@ -283,537 +285,591 @@
</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";
gHost = "https://fpdev.xiaopay.net"; import cityData from "@/common/js/city.js";
// gHost = "/api"; var gHost = "https://" + window.location.host;
} if (window.location.protocol != "https:") {
let times = 0; gHost = "https://fpdev.xiaopay.net";
var limitClick = false; //禁止重复点击 // gHost = "/api";
var sessionID = "", }
userID = ""; let times = 0;
var payCardNumber = ""; //一类卡号 var limitClick = false; //禁止重复点击
var orderSerialNo = ""; //提现结果查询 指令号 var sessionID = "",
var businessNo = "", userID = "";
otpOrderNo = "", var payCardNumber = ""; //一类卡号
mobileNo = ""; var orderSerialNo = ""; //提现结果查询 指令号
var MyTimer = null; var businessNo = "",
var fromType = 0; //0转账 1提现 otpOrderNo = "",
var opeType = 0; //0充值 1提现 手机号验证 mobileNo = "";
var bankInfo = { var MyTimer = null;
acctNoArray: "", var fromType = 0; //0转账 1提现
idNo: "", var opeType = 0; //0充值 1提现 手机号验证
schoolId: "", var bankInfo = {
trueName: "", acctNoArray: "",
userId: "", idNo: "",
sessionid: "", schoolId: "",
wechattype: 1, trueName: "",
}; userId: "",
var accountType = ""; sessionid: "",
let orderApi = window.location.origin; wechattype: 1,
/** };
* 对象转拼接字符串 var accountType = "";
* @param {*} res Object 需要转换的数据对象 let orderApi = window.location.origin;
*/ /**
function OforS(res) { * 对象转拼接字符串
var resL = 0; * @param {*} res Object 需要转换的数据对象
var outS = ""; */
for (var i in res) { function OforS(res) {
if (resL == 0) { var resL = 0;
outS += "" + i + "=" + res[i]; var outS = "";
} else { for (var i in res) {
outS += "&" + i + "=" + res[i]; if (resL == 0) {
} outS += "" + i + "=" + res[i];
resL++; } else {
} outS += "&" + i + "=" + res[i];
return outS; }
} resL++;
export default { }
components: { return outS;
keyboardPackage, }
}, export default {
name: "Recharge", components: {
data() { keyboardPackage,
return { },
popshow: false, name: "Recharge",
// 输入其它金额 data() {
isOtherMoney: false, return {
inputOtherM: "", showPopover: false,
RechargeException: false, // 通过 actions 属性来定义菜单选项
depotMoneyother: false, //其他充值 actions: [{
Money: "", //选择金额 text: "复制卡号",
MoneyIndex: -1, id: "cardNumright"
RechargeMax: "2000", //最大充值限制 }, {
ReflectMoney: "", //提现金额 text: "账户明细"
VerifyCode: "", //验证码 }, {
cardBalanceTx: "0", //余额 text: "常见问题"
CodeMsg: "获取验证码", }],
type: "number", popshow: false,
PersonalInfo: { // 输入其它金额
schoolname: "", isOtherMoney: false,
name: "", inputOtherM: "",
usertype: "1", RechargeException: false,
}, depotMoneyother: false, //其他充值
bankInfo_: { Money: "", //选择金额
accountNo: "**** **** **** 1234", MoneyIndex: -1,
bindCardName: "", RechargeMax: "2000", //最大充值限制
bindCardNo: "", ReflectMoney: "", //提现金额
}, VerifyCode: "", //验证码
ImgUrl: this.$ImgUrl, cardBalanceTx: "0", //余额
MoneyList: [ CodeMsg: "获取验证码",
{ type: "number",
lable: "", PersonalInfo: {
value: 100, schoolname: "",
}, name: "",
{ usertype: "1",
lable: "", },
value: 200, bankInfo_: {
}, accountNo: "**** **** **** 1234",
{ bindCardName: "",
lable: "", bindCardNo: "",
value: 500, },
}, ImgUrl: this.$ImgUrl,
{ MoneyList: [{
lable: "", lable: "",
value: 1000, value: 100,
}, },
// { {
// lable: "其他金额", lable: "",
// value: "", value: 200,
// }, },
], {
numberList: [], lable: "",
tempFiles1: "../../static/img/idCardBg1.png", //上传身份证临时选择文件 value: 500,
tempFiles2: "../../static/img/idCardBg0.png", },
//绑定的一类卡列表 {
bindcardList: [], lable: "",
// 20211126 银行账户类型 value: 1000,
accountType: "2", },
// 银行账户类型名称枚举 // {
accountEnum: { // lable: "其他金额",
1: "平安银行III类户", // value: "",
2: "工商银行III类户", // },
3: "交通银行III类户", ],
4: "渤海银行II类户", numberList: [],
}, tempFiles1: "../../static/img/idCardBg1.png", //上传身份证临时选择文件
/** tempFiles2: "../../static/img/idCardBg0.png",
* 20211129新增 //绑定的一类卡列表
*/ bindcardList: [],
// 充值手机号码 // 20211126 银行账户类型
openCardPhon: "", accountType: "2",
openCardPhonSms: "", // 银行账户类型名称枚举
msCount: 60, //定时器 accountEnum: {
RechargeSmsorderNoInfo: {}, //第三方合作交易标识 1: "平安银行III类户",
}; 2: "工商银行III类户",
}, 3: "交通银行III类户",
onLoad: function (options) { 4: "渤海银行II类户",
console.log(options); 5: "浦发银行III类户",
// 初始化 },
userID = options["userID"] || ""; /**
sessionID = options["seesionID"] || ""; * 20211129新增
fromType = options["fromType"] || ""; */
bankInfo.sessionid = sessionID || ""; // 充值手机号码
this.beforeQuerySignStatus(); openCardPhon: "",
}, openCardPhonSms: "",
created: function () {}, msCount: 60, //定时器
mounted: function () {}, RechargeSmsorderNoInfo: {}, //第三方合作交易标识
onShow: function () { typeCode: "",
if (bankInfo.userId) { };
this.queryBankInfo(); },
} onLoad: function(options) {
}, console.log(options);
methods: { // 初始化
async beforeQuerySignStatus() { userID = options["userID"] || "";
await this.QueryUserInfo(); sessionID = options["seesionID"] || "";
// 渤海银行要判断是否有代扣签约 fromType = options["fromType"] || "";
if (bankInfo.accountType == "4") { bankInfo.sessionid = sessionID || "";
await this.signStatusQuery(); this.beforeQuerySignStatus();
} },
}, created: function() {},
// 更换银行卡 mounted: function() {},
async ChangeBankPay() { onShow: function() {
// uni.showModal({ if (bankInfo.userId) {
// title: "系统提示", this.queryBankInfo();
// content: "功能开发中!" }
// }) },
// return methods: {
uni.showLoading({ async beforeQuerySignStatus() {
mask: true, await this.QueryUserInfo();
title: "请稍后....", // 渤海银行要判断是否有代扣签约
}); if (bankInfo.accountType == "4") {
if (bankInfo.accountType == 4) { await this.signStatusQuery();
jWeixin.miniProgram.navigateTo({ }
url: `/pages_subpack/pages/changeBindCard/main`, },
}); // 更换银行卡
uni.hideLoading(); async ChangeBankPay() {
return; // uni.showModal({
} // title: "系统提示",
this.BackToMini("AssignAddCard"); // content: "功能开发中!"
uni.hideLoading(); // })
}, // return
// 验证码弹出框开启 uni.showLoading({
toDeposit() { mask: true,
console.log(this.isOtherMoney, "isOtherMoney"); title: "请稍后....",
if (this.isOtherMoney) { });
if (this.inputOtherM == "") { if (bankInfo.accountType == 4) {
uni.showModal({ jWeixin.miniProgram.navigateTo({
title: "系统提示", url: `/pages_subpack/pages/changeBindCard/main`,
content: "请输入要充值的金额!", });
}); uni.hideLoading();
return; return;
} }
if (parseFloat(this.inputOtherM) * 1 < 3) { this.BackToMini("AssignAddCard");
weui.topTips("充值金额必须大于3元"); uni.hideLoading();
return; },
} // 验证码弹出框开启
} else { toDeposit() {
if (this.Money == "") { console.log(this.isOtherMoney, "isOtherMoney");
uni.showModal({ if (this.isOtherMoney) {
title: "系统提示", if (this.inputOtherM == "") {
content: "请选择要充值的金额!", uni.showModal({
}); title: "系统提示",
return; content: "请输入要充值的金额!",
} });
if (parseFloat(this.inputOtherM) * 1 < 3) { return;
weui.topTips("充值金额必须大于3元"); }
return; if (parseFloat(this.inputOtherM) * 1 < 3) {
} weui.topTips("充值金额必须大于3元");
} return;
if (MyTimer) { }
window.clearInterval(MyTimer); //停止计时器 } else {
MyTimer = null; if (this.Money == "") {
this.CodeMsg = "获取验证码"; uni.showModal({
this.msCount = 60; title: "系统提示",
this.openCardPhonSms = ""; content: "请选择要充值的金额!",
} });
this.$refs.popup.open("top"); return;
}, }
// 验证码弹出框关闭 if (parseFloat(this.inputOtherM) * 1 < 3) {
close() { weui.topTips("充值金额必须大于3元");
this.$refs.popup.close(); return;
}, }
//切换到提现 }
ToWalletTx() { if (MyTimer) {
$("#DepositBox").css("display", "none"); window.clearInterval(MyTimer); //停止计时器
$("#TxWalletBox").css("display", "block"); MyTimer = null;
// $('.TitleHeader').html('电子账户提现'); this.CodeMsg = "获取验证码";
$(".doBtnTx").html("提现"); this.msCount = 60;
opeType = 1; this.openCardPhonSms = "";
uni.navigateTo({ }
url: if (bankInfo.typeCode != 'SPDB') {
"../Reflect/Reflect?" + this.$refs.popup.open("top");
OforS({ }else {
sessionID: sessionID, this.ExchangeRecharge();
userID: userID, }
}), },
}); // 验证码弹出框关闭
}, close() {
//全部提现 this.$refs.popup.close();
TxAllFun() { },
this.ReflectMoney = this.cardBalanceTx * 1; //切换到提现
// $('.TxClsTx').val($('.cardBalanceTx')[0].textContent * 1); ToWalletTx() {
}, $("#DepositBox").css("display", "none");
// 输入限制 $("#TxWalletBox").css("display", "block");
inputControl(e) { // $('.TitleHeader').html('电子账户提现');
let this_ = this; $(".doBtnTx").html("提现");
this_.MoneyIndex = -1; opeType = 1;
this_.isOtherMoney = true; uni.navigateTo({
let obj = e.detail; url: "../Reflect/Reflect?" +
this.$nextTick(function () { OforS({
obj.value = obj.value.replace(/[^\d.]/g, ""); //清除"数字"和"."以外的字符 sessionID: sessionID,
obj.value = obj.value.replace(/^\./g, ""); //验证第一个字符是数字而不是. userID: userID,
obj.value = obj.value.replace(/\.{2,}/g, "."); //只保留第一个. 清除多余的. }),
obj.value = obj.value });
.replace(".", "$#$") },
.replace(/\./g, "") //全部提现
.replace("$#$", "."); //只允许输入一个小数点 TxAllFun() {
obj.value = obj.value.replace(/^(\-)*(\d+)\.(\d\d).*$/, "$1$2.$3"); //只能输入两个小数 this.ReflectMoney = this.cardBalanceTx * 1;
obj.value = // $('.TxClsTx').val($('.cardBalanceTx')[0].textContent * 1);
obj.value * 1 > this_.RechargeMax ? this_.RechargeMax : obj.value; },
if (obj.value == "" || obj.value * 1 < 3) { // 输入限制
$(".DepositID").attr( inputControl(e) {
"style", let this_ = this;
"background: rgb(230, 230, 230) !important;" this_.MoneyIndex = -1;
); this_.isOtherMoney = true;
} else { let obj = e.detail;
$(".DepositID").removeAttr("style"); this.$nextTick(function() {
} obj.value = obj.value.replace(/[^\d.]/g, ""); //清除"数字"和"."以外的字符
this_.inputOtherM = obj.value; obj.value = obj.value.replace(/^\./g, ""); //验证第一个字符是数字而不是.
}); obj.value = obj.value.replace(/\.{2,}/g, "."); //只保留第一个. 清除多余的.
}, obj.value = obj.value
//input键盘弹起不会弹 .replace(".", "$#$")
ReturnToTop() { .replace(/\./g, "")
// 若最后一位为小数点则去掉 .replace("$#$", "."); //只允许输入一个小数点
let str = this.inputOtherM + ""; obj.value = obj.value.replace(/^(\-)*(\d+)\.(\d\d).*$/, "$1$2.$3"); //只能输入两个小数
if (str.lastIndexOf(".") == str.length - 1) { obj.value =
this.inputOtherM = str.substring(0, str.length - 1); obj.value * 1 > this_.RechargeMax ? this_.RechargeMax : obj.value;
} let limitMoney = 3;
this.$nextTick(function () { if (this_.typeCode == 'SPDB') {
document.scrollingElement.scrollTo(0, this.scrollTop); limitMoney = 100;
}); }
}, if (obj.value == "" || obj.value * 1 < limitMoney) {
//定时器 $(".DepositID").attr(
IntervalFun() { "style",
if (this.msCount == 1) { "background: rgb(230, 230, 230) !important;"
window.clearInterval(MyTimer); //停止计时器 );
MyTimer = null; } else {
this.CodeMsg = "获取验证码"; $(".DepositID").removeAttr("style");
this.msCount = 60; }
} else { this_.inputOtherM = obj.value;
this.msCount--; });
this.CodeMsg = this.msCount + "s后获取"; },
} //input键盘弹起不会弹
}, ReturnToTop() {
// 代扣状态查询 // 若最后一位为小数点则去掉
async signStatusQuery() { let str = this.inputOtherM + "";
let loading = Toast.loading({ if (str.lastIndexOf(".") == str.length - 1) {
message: "加载中...", this.inputOtherM = str.substring(0, str.length - 1);
forbidClick: true, }
loadingType: "spinner", this.$nextTick(function() {
duration: 0, document.scrollingElement.scrollTo(0, this.scrollTop);
}); });
$.ajax({ },
url: gHost + "/bank-wechat/bohai/comprehensive/signStatusQuery", //定时器
type: "POST", IntervalFun() {
contentType: "application/x-www-form-urlencoded", if (this.msCount == 1) {
data: { window.clearInterval(MyTimer); //停止计时器
schoolId: bankInfo.schoolId, //学校id MyTimer = null;
userId: userID, //用户id this.CodeMsg = "获取验证码";
sessionid: sessionID, this.msCount = 60;
wechattype: 1 } else {
}, this.msCount--;
headers: { this.CodeMsg = this.msCount + "s后获取";
sessionid: sessionID, }
}, },
success: function (respes) { // 代扣状态查询
loading.clear(); async signStatusQuery() {
if (respes.code == "10000") { let loading = Toast.loading({
console.log(respes, "respes"); message: "加载中...",
if (respes.results.dkstatus != 1) { forbidClick: true,
// 1已签约 loadingType: "spinner",
Dialog.alert({ duration: 0,
title: "使用说明", });
message: $.ajax({
"您暂未进行银行代扣签约,将影响电子校园卡的正常使用,请尽快前往签约", url: gHost + "/bank-wechat/bohai/comprehensive/signStatusQuery",
theme: "round-button", type: "POST",
confirmButtonText: "前往签约", contentType: "application/x-www-form-urlencoded",
confirmButtonColor: "#2ddbb6", data: {
className: "signAlert", schoolId: bankInfo.schoolId, //学校id
}) userId: userID, //用户id
.then(() => { sessionid: sessionID,
// on confirm wechattype: 1
jWeixin.miniProgram.navigateTo({ },
url: `/pages/SignProxyPay/main`, headers: {
}); sessionid: sessionID,
}) },
.catch(() => { success: function(respes) {
// on cancel loading.clear();
}); if (respes.code == "10000") {
} console.log(respes, "respes");
} else { if (respes.results.dkstatus != 1) {
Toast(respes.message || "代扣状态查询,请重试!"); // 1已签约
throw new Error("代扣状态查询,请重试!"); Dialog.alert({
} title: "使用说明",
}, message: "您暂未进行银行代扣签约,将影响电子校园卡的正常使用,请尽快前往签约",
error: function (err) { theme: "round-button",
loading.clear(); confirmButtonText: "前往签约",
Toast(err || "代扣状态查询,请重试!"); confirmButtonColor: "#2ddbb6",
throw new Error("代扣状态查询,请重试!"); className: "signAlert",
}, })
}); .then(() => {
}, // on confirm
// 充值验证获取验证码 jWeixin.miniProgram.navigateTo({
async SendSms() { url: `/pages/SignProxyPay/main`,
if (MyTimer) { });
return; })
} .catch(() => {
if (!this.openCardPhon || this.openCardPhon.length !== 11) { // on cancel
Dialog({ });
title: "系统提示", }
message: "请收入正确的手机号码!", } else {
}); Toast(respes.message || "代扣状态查询,请重试!");
return; throw new Error("代扣状态查询,请重试!");
} }
},
let this_ = this; error: function(err) {
let loading = Toast.loading({ loading.clear();
message: "加载中...", Toast(err || "代扣状态查询,请重试!");
forbidClick: true, throw new Error("代扣状态查询,请重试!");
loadingType: "spinner", },
duration: 0, });
}); },
// 20211230 // 充值验证获取验证码
let exchangeUrl = gHost; async SendSms() {
switch (bankInfo.accountType) { if (MyTimer) {
case 3: return;
exchangeUrl = exchangeUrl + "/bank-wechat/bocom/exchange/rechargeSms"; }
break; if (!this.openCardPhon || this.openCardPhon.length !== 11) {
case 4: Dialog({
exchangeUrl = exchangeUrl + "/bank-wechat/bohai/comprehensive/otpSms"; title: "系统提示",
break; message: "请收入正确的手机号码!",
default: });
Dialog({ return;
title: "系统提示", }
message: "银行账号类型错误!",
}); let this_ = this;
throw "银行账号类型错误!"; let loading = Toast.loading({
break; message: "加载中...",
} forbidClick: true,
$.ajax({ loadingType: "spinner",
url: exchangeUrl, duration: 0,
type: "POST", });
contentType: "application/x-www-form-urlencoded", // 20211230
data: { let exchangeUrl = gHost;
amount: ((this.Money || this.inputOtherM) * 1).toFixed(2), //充值金额,单位元 switch (bankInfo.accountType) {
schoolId: bankInfo.schoolId, //学校id case 3:
userId: userID, //用户id exchangeUrl = exchangeUrl + "/bank-wechat/bocom/exchange/rechargeSms";
sessionid: sessionID, break;
wechattype: 1, case 4:
// 20211230渤海 exchangeUrl = exchangeUrl + "/bank-wechat/bohai/comprehensive/otpSms";
mobilePhone: this.openCardPhon, break;
msg: "充值", case 5:
}, exchangeUrl = exchangeUrl + "/bank-wechat/spdb/passcodes";
headers: { break;
sessionid: sessionID, default:
}, Dialog({
success: function (res5) { title: "系统提示",
loading.clear(); message: "银行账号类型错误!",
if (res5.code == "10000") { });
this_.IntervalFun(); throw "银行账号类型错误!";
MyTimer = window.setInterval(this_.IntervalFun, 1000); break;
this_.RechargeSmsorderNoInfo = res5.results ? res5.results : {}; }
} else { let params = {
weui.topTips(res5.message); amount: ((this.Money || this.inputOtherM) * 1).toFixed(2), //充值金额,单位元
uni.showModal({ schoolId: bankInfo.schoolId, //学校id
title: "系统提示", userId: userID, //用户id
content: res5.message, sessionid: sessionID,
}); wechattype: 1,
} // 20211230渤海
}, mobilePhone: this.openCardPhon,
error: function (err) { msg: "充值",
loading.clear(); }
}, let params1 = {
}); mobileNum: this.openCardPhon,
}, schoolId: bankInfo.schoolId, //学校id
// 充值 userId: userID, //用户id
async ExchangeRecharge() { sessionid: sessionID,
let amount, bindMedium, summary; wechattype: 1
if (this.isOtherMoney) { }
if (this.inputOtherM == "") { $.ajax({
uni.showModal({ url: exchangeUrl,
title: "系统提示", type: "POST",
content: "请输入要充值的金额!", contentType: "application/x-www-form-urlencoded",
}); data: bankInfo.accountType == 5 ? params1 : params,
return; headers: {
} sessionid: sessionID,
amount = this.inputOtherM * 1; },
} else { success: function(res5) {
if (this.Money == "") { loading.clear();
uni.showModal({ if (res5.code == "10000") {
title: "系统提示", this_.IntervalFun();
content: "请选择要充值的金额!", MyTimer = window.setInterval(this_.IntervalFun, 1000);
}); this_.RechargeSmsorderNoInfo = res5.results ? res5.results : {};
return; } else {
} weui.topTips(res5.message);
amount = this.Money * 1; uni.showModal({
} title: "系统提示",
let this_ = this; content: res5.message,
if (!this.openCardPhon || this.openCardPhon.length !== 11) { });
Dialog({ }
title: "系统提示", },
message: "请收入正确的手机号码!", error: function(err) {
}); loading.clear();
return; },
} });
if (bankInfo.accountType != 4) { },
if (!this.RechargeSmsorderNoInfo.orderNo) { // 充值
Dialog({ async ExchangeRecharge() {
title: "系统提示", let amount, bindMedium, summary;
message: "请获取验证码!", if (this.isOtherMoney) {
}); if (this.inputOtherM == "") {
return; uni.showModal({
} title: "系统提示",
} content: "请输入要充值的金额!",
if (!this.openCardPhonSms) { });
Dialog({ return;
title: "系统提示", }
message: "请收入验证码!", amount = this.inputOtherM * 1;
}); } else {
return; if (this.Money == "") {
} uni.showModal({
uni.showLoading({ title: "系统提示",
mask: true, content: "请选择要充值的金额!",
title: "处理中......", });
}); return;
// 20211230 }
let exchangeUrl = gHost; amount = this.Money * 1;
switch (bankInfo.accountType) { }
case 3: let this_ = this;
exchangeUrl = exchangeUrl + "/bank-wechat/bocom/exchange/recharge"; if (!this.openCardPhon || this.openCardPhon.length !== 11) {
break; Dialog({
case 4: title: "系统提示",
exchangeUrl = exchangeUrl + "/bank-wechat/bohai/exchange/recharge"; message: "请收入正确的手机号码!",
break; });
default: return;
Dialog({ }
title: "系统提示", if (bankInfo.accountType != 4 && bankInfo.accountType != 5) {
message: "银行账号类型错误!", if (!this.RechargeSmsorderNoInfo.orderNo) {
}); Dialog({
throw "银行账号类型错误!"; title: "系统提示",
break; message: "请获取验证码!",
} });
$.ajax({ return;
url: exchangeUrl, }
type: "POST", }
contentType: "application/x-www-form-urlencoded", if (!this.openCardPhonSms && bankInfo.accountType != 5) {
data: { Dialog({
amount: (amount * 1).toFixed(2), //充值金额,单位元 title: "系统提示",
mobileCode: this.openCardPhonSms, //短信验证码 message: "请收入验证码!",
orderNo: this_.RechargeSmsorderNoInfo.orderNo, //第三方合作交易标识,取充值短信返回的orderNo值 });
schoolId: bankInfo.schoolId, //学校id return;
userId: userID, //用户id }
sessionid: sessionID, uni.showLoading({
wechattype: 1, mask: true,
// 21211230渤海银行 title: "处理中......",
transAmount: (amount * 1).toFixed(2), });
verifyNo: this.openCardPhonSms, // 20211230
}, let exchangeUrl = gHost;
headers: { switch (bankInfo.accountType) {
sessionid: sessionID, case 3:
}, exchangeUrl = exchangeUrl + "/bank-wechat/bocom/exchange/recharge";
success: function (res5) { break;
uni.hideLoading(); case 4:
if (res5.code == "10000") { exchangeUrl = exchangeUrl + "/bank-wechat/bohai/exchange/recharge";
this_.close(); break;
setTimeout(() => { case 5:
this_.queryBankInfo(); exchangeUrl = exchangeUrl + "/bank-wechat/spdb/deposits";
}, 3000); break;
let thiTime = new Date(); default:
let str = ""; Dialog({
let accountNo = this_.bankInfo_.bindCardNo; title: "系统提示",
accountNo = accountNo.slice(accountNo.length - 4, accountNo.length); message: "银行账号类型错误!",
let minutes_ = });
thiTime.getMinutes().toString().length < 2 throw "银行账号类型错误!";
? thiTime.getMinutes().toString().padStart(2, "0") break;
: thiTime.getMinutes().toString(); }
switch (bankInfo.accountType) { let params = {
case 3: amount: (amount * 1).toFixed(2), //充值金额,单位元
if (thiTime.getMinutes() + 20 >= 60) { mobileCode: this.openCardPhonSms, //短信验证码
str = orderNo: this_.RechargeSmsorderNoInfo.orderNo, //第三方合作交易标识,取充值短信返回的orderNo值
thiTime.getHours() + 1 + ":" + (60 - thiTime.getMinutes()); schoolId: bankInfo.schoolId, //学校id
} else { userId: userID, //用户id
str = thiTime.getHours() + ":" + (thiTime.getMinutes() + 20); sessionid: sessionID,
} wechattype: 1,
wx.showModal({ // 21211230渤海银行
title: "充值申请已提交", transAmount: (amount * 1).toFixed(2),
content: "银行处理需要1-20分钟时间,充值结果以余额查询为准。", verifyNo: this.openCardPhonSms,
showCancel: false, };
success: function () { let bindingCardId = "";
uni.navigateTo({ console.log(bankInfo.bindCardNo, 'bindCardNobindCardNobindCardNobindCardNo')
url: `../../recharging/recharging?bankName=${ 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: {
sessionid: sessionID,
},
success: function(res5) {
uni.hideLoading();
if (res5.code == "10000") {
this_.close();
setTimeout(() => {
this_.queryBankInfo();
}, 3000);
let thiTime = new Date();
let str = "";
let accountNo = this_.bankInfo_.bindCardNo;
accountNo = accountNo.slice(accountNo.length - 4, accountNo.length);
let minutes_ =
thiTime.getMinutes().toString().length < 2 ?
thiTime.getMinutes().toString().padStart(2, "0") :
thiTime.getMinutes().toString();
switch (bankInfo.accountType) {
case 3:
if (thiTime.getMinutes() + 20 >= 60) {
str =
thiTime.getHours() + 1 + ":" + (60 - thiTime.getMinutes());
} else {
str = thiTime.getHours() + ":" + (thiTime.getMinutes() + 20);
}
wx.showModal({
title: "充值申请已提交",
content: "银行处理需要1-20分钟时间,充值结果以余额查询为准。",
showCancel: false,
success: function() {
uni.navigateTo({
url: `../../recharging/recharging?bankName=${
this_.bankInfo_.bindCardName this_.bankInfo_.bindCardName
}&bankNumber=${accountNo}&time=${str}&money=${( }&bankNumber=${accountNo}&time=${str}&money=${(
amount * 1 amount * 1
...@@ -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('请稍后');
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") {
...@@ -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,20 +202,38 @@ ...@@ -197,20 +202,38 @@
throw ("银行账号类型错误!") throw ("银行账号类型错误!")
break; break;
} }
let params = {
amount: (this.inputOtherM * 1).toFixed(2), //充值金额,单位元
schoolId: bankInfo.schoolId, //学校id
userId: userID, //用户id
sessionid: sessionID,
wechattype: 1,
// 21211230渤海银行
mobilePhone: this.openCardPhon,
msg: "提现"
}
let params1 = {
mobileNum: this.openCardPhon,
schoolId: bankInfo.schoolId, //学校id
userId: userID, //用户id
sessionid: sessionID,
wechattype: 1
}
$.ajax({ $.ajax({
url: withdrawSmsUrl, url: withdrawSmsUrl,
type: "POST", type: "POST",
contentType: "application/x-www-form-urlencoded", contentType: "application/x-www-form-urlencoded",
data: { // 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
sessionid: sessionID, // sessionid: sessionID,
wechattype: 1, // wechattype: 1,
// 21211230渤海银行 // // 21211230渤海银行
mobilePhone: this.openCardPhon, // mobilePhone: this.openCardPhon,
msg: "提现" // 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 = '';
this.$refs.popup.open('top') if(bankInfo.accountType != 5) {
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,23 +380,42 @@ ...@@ -347,23 +380,42 @@
throw ("银行账号类型错误!") throw ("银行账号类型错误!")
break; break;
} }
$.ajax({ let params = {
url: withdrawUrl, amount: (this.inputOtherM * 1).toFixed(2), //充值金额,单位元
type: "POST", orderNo: this_.RechargeSmsorderNoInfo.orderNo,
contentType: "application/x-www-form-urlencoded", msgCodeSeq: this_.RechargeSmsorderNoInfo.msgCodeSeq,
data: { msgVerCode: this_.openCardPhonSms,
schoolId: bankInfo.schoolId,
userId: userID,
sessionid: sessionID,
wechattype: 1,
// 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), //充值金额,单位元 amount: (this.inputOtherM * 1).toFixed(2), //充值金额,单位元
orderNo: this_.RechargeSmsorderNoInfo.orderNo,
msgCodeSeq: this_.RechargeSmsorderNoInfo.msgCodeSeq,
msgVerCode: this_.openCardPhonSms,
schoolId: bankInfo.schoolId, schoolId: bankInfo.schoolId,
bindingCardId: bindingCardId,
userId: userID, userId: userID,
sessionid: sessionID, sessionid: sessionID,
wechattype: 1, wechattype: 1,
// 21211230渤海银行 };
transAmount: (this.inputOtherM * 1).toFixed(2),
verifyNo: this_.openCardPhonSms, }
}, $.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