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

浦发充值提现新逻辑

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