Commit 699e94ab authored by 5359's avatar 5359

dev测试环境跳转接口调整

parent a83808cb
<template>
<h-view class="public-style personalRegister" title="银联电子签约">
<h-content>
<list-item class="personalInf" style="padding:20px;height:100%">
<div style="height:40px;border-bottom:1px solid #d0d0d0">
<div
class="personalInf-text"
style=" width: 150px;line-height: 30px;text-align: center;
border-radius: 5px;
background-color: #ddd;font-size:16px;font-weight:700;color:#11111187"
>签约信息
</div>
</div>
<item style="border-bottom:1px solid #d0d0d0;font-size:14px">
<section slot="name" style="font-size:14px">
<img
src="../../../assets/userRegister/bankIcon@2x.png"
style="float:left;width:20px;height:20px;margin: 2px 5px 0 0;"
/>银行卡号:
</section>
<input
slot="content"
v-model="bankCardNumber"
style="text-align: left;font-size:14px"
placeholder="请输入银行卡号"
/>
</item>
<item style="border-bottom:1px solid #d0d0d0">
<section slot="name" style="font-size:14px">
<img
src="../../../assets/userRegister/people-name.png"
style="float:left;width:20px;height:20px;margin: 2px 5px 0 0;"
/>账户名称:
</section>
<input
slot="content"
v-model="bankAccName"
style="text-align: left;font-size:14px"
placeholder="请输入账户名称"
/>
</item>
<item style="border-bottom:1px solid #d0d0d0">
<section slot="name" style="font-size:14px">
<img
src="../../../assets/userRegister/idCard.png"
style="float:left;width:20px;height:20px;margin: 2px 5px 0 0;"
/>证件号码:
</section>
<input
slot="content"
v-model="certNo"
style="text-align: left;font-size:14px"
placeholder="请输入证件号码"
@blur="goTop()"
/>
</item>
<item style="border-bottom:1px solid #d0d0d0">
<section slot="name" style="font-size:14px">
<img
src="../../../assets/userRegister/phone.png"
style="float:left;width:20px;height:20px;margin: 2px 5px 0 0;"
/>预留手机:
</section>
<input
slot="content"
v-model="phoneNumber"
style="text-align: left;font-size:14px"
placeholder="请输入电话号码"
@blur="goTop()"
/>
</item>
<item style="border-bottom:1px solid #d0d0d0">
<section slot="name" style="font-size:14px">
<img
src="../../../assets/userRegister/indentifyCode.png"
style="float:left;width:20px;height:20px;margin: 2px 5px 0 0;"
/>验证码:
</section>
<input
slot="content"
v-model="authCode"
style="text-align: left;font-size:14px;margin-left: 0.13rem"
placeholder="请输入验证码"
@blur="goTop()"
/>
<div>
<button v-if="!showTimer"
@click="getSignCode()"
style="width:1.7rem;height:30px;border-radius:15px;background-color:#09bb07;color:#FFFFFF;margin:8px 0 0 -60px;position:relative;left:30%"
>
<div style="font-size: 11px">获取验证码</div>
</button>
<button v-if="showTimer"
style="width:1.7rem;height:30px;border-radius:15px;background-color:#888c8f;color:#FFFFFF;margin:8px 0 0 -60px;position:relative;left:30%">
<div style="font-size: 11px">{{ timerCount }}{{ text }}</div>
</button>
</div>
</item>
<div>
<div style="width:50%;float: left;">
<div style="margin: 40px 0 0 14px;color:#333333;font-size:14px">
<div>请上传银行卡照片</div>
</div>
<div style="height:100px;margin-top:30px">
<div
style="border:1px solid #b2b2b2;width:70%;height:100%;margin:0 auto;border-radius:5px;position:relative;"
>
<img :src="cardUp" alt class="pic" @click="addCardImage(0)"/>
</div>
</div>
<p style="margin-top:10px;text-align:center;font-size:14px">
银行卡正面
</p>
</div>
<div style="width:50%;float: left;">
<div style="margin: 40px 0 0 14px;color:#333333;font-size:14px">
<p>请上传身份证照片</p>
</div>
<div style="height:100px;margin-top:30px">
<div
style="border:1px solid #b2b2b2;width:70%;height:100%;margin:0 auto;border-radius:5px;position:relative;"
>
<img :src="cardUp1" alt class="pic" @click="addCardImage(1)"/>
</div>
</div>
<p style="margin-top:10px;text-align:center;font-size:14px">
身份证正面
</p>
</div>
</div>
<button
@click="next_step()"
style="width:120px;height:30px;border-radius:15px;background-color:#09bb07;color:#FFFFFF;margin:70px 0 0 -60px;position:relative;left:50%;"
>签约
</button>
<p/>
</list-item>
</h-content>
</h-view>
</template>
<script>
import {getUrlParam} from "@/scripts/utils";
export default {
data() {
return {
cardUp: require("../../../assets/userRegister/camear.png"), //身份证正面url
bankCardNumber: "",
bankAccName: "",
certNo: "",
phoneNumber: "",
authCode: "",
phoneNumberFlag: false,
showTimer: false,
timerCount: 60,
timer: 60000,
captchaKey: "",
signId: "",
signStatus: 0,
text: '秒后失效',
cardUp1: require("../../../assets/userRegister/camear.png"), //身份证正面url
preview_url: "", //图片预览地址
attchmentId: "", //附件预览id
attchmentId1: "" //附件预览id
};
},
components: {},
activated: function () {
// this.getUserInfo();
},
updated: function () {
},
methods: {
// 调用微信接口的基础配置
wxConfig() {
let clientUrl = "";
let u = navigator.userAgent;
let isAndroid = u.indexOf("Android") > -1 || u.indexOf("Linux") > -1; //g
let isIOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
if (isAndroid) {
//这个是安卓操作系统
console.log("机型:android");
clientUrl = location.href;
}
if (isIOS) {
//这个是ios操作系统
console.log("机型:ios");
clientUrl = location.href.split("#")[0];
}
// let clientUrl = encodeURIComponent(location.href)
// let url = $config.rootPath + '/js/sdk/getWxConfig?wxCode=' + $config.wxCode + '&clientUrl=' + clientUrl
let url = process.env.basePathRl + "getSignature";
let param = {
apiKey: "handexinxi",
url: clientUrl
};
hlsHttp.post(url, param).then(function (res) {
wx.config({
beta: true,
debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
appId: res.result.appId, // 必填,公众号的唯一标识
timestamp: res.result.timestamp, // 必填,生成签名的时间戳
nonceStr: res.result.nonceStr, // 必填,生成签名的随机串
signature: res.result.signature, // 必填,签名,见附录1
jsApiList: [
"chooseImage",
"previewImage",
"downloadImage",
"getLocalImgData",
"uploadImage",
"hideOptionMenu"
] // 必填,需要使用的JS接口列表,所有JS接口列表见附录2
});
wx.ready(function () {
wx.hideOptionMenu();
});
});
},
addCardImage: function (cardType) {
let self = this;
// if(!self.cardUp){
wx.chooseImage({
count: 1, //张数, 默认9
sizeType: ["compressed"], //建议压缩图
sourceType: ["album", "camera"], // 来源是相册、相机
success: function (res) {
if (cardType == 0) {
self.cardUp = res.localIds[0];
} else {
self.cardUp1 = res.localIds[0];
}
self.uploadToWeixinServer(res.localIds[0], cardType);
}
});
// }else{
// if(self.attchmentId){
// this.previewImage();
// }
// }
},
//预览图片
previewImage() {
hlsPopup.showBigPicture({
imgUrl: vm.cardUp,
imgUrl1: vm.cardUp1
});
},
uploadToWeixinServer(localId, cardType) {
let self = this;
wx.uploadImage({
localId: localId,
isShowProgressTips: 1, // 默认为1,显示进度提示
success: function (res) {
//res.serverId 返回图片的微信服务器端ID
console.log("上传图片后返回的信息", res);
self.serverId = res.serverId;
self.uploadToserver(res.serverId, cardType);
}
});
},
uploadToserver(serverId, cardType) {
let vm = this;
let url = process.env.rootPath + "/auth/upload/image/hls/from/wx";
let sourceType = "";
if (cardType == 0) {
sourceType = "app_file_id_bank";
} else {
sourceType = "app_file_id_card";
}
let param = {
openId: window.localStorage.openId,
mediaId: serverId,
sourceType: sourceType,
fileName: new Date().getTime() + ".jpg"
};
vm.hlsPopup.showLoading("请稍等");
vm.$post(url, param).then(function (res) {
vm.hlsPopup.hideLoading();
vm.attchmentId = res["attchmentId"];
if (cardType == 0) {
vm.bankCardNumber = res["bank_card_number"];
vm.cardUp =
process.env.rootPath +
"/app/fileViewSvc?attachment_id=" +
vm.attchmentId +
"&apiName=download&sysName=HCL_UPLOAD_FILE&access_token=" +
window.localStorage.access_token_rl;
} else {
vm.bankAccName = res["姓名"];
vm.certNo = res["公民身份号码"];
vm.cardUp1 =
process.env.rootPath +
"/app/fileViewSvc?attachment_id=" +
vm.attchmentId +
"&apiName=download&sysName=HCL_UPLOAD_FILE&access_token=" +
window.localStorage.access_token_rl;
}
});
},
// 下一步
next_step() {
let vm = this;
if (
!vm.bankCardNumber ||
!vm.bankAccName ||
!vm.phoneNumber ||
!vm.certNo ||
!vm.authCode
) {
vm.hlsPopup.showLongCenter("必输字端不能为空!");
return;
} else if (vm.hlsUtil.isCardID(vm.certNo)) {
vm.hlsPopup.showLongCenter("身份证号有误");
return;
} else if (!vm.hlsUtil.phoneNumber(vm.phoneNumber)) {
vm.hlsPopup.showLongCenter("手机号码有误!");
return;
} else {
// alert("验证通过");
let url = process.env.rootPath + "/china/pay/send/sign";
let param = {
signId: vm.signId,
auth_code: vm.authCode
};
vm.hlsPopup.showLoading("请稍等");
vm.$post(url, param).then(function (res) {
vm.hlsPopup.hideLoading();
if (res.respCode == "0000") {
vm.hlsPopup.showSuccess(res.respMsg)
} else {
vm.hlsPopup.showLongCenter(res.respMsg)
}
});
}
},
// 键盘消失,页面回到顶部
goTop() {
setTimeout(function () {
var scrollHeight =
document.documentElement.scrollTop || document.body.scrollTop || 0;
console.log(scrollHeight);
window.scrollTo(0, Math.max(scrollHeight, 0));
}, 100);
},
// 获取验证码
getSignCode() {
let vm = this
if (!vm.bankCardNumber) {
vm.hlsPopup.showLongCenter('请输入银行卡号!')
return
}
if (!vm.bankAccName) {
vm.hlsPopup.showLongCenter('请输入账户名称!')
return
}
if (!vm.certNo) {
vm.hlsPopup.showLongCenter('请输入证件号码!')
return
}
if (!vm.phoneNumber) {
vm.hlsPopup.showLongCenter('请输入手机号!')
return
}
if (!vm.showTimer) {
if (
hlsUtil.phoneNumber(vm.phoneNumber) ||
hlsUtil.phoneNumber86(vm.phoneNumber)
) {
vm.phoneNumberFlag = true
vm.getVerifiedCode()
} else {
hlsPopup.showLongCenter('手机号不存在,请重新输入!')
vm.phoneNumber = ''
}
}
},
// 前端生成验证码发送请求到后端进行判断
getVerifiedCode() {
let vm = this
let url = process.env.rootPath + '/china/pay/send/sign/message'
let param = {
card_no: vm.bankCardNumber,
acc_name: vm.bankAccName,
cert_no: vm.certNo,
mobile_no: vm.phoneNumber
}
vm.hlsPopup.showLoading('请稍候')
vm.hlsHttp.post(url, param).then(function (res) {
vm.signId = "";
vm.signStatus = 0;
vm.hlsPopup.hideLoading()
if (res.respCode === '0000') {
vm.signId = res.signId;
vm.signStatus = 1;
vm.hlsPopup.showSuccess('验证码已发送')
vm.showTimer = true
vm.text = '秒后失效'
let counter = setInterval(function () {
if (vm.timerCount > 0) {
vm.timerCount = vm.timerCount - 1
}
}, 1000)
setTimeout(function () {
vm.text = '获取验证码'
vm.showTimer = false
clearInterval(counter)
vm.showTimer = false
vm.timerCount = vm.timer / 1000
}, vm.timer)
} else {
vm.hlsPopup.showLongCenter('验证码发送失败!' + res.respMsg)
}
})
},
},
created() {
this.wxConfig();
// wx.hideOptionMenu();
// var data = this.$route.params.userInfo;
//this.getUserInfo();
}
};
</script>
<style lang="less" type="text/less" scoped>
@import "../../../styles/vue-1px.less";
.personalRegister {
font-size: 12px !important;
.personalInfo {
width: 100%;
height: 100% !important;
}
.uppic {
height: 100%;
width: 100%;
margin: 0 auto;
opacity: 0;
z-index: 1000;
position: absolute;
}
.pic {
width: 100%;
height: 100%;
position: absolute;
}
}
// iPhoneX适配
@media (device-width: 375px) and (device-height: 812px) and (-webkit-min-device-pixel-ratio: 3) {
.platform-ios {
#home {
}
}
}
// iPhoneX Max适配
@media (device-width: 414px) and (device-height: 896px) {
.platform-ios {
.platform-ios {
#home {
}
}
}
}
</style>
......@@ -195,12 +195,23 @@
</div>
</div>
</div>
<div v-if="unAuthorizedList.length && showButton" class="button_all">
<div
class="next_step"
@click="autohrized('Y')"
>授权
<div v-if="unAuthorizedList.length && showButton" class="info_all" style="border: none;">
<div class="list_left"
style="width:100%;color: #898989;font-family: '微软雅黑';border: none;line-height: 150%;">
<img src="../../../assets/userRegister/choosed.png"
alt
style="width:15px;height:15px;margin-right:5px;"
/>
“授权”须知:您即将授权“未授权”的经办人员作为贵司的签约授权代表,一旦您点击了“授权”按钮,相应的授权经办人员即完全取得代表贵司签约的权利,其所有签约操作行为都完全代表贵司。请您作为贵司签约授权管理人,在完全理解和明白前述点击“授权”按钮的法律后果并确保贵司愿意接受该种法律后果的情况下点击“授权”按钮。如您因误操作点击了“授权”按钮,请您立即进行取消授权的操作,否则贵司也将承担因误操作所引发的一切法律后果。
</div>
</div>
<div v-if="unAuthorizedList.length && showButton" class="button_all">
<!--<div-->
<!--class="next_step"-->
<!--@click="autohrized('Y')"-->
<!--&gt;{{content}}-->
<!--</div>-->
<h-button id="unAuthorized" class="next_step2" :disabled="ableFlag" @click.native="autohrized('Y')">{{content}}</h-button>
</div>
</div>
......@@ -224,7 +235,10 @@
choosedList: [],//已选择数组
obj: {},
showButton: true,
totalTime: 5,
canClick: false, //添加canClick
content: '同意授权',
ableFlag: true
};
},
components: {
......@@ -248,7 +262,23 @@
methods: {
// tab切换
getRadioVal() {
// console.log(this.staffType);
if (this.staffType == '未授权') {
let vm = this
vm.canClick = false;
vm.ableFlag = true;
vm.content = '同意授权' + vm.totalTime + 's'
let clock = window.setInterval(() => {
vm.totalTime--
vm.content = '同意授权' + vm.totalTime + 's'
if (vm.totalTime < 0) {
window.clearInterval(clock)
vm.content = '同意授权'
vm.totalTime = 5
vm.canClick = true //这里重新开启
vm.ableFlag = false;
}
}, 1000);
}
},
changeChoose(item) {
let vm = this
......@@ -304,6 +334,7 @@
},
//授权
autohrized(flag) {
if (flag == 'Y' && !this.canClick) return //改动的是这两行代码
let vm = this
vm.choosedList = [];
if (flag == 'N') { //已经授权的 取消授权
......@@ -329,11 +360,11 @@
let url = process.env.rootPath + '/auth/api/individual/authorize'
let param = vm.choosedList
if (flag == 'Y') {
hlsPopup.showConfirm({
title: '“授权”须知',
content: '您即将授权“未授权”的经办人员作为贵司的签约授权代表,一旦您点击了“授权”按钮,相应的授权经办人员即完全取得代表贵司签约的权利,其所有签约操作行为都完全代表贵司。请您作为贵司签约授权管理人,在完全理解和明白前述点击“授权”按钮的法律后果并确保贵司愿意接受该种法律后果的情况下点击“授权”按钮。如您因误操作点击了“授权”按钮,请您立即进行取消授权的操作,否则贵司也将承担因误操作所引发的一切法律后果。',
onConfirm: function (index) {
if (index === 1) {
// hlsPopup.showConfirm({
// title: '“授权”须知',
// content: '您即将授权“未授权”的经办人员作为贵司的签约授权代表,一旦您点击了“授权”按钮,相应的授权经办人员即完全取得代表贵司签约的权利,其所有签约操作行为都完全代表贵司。请您作为贵司签约授权管理人,在完全理解和明白前述点击“授权”按钮的法律后果并确保贵司愿意接受该种法律后果的情况下点击“授权”按钮。如您因误操作点击了“授权”按钮,请您立即进行取消授权的操作,否则贵司也将承担因误操作所引发的一切法律后果。',
// onConfirm: function (index) {
// if (index === 1) {
vm.hlsPopup.showLoading('请稍等')
vm.$post(url, param).then(function (res) {
vm.hlsPopup.hideLoading()
......@@ -346,9 +377,9 @@
hlsPopup.showLongCenter(res.message)
}
})
}
},
})
// }
// },
// })
} else if (flag == 'N') {
vm.hlsPopup.showLoading('请稍等')
vm.$post(url, param).then(function (res) {
......@@ -562,6 +593,14 @@
color: #ffffff;
margin-top: 50px;
}
.next_step2 {
width: 120px;
/*height: 30px;*/
border-radius: 15px;
background-color: #09bb07;
color: #ffffff;
margin-top: 50px;
}
}
}
......
......@@ -288,6 +288,19 @@ export default {
'target': null,
'applicationFlag': 'N',
'appCode': 'HLS_APP',
},
{
'functionId': 66,
'functionCode': '470',
'functionName': '银联电子签约',
'functionIcon': require('@/assets/home-manager/chinapay_logo.png'),
'functionState': 'ChinaUnionPay',
'prodFlag': 'Y',
'enableFlag': 'Y',
'functionType': 'local',
'target': null,
'applicationFlag': 'N',
'appCode': 'HLS_APP',
}
],
},
......
......@@ -210,7 +210,7 @@
}
})
} else {
"Y" == window.localStorage.authFlag || "UserRegister" == data.functionState ? this.$router.push({name: data.functionState}) : hlsPopup.showPopup({
"Y" == window.localStorage.authFlag || "UserRegister" == data.functionState|| "ChinaUnionPay" == data.functionState ? this.$router.push({name: data.functionState}) : hlsPopup.showPopup({
title: "提示",
content: "当前用户未完成注册,请先注册!",
onConfirm: function () {
......@@ -378,12 +378,12 @@
.function-item {
width: 25%;
height: 89px;
height: 100px;
font-size: 12px;
// border: 1px solid rgba(169,169,169,0.1); /*no*/
/deep/ img {
height: 30px;
width: 30px;
height: 40px;
width: 40px;
margin: 23px 28px 9px 33px;
}
......
......@@ -44,6 +44,8 @@ import ContractDownloadList from '@/pages/applications/contractDownload/contract
// 图片上传微信服务器
import UploadImg from '@/pages/applications/userRegisters/uploadImg'
import UploadImage from '@/pages/applications/userRegisters/uploadImage'
//银联电子签约
import ChinaUnionPay from '@/pages/applications/chinaUnionPay/chinaUnionPay'
// 全局跳转路由方法
Router.prototype.pushPage = function(param, bool) {
debugger
......@@ -204,6 +206,15 @@ export default new Router({
keepAlive: false
},
},
// 银联电子签约
{
path: '/ChinaUnionPay',
component: ChinaUnionPay,
name: 'ChinaUnionPay',
meta: {
keepAlive: false
},
},
......
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