Commit e19b60d1 authored by 袁玲利's avatar 袁玲利

合dev

parents 5ec4236c c592bf5d
......@@ -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>
......@@ -200,7 +202,7 @@
</view>
<!-- 弹出层 -->
<uni-popup ref="popup" :mask-click="false">
<!-- 充值确认 -->
<!-- 充值,解绑银行卡(浦发银行)确认 -->
<view class="RechargeConfirmationBox">
<view class="RechargeInfo">
<view class="closePhoneBox" @click="close()">
......@@ -226,7 +228,8 @@
<view style="width: 520rpx; height: 1rpx; background: #eeeeee"></view>
<!-- 取消 确认充值按钮 -->
<view class="BtngGoup">
<view class="" @click="ExchangeRecharge"> 充值 </view>
<view class="" @click="unattachedCard" v-if="unbindFlag">去解绑</view>
<view class="" @click="ExchangeRecharge" v-else> 充值 </view>
</view>
</view>
</view>
......@@ -239,15 +242,29 @@
<!-- 切换绑定的一类卡列表 -->
<view class="showBindCardList">
<view class="choiceBox">选择付款账户</view>
<view class="cardsList">
<view class="ListItem" @click="ChangeCardPay(item)" v-for="(item, index) in bindcardList"
:key="index">
<span style="padding-right: 10px">{{ item.bindCardName }}
<view class="cardsList" v-if="typeCode == 'SPDB'">
<view class="ListItem" v-for="(item, index) in bindcardList" :key="index">
<span class="BankListImgSpan" @click="ChangeCardPay(item)">
<image class="BankListImg" src="../../../static/img/choiceBank.png"
v-if="item.bindCardNo == bankInfo_.bindCardNo"></image>
</span>
<span style="padding-right: 10px" @click="ChangeCardPay(item)">{{ item.bindCardName }}
</span>
<span>尾号:{{
item.bindCardNo.slice(item.bindCardNo.length - 4)
}}</span>
<span @click="ChangeCardPay(item)">尾号:{{item.bindCardNo.slice(item.bindCardNo.length - 4)}}</span>
<!-- <image class="BankListImg" src="../../../static/img/choiceBank.png"></image> -->
<van-icon name="delete" class="delete" @click="unattachedCardBefore(item)" />
</view>
</view>
<view class="cardsList" v-else>
<view class="ListItem" v-for="(item, index) in bindcardList" :key="index"
@click="ChangeCardPay(item)">
<span class="BankListImgSpan">
<image class="BankListImg" src="../../../static/img/choiceBank.png"
v-if="item.bindCardNo == bankInfo_.bindCardNo"></image>
</span>
<span style="padding-right: 10px">{{ item.bindCardName }}
</span>
<span>尾号:{{item.bindCardNo.slice(item.bindCardNo.length - 4)}}</span>
</view>
</view>
<view class="changeCard" @click="ChangeBankPay">我要换卡支付</view>
......@@ -283,537 +300,676 @@
</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:") {
gHost = "https://fpdev.xiaopay.net";
// gHost = "/api";
}
let times = 0;
var limitClick = false; //禁止重复点击
var sessionID = "",
userID = "";
var payCardNumber = ""; //一类卡号
var orderSerialNo = ""; //提现结果查询 指令号
var businessNo = "",
otpOrderNo = "",
mobileNo = "";
var MyTimer = null;
var fromType = 0; //0转账 1提现
var opeType = 0; //0充值 1提现 手机号验证
var bankInfo = {
acctNoArray: "",
idNo: "",
schoolId: "",
trueName: "",
userId: "",
sessionid: "",
wechattype: 1,
};
var accountType = "";
let orderApi = window.location.origin;
/**
* 对象转拼接字符串
* @param {*} res Object 需要转换的数据对象
*/
function OforS(res) {
var resL = 0;
var outS = "";
for (var i in res) {
if (resL == 0) {
outS += "" + i + "=" + res[i];
} else {
outS += "&" + i + "=" + res[i];
}
resL++;
}
return outS;
}
export default {
components: {
keyboardPackage,
},
name: "Recharge",
data() {
return {
popshow: false,
// 输入其它金额
isOtherMoney: false,
inputOtherM: "",
RechargeException: false,
depotMoneyother: false, //其他充值
Money: "", //选择金额
MoneyIndex: -1,
RechargeMax: "2000", //最大充值限制
ReflectMoney: "", //提现金额
VerifyCode: "", //验证码
cardBalanceTx: "0", //余额
CodeMsg: "获取验证码",
type: "number",
PersonalInfo: {
schoolname: "",
name: "",
usertype: "1",
},
bankInfo_: {
accountNo: "**** **** **** 1234",
bindCardName: "",
bindCardNo: "",
},
ImgUrl: this.$ImgUrl,
MoneyList: [
{
lable: "",
value: 100,
},
{
lable: "",
value: 200,
},
{
lable: "",
value: 500,
},
{
lable: "",
value: 1000,
},
// {
// lable: "其他金额",
// value: "",
// },
],
numberList: [],
tempFiles1: "../../static/img/idCardBg1.png", //上传身份证临时选择文件
tempFiles2: "../../static/img/idCardBg0.png",
//绑定的一类卡列表
bindcardList: [],
// 20211126 银行账户类型
accountType: "2",
// 银行账户类型名称枚举
accountEnum: {
1: "平安银行III类户",
2: "工商银行III类户",
3: "交通银行III类户",
4: "渤海银行II类户",
},
/**
* 20211129新增
*/
// 充值手机号码
openCardPhon: "",
openCardPhonSms: "",
msCount: 60, //定时器
RechargeSmsorderNoInfo: {}, //第三方合作交易标识
};
},
onLoad: function (options) {
console.log(options);
// 初始化
userID = options["userID"] || "";
sessionID = options["seesionID"] || "";
fromType = options["fromType"] || "";
bankInfo.sessionid = sessionID || "";
this.beforeQuerySignStatus();
},
created: function () {},
mounted: function () {},
onShow: function () {
if (bankInfo.userId) {
this.queryBankInfo();
}
},
methods: {
async beforeQuerySignStatus() {
await this.QueryUserInfo();
// 渤海银行要判断是否有代扣签约
if (bankInfo.accountType == "4") {
await this.signStatusQuery();
}
},
// 更换银行卡
async ChangeBankPay() {
// uni.showModal({
// title: "系统提示",
// content: "功能开发中!"
// })
// return
uni.showLoading({
mask: true,
title: "请稍后....",
});
if (bankInfo.accountType == 4) {
jWeixin.miniProgram.navigateTo({
url: `/pages_subpack/pages/changeBindCard/main`,
});
uni.hideLoading();
return;
}
this.BackToMini("AssignAddCard");
uni.hideLoading();
},
// 验证码弹出框开启
toDeposit() {
console.log(this.isOtherMoney, "isOtherMoney");
if (this.isOtherMoney) {
if (this.inputOtherM == "") {
uni.showModal({
title: "系统提示",
content: "请输入要充值的金额!",
});
return;
}
if (parseFloat(this.inputOtherM) * 1 < 3) {
weui.topTips("充值金额必须大于3元");
return;
}
} else {
if (this.Money == "") {
uni.showModal({
title: "系统提示",
content: "请选择要充值的金额!",
});
return;
}
if (parseFloat(this.inputOtherM) * 1 < 3) {
weui.topTips("充值金额必须大于3元");
return;
}
}
if (MyTimer) {
window.clearInterval(MyTimer); //停止计时器
MyTimer = null;
this.CodeMsg = "获取验证码";
this.msCount = 60;
this.openCardPhonSms = "";
}
this.$refs.popup.open("top");
},
// 验证码弹出框关闭
close() {
this.$refs.popup.close();
},
//切换到提现
ToWalletTx() {
$("#DepositBox").css("display", "none");
$("#TxWalletBox").css("display", "block");
// $('.TitleHeader').html('电子账户提现');
$(".doBtnTx").html("提现");
opeType = 1;
uni.navigateTo({
url:
"../Reflect/Reflect?" +
OforS({
sessionID: sessionID,
userID: userID,
}),
});
},
//全部提现
TxAllFun() {
this.ReflectMoney = this.cardBalanceTx * 1;
// $('.TxClsTx').val($('.cardBalanceTx')[0].textContent * 1);
},
// 输入限制
inputControl(e) {
let this_ = this;
this_.MoneyIndex = -1;
this_.isOtherMoney = true;
let obj = e.detail;
this.$nextTick(function () {
obj.value = obj.value.replace(/[^\d.]/g, ""); //清除"数字"和"."以外的字符
obj.value = obj.value.replace(/^\./g, ""); //验证第一个字符是数字而不是.
obj.value = obj.value.replace(/\.{2,}/g, "."); //只保留第一个. 清除多余的.
obj.value = obj.value
.replace(".", "$#$")
.replace(/\./g, "")
.replace("$#$", "."); //只允许输入一个小数点
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) {
$(".DepositID").attr(
"style",
"background: rgb(230, 230, 230) !important;"
);
} else {
$(".DepositID").removeAttr("style");
}
this_.inputOtherM = obj.value;
});
},
//input键盘弹起不会弹
ReturnToTop() {
// 若最后一位为小数点则去掉
let str = this.inputOtherM + "";
if (str.lastIndexOf(".") == str.length - 1) {
this.inputOtherM = str.substring(0, str.length - 1);
}
this.$nextTick(function () {
document.scrollingElement.scrollTo(0, this.scrollTop);
});
},
//定时器
IntervalFun() {
if (this.msCount == 1) {
window.clearInterval(MyTimer); //停止计时器
MyTimer = null;
this.CodeMsg = "获取验证码";
this.msCount = 60;
} else {
this.msCount--;
this.CodeMsg = this.msCount + "s后获取";
}
},
// 代扣状态查询
async signStatusQuery() {
let loading = Toast.loading({
message: "加载中...",
forbidClick: true,
loadingType: "spinner",
duration: 0,
});
$.ajax({
url: gHost + "/bank-wechat/bohai/comprehensive/signStatusQuery",
type: "POST",
contentType: "application/x-www-form-urlencoded",
data: {
schoolId: bankInfo.schoolId, //学校id
userId: userID, //用户id
sessionid: sessionID,
wechattype: 1
},
headers: {
sessionid: sessionID,
},
success: function (respes) {
loading.clear();
if (respes.code == "10000") {
console.log(respes, "respes");
if (respes.results.dkstatus != 1) {
// 1已签约
Dialog.alert({
title: "使用说明",
message:
"您暂未进行银行代扣签约,将影响电子校园卡的正常使用,请尽快前往签约",
theme: "round-button",
confirmButtonText: "前往签约",
confirmButtonColor: "#2ddbb6",
className: "signAlert",
})
.then(() => {
// on confirm
jWeixin.miniProgram.navigateTo({
url: `/pages/SignProxyPay/main`,
});
})
.catch(() => {
// on cancel
});
}
} else {
Toast(respes.message || "代扣状态查询,请重试!");
throw new Error("代扣状态查询,请重试!");
}
},
error: function (err) {
loading.clear();
Toast(err || "代扣状态查询,请重试!");
throw new Error("代扣状态查询,请重试!");
},
});
},
// 充值验证获取验证码
async SendSms() {
if (MyTimer) {
return;
}
if (!this.openCardPhon || this.openCardPhon.length !== 11) {
Dialog({
title: "系统提示",
message: "请收入正确的手机号码!",
});
return;
}
let this_ = this;
let loading = Toast.loading({
message: "加载中...",
forbidClick: true,
loadingType: "spinner",
duration: 0,
});
// 20211230
let exchangeUrl = gHost;
switch (bankInfo.accountType) {
case 3:
exchangeUrl = exchangeUrl + "/bank-wechat/bocom/exchange/rechargeSms";
break;
case 4:
exchangeUrl = exchangeUrl + "/bank-wechat/bohai/comprehensive/otpSms";
break;
default:
Dialog({
title: "系统提示",
message: "银行账号类型错误!",
});
throw "银行账号类型错误!";
break;
}
$.ajax({
url: exchangeUrl,
type: "POST",
contentType: "application/x-www-form-urlencoded",
data: {
amount: ((this.Money || this.inputOtherM) * 1).toFixed(2), //充值金额,单位元
schoolId: bankInfo.schoolId, //学校id
userId: userID, //用户id
sessionid: sessionID,
wechattype: 1,
// 20211230渤海
mobilePhone: this.openCardPhon,
msg: "充值",
},
headers: {
sessionid: sessionID,
},
success: function (res5) {
loading.clear();
if (res5.code == "10000") {
this_.IntervalFun();
MyTimer = window.setInterval(this_.IntervalFun, 1000);
this_.RechargeSmsorderNoInfo = res5.results ? res5.results : {};
} else {
weui.topTips(res5.message);
uni.showModal({
title: "系统提示",
content: res5.message,
});
}
},
error: function (err) {
loading.clear();
},
});
},
// 充值
async ExchangeRecharge() {
let amount, bindMedium, summary;
if (this.isOtherMoney) {
if (this.inputOtherM == "") {
uni.showModal({
title: "系统提示",
content: "请输入要充值的金额!",
});
return;
}
amount = this.inputOtherM * 1;
} else {
if (this.Money == "") {
uni.showModal({
title: "系统提示",
content: "请选择要充值的金额!",
});
return;
}
amount = this.Money * 1;
}
let this_ = this;
if (!this.openCardPhon || this.openCardPhon.length !== 11) {
Dialog({
title: "系统提示",
message: "请收入正确的手机号码!",
});
return;
}
if (bankInfo.accountType != 4) {
if (!this.RechargeSmsorderNoInfo.orderNo) {
Dialog({
title: "系统提示",
message: "请获取验证码!",
});
return;
}
}
if (!this.openCardPhonSms) {
Dialog({
title: "系统提示",
message: "请收入验证码!",
});
return;
}
uni.showLoading({
mask: true,
title: "处理中......",
});
// 20211230
let exchangeUrl = gHost;
switch (bankInfo.accountType) {
case 3:
exchangeUrl = exchangeUrl + "/bank-wechat/bocom/exchange/recharge";
break;
case 4:
exchangeUrl = exchangeUrl + "/bank-wechat/bohai/exchange/recharge";
break;
default:
Dialog({
title: "系统提示",
message: "银行账号类型错误!",
});
throw "银行账号类型错误!";
break;
}
$.ajax({
url: exchangeUrl,
type: "POST",
contentType: "application/x-www-form-urlencoded",
data: {
amount: (amount * 1).toFixed(2), //充值金额,单位元
mobileCode: this.openCardPhonSms, //短信验证码
orderNo: this_.RechargeSmsorderNoInfo.orderNo, //第三方合作交易标识,取充值短信返回的orderNo值
schoolId: bankInfo.schoolId, //学校id
userId: userID, //用户id
sessionid: sessionID,
wechattype: 1,
// 21211230渤海银行
transAmount: (amount * 1).toFixed(2),
verifyNo: this.openCardPhonSms,
},
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=${
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 = "",
userID = "";
var payCardNumber = ""; //一类卡号
var orderSerialNo = ""; //提现结果查询 指令号
var businessNo = "",
otpOrderNo = "",
mobileNo = "";
var MyTimer = null;
var fromType = 0; //0转账 1提现
var opeType = 0; //0充值 1提现 手机号验证
var bankInfo = {
acctNoArray: "",
idNo: "",
schoolId: "",
trueName: "",
userId: "",
sessionid: "",
wechattype: 1,
};
var accountType = "";
let orderApi = window.location.origin;
/**
* 对象转拼接字符串
* @param {*} res Object 需要转换的数据对象
*/
function OforS(res) {
var resL = 0;
var outS = "";
for (var i in res) {
if (resL == 0) {
outS += "" + i + "=" + res[i];
} else {
outS += "&" + i + "=" + res[i];
}
resL++;
}
return outS;
}
export default {
components: {
keyboardPackage,
},
name: "Recharge",
data() {
return {
showPopover: false,
// 通过 actions 属性来定义菜单选项
actions: [{
text: "复制卡号",
id: "cardNumright"
}, {
text: "账户明细"
}, {
text: "常见问题"
}, {
text: "在线销户"
}],
popshow: false,
// 输入其它金额
isOtherMoney: false,
inputOtherM: "",
RechargeException: false,
depotMoneyother: false, //其他充值
Money: "", //选择金额
MoneyIndex: -1,
RechargeMax: "2000", //最大充值限制
ReflectMoney: "", //提现金额
VerifyCode: "", //验证码
cardBalanceTx: "0", //余额
CodeMsg: "获取验证码",
type: "number",
PersonalInfo: {
schoolname: "",
name: "",
usertype: "1",
},
bankInfo_: {
accountNo: "**** **** **** 1234",
bindCardName: "",
bindCardNo: "",
},
ImgUrl: this.$ImgUrl,
MoneyList: [{
lable: "",
value: 100,
},
{
lable: "",
value: 200,
},
{
lable: "",
value: 500,
},
{
lable: "",
value: 1000,
},
// {
// lable: "其他金额",
// value: "",
// },
],
numberList: [],
tempFiles1: "../../static/img/idCardBg1.png", //上传身份证临时选择文件
tempFiles2: "../../static/img/idCardBg0.png",
//绑定的一类卡列表
bindcardList: [],
// 20211126 银行账户类型
accountType: "2",
// 银行账户类型名称枚举
accountEnum: {
1: "平安银行III类户",
2: "工商银行III类户",
3: "交通银行III类户",
4: "渤海银行II类户",
5: "浦发银行III类户",
},
/**
* 20211129新增
*/
// 充值手机号码
openCardPhon: "",
openCardPhonSms: "",
msCount: 60, //定时器
RechargeSmsorderNoInfo: {}, //第三方合作交易标识
typeCode: "",
unbindFlag: false, // 解绑标志
unattachedCardItem: {}
};
},
onLoad: function(options) {
console.log(options);
// 初始化
userID = options["userID"] || "";
sessionID = options["seesionID"] || "";
fromType = options["fromType"] || "";
bankInfo.sessionid = sessionID || "";
this.beforeQuerySignStatus();
},
created: function() {},
mounted: function() {},
onShow: function() {
if (bankInfo.userId) {
this.queryBankInfo();
}
},
methods: {
onSelect(action) {
if (action.text == "复制卡号") {
this.CopyCardNumber();
} else if (action.text == "账户明细") {
this.BackToMini("purchaseDetail");
} else if (action.text == "常见问题") {
uni.navigateTo({
url: `../../commonProblem/commonProblem`,
});
} else if (action.text == "在线销户") {
jWeixin.miniProgram.redirectTo({
url: `/pages/AssignCancelUserPhone/main`
});
}
},
async beforeQuerySignStatus() {
await this.QueryUserInfo();
// 渤海银行要判断是否有代扣签约
if (bankInfo.accountType == "4") {
await this.signStatusQuery();
}
},
// 解绑银行卡提示 浦发银行
unattachedCardBefore(item) {
this.unattachedCardItem = item;
console.log(item, 'itemm')
// this.$refs.popup.open("top");
const self = this;
let bankno = item.bindCardNo.slice(item.bindCardNo.length - 4);
Dialog.confirm({
title: "提示",
message: `确定解绑${item.bindCardName}${bankno}吗?`,
confirmButtonText: "去解绑",
cancelButtonText: "取消",
})
.then(() => {
self.popshow = false;
self.$refs.popup.open("top");
self.unbindFlag = true;
})
.catch(() => {
// on cancel
});
},
// 解绑银行卡
unattachedCard() {
const self = this;
let loading = Toast.loading({
message: "解绑中...",
forbidClick: true,
loadingType: "spinner",
duration: 0,
});
$.ajax({
url: gHost + "/bank-wechat/spdb/unattachedCard",
type: "POST",
contentType: "application/x-www-form-urlencoded",
data: {
schoolId: bankInfo.schoolId, //学校id
userId: userID, //用户id
sessionid: sessionID,
wechattype: 1,
cardNum: this.unattachedCardItem.bindCardNo,
mobileNum: this.unattachedCardItem.mobileNo,
randomPassword: this.openCardPhonSms, //短信验证码
},
headers: {
sessionid: sessionID,
},
success: function(respes) {
loading.clear();
if (respes.code == "10000") {
console.log(respes, "respes");
Toast('解绑成功');
self.$refs.popup.close();
} else {
Toast(respes.message || "解绑银行卡失败,请重试!");
throw new Error("解绑银行卡失败,请重试!");
}
},
error: function(err) {
loading.clear();
Toast(err || "解绑银行卡失败,请重试!");
throw new Error("解绑银行卡失败,请重试!");
},
});
},
// 更换银行卡
async ChangeBankPay() {
// uni.showModal({
// title: "系统提示",
// content: "功能开发中!"
// })
// return
uni.showLoading({
mask: true,
title: "请稍后....",
});
if (bankInfo.accountType == 4 || bankInfo.accountType == 5) {
jWeixin.miniProgram.navigateTo({
url: `/pages_subpack/pages/changeBindCard/main`,
});
uni.hideLoading();
return;
}
this.BackToMini("AssignAddCard");
uni.hideLoading();
},
// 验证码弹出框开启
toDeposit() {
console.log(this.isOtherMoney, "isOtherMoney");
if (this.isOtherMoney) {
if (this.inputOtherM == "") {
uni.showModal({
title: "系统提示",
content: "请输入要充值的金额!",
});
return;
}
if (parseFloat(this.inputOtherM) * 1 < 3) {
weui.topTips("充值金额必须大于3元");
return;
}
} else {
if (this.Money == "") {
uni.showModal({
title: "系统提示",
content: "请选择要充值的金额!",
});
return;
}
if (parseFloat(this.inputOtherM) * 1 < 3) {
weui.topTips("充值金额必须大于3元");
return;
}
}
if (MyTimer) {
window.clearInterval(MyTimer); //停止计时器
MyTimer = null;
this.CodeMsg = "获取验证码";
this.msCount = 60;
this.openCardPhonSms = "";
}
if (bankInfo.typeCode != 'SPDB') {
this.$refs.popup.open("top");
} else {
this.ExchangeRecharge();
}
},
// 验证码弹出框关闭
close() {
this.$refs.popup.close();
},
//切换到提现
ToWalletTx() {
$("#DepositBox").css("display", "none");
$("#TxWalletBox").css("display", "block");
// $('.TitleHeader').html('电子账户提现');
$(".doBtnTx").html("提现");
opeType = 1;
uni.navigateTo({
url: "../Reflect/Reflect?" +
OforS({
sessionID: sessionID,
userID: userID,
}),
});
},
//全部提现
TxAllFun() {
this.ReflectMoney = this.cardBalanceTx * 1;
// $('.TxClsTx').val($('.cardBalanceTx')[0].textContent * 1);
},
// 输入限制
inputControl(e) {
let this_ = this;
this_.MoneyIndex = -1;
this_.isOtherMoney = true;
let obj = e.detail;
this.$nextTick(function() {
obj.value = obj.value.replace(/[^\d.]/g, ""); //清除"数字"和"."以外的字符
obj.value = obj.value.replace(/^\./g, ""); //验证第一个字符是数字而不是.
obj.value = obj.value.replace(/\.{2,}/g, "."); //只保留第一个. 清除多余的.
obj.value = obj.value
.replace(".", "$#$")
.replace(/\./g, "")
.replace("$#$", "."); //只允许输入一个小数点
obj.value = obj.value.replace(/^(\-)*(\d+)\.(\d\d).*$/, "$1$2.$3"); //只能输入两个小数
obj.value =
obj.value * 1 > this_.RechargeMax ? this_.RechargeMax : obj.value;
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;"
);
} else {
$(".DepositID").removeAttr("style");
}
this_.inputOtherM = obj.value;
});
},
//input键盘弹起不会弹
ReturnToTop() {
// 若最后一位为小数点则去掉
let str = this.inputOtherM + "";
if (str.lastIndexOf(".") == str.length - 1) {
this.inputOtherM = str.substring(0, str.length - 1);
}
this.$nextTick(function() {
document.scrollingElement.scrollTo(0, this.scrollTop);
});
},
//定时器
IntervalFun() {
if (this.msCount == 1) {
window.clearInterval(MyTimer); //停止计时器
MyTimer = null;
this.CodeMsg = "获取验证码";
this.msCount = 60;
} else {
this.msCount--;
this.CodeMsg = this.msCount + "s后获取";
}
},
// 代扣状态查询
async signStatusQuery() {
let loading = Toast.loading({
message: "加载中...",
forbidClick: true,
loadingType: "spinner",
duration: 0,
});
$.ajax({
url: gHost + "/bank-wechat/bohai/comprehensive/signStatusQuery",
type: "POST",
contentType: "application/x-www-form-urlencoded",
data: {
schoolId: bankInfo.schoolId, //学校id
userId: userID, //用户id
sessionid: sessionID,
wechattype: 1
},
headers: {
sessionid: sessionID,
},
success: function(respes) {
loading.clear();
if (respes.code == "10000") {
console.log(respes, "respes");
if (respes.results.dkstatus != 1) {
// 1已签约
Dialog.alert({
title: "使用说明",
message: "您暂未进行银行代扣签约,将影响电子校园卡的正常使用,请尽快前往签约",
theme: "round-button",
confirmButtonText: "前往签约",
confirmButtonColor: "#2ddbb6",
className: "signAlert",
})
.then(() => {
// on confirm
jWeixin.miniProgram.navigateTo({
url: `/pages/SignProxyPay/main`,
});
})
.catch(() => {
// on cancel
});
}
} else {
Toast(respes.message || "代扣状态查询,请重试!");
throw new Error("代扣状态查询,请重试!");
}
},
error: function(err) {
loading.clear();
Toast(err || "代扣状态查询,请重试!");
throw new Error("代扣状态查询,请重试!");
},
});
},
// 充值验证获取验证码
async SendSms() {
if (MyTimer) {
return;
}
if (!this.openCardPhon || this.openCardPhon.length !== 11) {
Dialog({
title: "系统提示",
message: "请收入正确的手机号码!",
});
return;
}
let this_ = this;
let loading = Toast.loading({
message: "加载中...",
forbidClick: true,
loadingType: "spinner",
duration: 0,
});
// 20211230
let exchangeUrl = gHost;
switch (bankInfo.accountType) {
case 3:
exchangeUrl = exchangeUrl + "/bank-wechat/bocom/exchange/rechargeSms";
break;
case 4:
exchangeUrl = exchangeUrl + "/bank-wechat/bohai/comprehensive/otpSms";
break;
case 5:
exchangeUrl = exchangeUrl + "/bank-wechat/spdb/passcodes";
break;
default:
Dialog({
title: "系统提示",
message: "银行账号类型错误!",
});
throw "银行账号类型错误!";
break;
}
let params = {
amount: ((this.Money || this.inputOtherM) * 1).toFixed(2), //充值金额,单位元
schoolId: bankInfo.schoolId, //学校id
userId: userID, //用户id
sessionid: sessionID,
wechattype: 1,
// 20211230渤海
mobilePhone: this.openCardPhon,
msg: "充值",
}
let params1 = {
bizScene: '105322',
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) {
loading.clear();
if (res5.code == "10000") {
this_.IntervalFun();
MyTimer = window.setInterval(this_.IntervalFun, 1000);
this_.RechargeSmsorderNoInfo = res5.results ? res5.results : {};
} else {
weui.topTips(res5.message);
uni.showModal({
title: "系统提示",
content: res5.message,
});
}
},
error: function(err) {
loading.clear();
},
});
},
// 充值
async ExchangeRecharge() {
let amount, bindMedium, summary;
if (this.isOtherMoney) {
if (this.inputOtherM == "") {
uni.showModal({
title: "系统提示",
content: "请输入要充值的金额!",
});
return;
}
amount = this.inputOtherM * 1;
} else {
if (this.Money == "") {
uni.showModal({
title: "系统提示",
content: "请选择要充值的金额!",
});
return;
}
amount = this.Money * 1;
}
let this_ = this;
if (!this.openCardPhon || this.openCardPhon.length !== 11) {
Dialog({
title: "系统提示",
message: "请收入正确的手机号码!",
});
return;
}
if (bankInfo.accountType != 4 && bankInfo.accountType != 5) {
if (!this.RechargeSmsorderNoInfo.orderNo) {
Dialog({
title: "系统提示",
message: "请获取验证码!",
});
return;
}
}
if (!this.openCardPhonSms && bankInfo.accountType != 5) {
Dialog({
title: "系统提示",
message: "请收入验证码!",
});
return;
}
uni.showLoading({
mask: true,
title: "处理中......",
});
// 20211230
let exchangeUrl = gHost;
switch (bankInfo.accountType) {
case 3:
exchangeUrl = exchangeUrl + "/bank-wechat/bocom/exchange/recharge";
break;
case 4:
exchangeUrl = exchangeUrl + "/bank-wechat/bohai/exchange/recharge";
break;
case 5:
exchangeUrl = exchangeUrl + "/bank-wechat/spdb/deposits";
break;
default:
Dialog({
title: "系统提示",
message: "银行账号类型错误!",
});
throw "银行账号类型错误!";
break;
}
let params = {
amount: (amount * 1).toFixed(2), //充值金额,单位元
mobileCode: this.openCardPhonSms, //短信验证码
orderNo: this_.RechargeSmsorderNoInfo.orderNo, //第三方合作交易标识,取充值短信返回的orderNo值
schoolId: bankInfo.schoolId, //学校id
userId: userID, //用户id
sessionid: sessionID,
wechattype: 1,
// 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) {
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
}&bankNumber=${accountNo}&time=${str}&money=${(
amount * 1
......@@ -999,6 +1155,10 @@ export default {
},
//查询一类卡绑定列表
queryBindCardList() {
this.queryBindCardListBefore();
this.popshow = true;
},
queryBindCardListBefore() {
let this_ = this;
let loading = weui.loading("请稍后");
$.ajax({
......@@ -1016,7 +1176,6 @@ export default {
loading.hide();
if (res4.code == "10000") {
this_.bindcardList = res4.results;
this_.popshow = true;
} else {
weui.topTips(res4.message);
}
......@@ -1030,6 +1189,9 @@ export default {
queryBankInfo() {
let this_ = this;
let queryBankInfoUrl = gHost;
if (bankInfo.accountType == 5) {
this.queryBindCardListBefore();
}
// 20211230
switch (bankInfo.accountType) {
case 3:
......@@ -1041,6 +1203,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 +1216,24 @@ export default {
break;
}
// 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({
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") {
......@@ -1133,6 +1305,7 @@ export default {
return;
}
bankInfo = res2.results;
this_.typeCode = res2.results.typeCode;
bankInfo.sessionid = sessionID;
this_.queryBankInfo(); //查余额
this_.bankInfo_ = bankInfo;
......@@ -1205,6 +1378,33 @@ export default {
background: linear-gradient(180deg, #ffffff 0%, #fafafa 100%);
}
.BankListImgSpan {
width: 30rpx;
height: 30rpx;
position: relative;
margin-right: 20rpx;
display: inline-block;
}
.delete {
position: absolute;
top: 0;
right: 120rpx;
font-size: 38rpx;
color: #04b871;
padding: 25rpx 0;
padding-top: 28rpx;
z-index: 1;
}
.BankListImg {
width: 30rpx;
height: 30rpx;
position: absolute;
left: 0;
top: 0;
}
.userInfoBox {
display: flex;
flex-direction: column;
......@@ -1397,6 +1597,13 @@ export default {
background: #fff;
position: relative;
text-align: center;
display: flex;
justify-content: center;
span {
display: inline-block;
align-self: center;
}
}
.changeCard {
......@@ -1563,6 +1770,7 @@ export default {
font-family: PingFangSC-Medium, PingFang SC;
margin-bottom: 24rpx;
border: 3rpx solid transparent;
view {
align-self: center;
color: #333333;
......@@ -1598,6 +1806,7 @@ export default {
background: #f8f8f8;
border-radius: 12rpx;
border: 3rpx solid transparent;
/deep/.uni-input-wrapper {
position: absolute;
width: 444rpx;
......@@ -2199,6 +2408,7 @@ export default {
line-height: 120rpx;
font-weight: 600;
}
.popoverItem {
width: 225rpx;
margin: 0 20rpx;
......@@ -2210,6 +2420,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,20 +202,38 @@
throw ("银行账号类型错误!")
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({
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: {
// 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 = '';
this.$refs.popup.open('top')
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,23 +380,42 @@
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,
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), //充值金额,单位元
orderNo: this_.RechargeSmsorderNoInfo.orderNo,
msgCodeSeq: this_.RechargeSmsorderNoInfo.msgCodeSeq,
msgVerCode: this_.openCardPhonSms,
schoolId: bankInfo.schoolId,
bindingCardId: bindingCardId,
userId: userID,
sessionid: sessionID,
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: {
'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