Commit 839558f1 authored by 符伟's avatar 符伟

修复 Reacarge页面冲突

parent 531a2658
This source diff could not be displayed because it is too large. You can view the blob instead.
<template> <template>
<view class="container"> <view class="container">
<div class="title">校智付服务协议444</div> <div class="title">校智付服务协议</div>
感谢您选择校智付服务。 感谢您选择校智付服务。
<div class="paragraph"> <div class="paragraph">
<div class="t bold">第一条 总则</div> <div class="t bold">第一条 总则</div>
......
...@@ -283,563 +283,6 @@ ...@@ -283,563 +283,6 @@
</template> </template>
<script> <script>
<<<<<<< Updated upstream
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: "常见问题",
},
],
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: {
onSelect(action) {
if (action.text == "复制卡号") {
this.CopyCardNumber();
} else if (action.text == "账户明细") {
this.BackToMini("purchaseDetail");
} else if (action.text == "常见问题") {
uni.navigateTo({
url: `../../commonProblem/commonProblem`,
});
}
},
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 { Dialog, Toast } from "vant";
import keyboardPackage from "@/components/keyboard-package/keyboard-package.vue"; import keyboardPackage from "@/components/keyboard-package/keyboard-package.vue";
import cityData from "@/common/js/city.js"; import cityData from "@/common/js/city.js";
...@@ -1371,7 +814,6 @@ export default { ...@@ -1371,7 +814,6 @@ export default {
success: function () { success: function () {
uni.navigateTo({ uni.navigateTo({
url: `../../recharging/recharging?bankName=${ url: `../../recharging/recharging?bankName=${
>>>>>>> Stashed changes
this_.bankInfo_.bindCardName this_.bankInfo_.bindCardName
}&bankNumber=${accountNo}&time=${str}&money=${( }&bankNumber=${accountNo}&time=${str}&money=${(
amount * 1 amount * 1
......
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