<!--
|
* @Author: 小明丶
|
* @Date: 2020-05-20 20:29:47
|
* @LastEditors: zxq
|
* @LastEditTime: 2022-11-28 11:05:10
|
* @Description:
|
-->
|
<template>
|
<div class="home-index-page">
|
<div class="top-bg-box">
|
<!-- <div class="sweep-box" @click="goOrderHandling">
|
<div class="sweep-top">
|
<i class="iconfont iconsaoyisao"></i>
|
</div>
|
<div class="sweep-bottom">
|
<p>扫一扫</p>
|
</div>
|
</div> -->
|
<div class="btn-box">
|
<button @click="goOrderHandling">办理分期</button>
|
</div>
|
<!-- <div class="text-box">
|
<p>客服电话:028-86043722</p>
|
<p>联系邮箱:kefu@finlean.com</p>
|
</div> -->
|
</div>
|
<van-dialog v-model="show" title="错误提示">
|
<div class="dialog-box">
|
<!-- <p>由于系统问题,暂时无法申请订单,请稍候再试。</p> -->
|
<p>{{errText}}</p>
|
</div>
|
</van-dialog>
|
</div>
|
</template>
|
<script>
|
import Vue from 'vue';
|
import { Dialog } from 'vant';
|
|
// 全局注册
|
Vue.use(Dialog);
|
export default {
|
data() {
|
return {
|
show:false,
|
errText:'',
|
businessInfo: {}, //扫码获取商户信息
|
str: "" //二维码获取的字符串
|
};
|
},
|
created() {
|
this.getWXToken();
|
// 判断微信接口是否支持
|
wx.checkJsApi({
|
jsApiList: ["checkJsApi", "scanQRCode"], // 需要检测的JS接口列表
|
success: function(res) {
|
console.log(res)
|
}
|
});
|
|
},
|
methods: {
|
/**
|
* 获取当前账号订单进行步骤
|
*
|
* NO_SCAN(0,"待扫码"),调用扫码
|
* NO_ID(1,"待上传身份证"),跳转上传身份证页面
|
* NO_FACE(2,"待人脸识别"),跳转第三方人脸识别
|
* NO_USER_INFO(3,"待填写个人信息"),跳转个人信息填写页面
|
* NO_CONT_INFO(4,"待签署合同"),跳转合同签署页面
|
* NO_IMG_INFO(5,"待上传影像资料"),跳转图片上传页面
|
* AUDIT(6,"待审核");跳转审核结果页面
|
* **/
|
orderCreateStep() {
|
this.$api.orderCreateStep().then(res => {
|
localStorage.setItem('projId',res.body.projId?res.body.projId:100000);
|
// res.body.createStep = 4;
|
if (res.body.createStep == 0) {
|
//调用摄像头
|
this.getCamera();
|
}
|
if (res.body.createStep == 1) {
|
this.$router.push("/order-handling/upload-IDcard");
|
}
|
if (res.body.createStep == 2) {
|
//重新人脸识别,先去协议页面;
|
this.$router.push({
|
path: "/order-handling/face-recognition",
|
query: {isFaceBack:'1'}
|
});
|
// let str = location.host
|
// this.$api
|
// .getFaceUrl({
|
// callbackUrl:
|
// `https://${str}/aic_cus/#/order-handling/face-recognition`
|
// })
|
// .then(res => {
|
// window.location.href = res.body.faceUrl;
|
// });
|
//this.$router.push('/order-handling/upload-IDcard')
|
}
|
if (res.body.createStep == 3) {
|
this.$router.push("/order-handling/upload-userInfo");
|
}
|
if (res.body.createStep == 4) {
|
window.sessionStorage.backUrl = '/home/index'
|
this.$router.push("/order-handling/contract-signing");
|
}
|
if (res.body.createStep == 5) {
|
this.$router.push(res.body.projId=='100000'?"/order-handling/approval-results":"/order-handling/image-upload");
|
}
|
if (res.body.createStep == 6) {
|
this.$router.push("/order-handling/approval-results");
|
}
|
}).catch(err=>{
|
this.errText = err.errMsg
|
this.show = true
|
})
|
},
|
// 点击获取当前账号在第几步直接跳转到对应步骤
|
goOrderHandling() {
|
this.orderCreateStep();
|
},
|
// 异步准备微信环境
|
checkIsReady() {
|
return new Promise((resolve, reject) => {
|
wx.ready(() => resolve());
|
wx.error(err => reject(console.log(res + "wx.error")));
|
});
|
},
|
// 调取微信jssdk,需要获取token
|
getWXToken() {
|
//let url = window.location.origin + window.location.pathname;
|
let url = location.href.split('#')[0]
|
this.$api.wechatgetSign({ url }).then(
|
res => {
|
|
// 第二步骤 只需要首页地址分享 ,需要在每次变化时调用
|
wx.config({
|
debug: false, // 开启调试模式
|
appId: res.body.appId,
|
timestamp: res.body.timestamp, // 必填,生成签名的时间戳
|
nonceStr: res.body.nonceStr, // 必填,生成签名的随机串
|
signature: res.body.signature, // 必填,签名,见附录1
|
jsApiList: ["checkJsApi", "scanQRCode"] // 必填,需要使用的JS接口列表,所有JS接口列表见附录2
|
});
|
wx.error(function (res) {
|
console.log(res)
|
// config信息验证失败会执行error函数,如签名过期导致验证失败,具体错
|
});
|
},
|
error => {
|
console.log(error);
|
}
|
);
|
},
|
//调用摄像头扫码
|
getCamera() {
|
let _this = this;
|
this.checkIsReady().then(() => {
|
if (window.android && window.android.fetchQrCode) {
|
window.android.fetchQrCode();
|
} else {
|
|
wx.scanQRCode({
|
needResult: 1, // 默认为0,扫描结果由微信处理,1则直接返回扫描结果,
|
scanType: ["qrCode", "barCode"], // 可以指定扫二维码还是一维码,默认二者都有
|
success: function(res) {
|
var result = res.resultStr; // 当needResult 为 1 时,扫码返回的结果
|
console.log(result);
|
_this.str = res.resultStr;
|
_this.$router.push({
|
path: "/order-handling",
|
query: {
|
url: _this.str
|
}
|
});
|
}
|
});
|
}
|
});
|
}
|
}
|
};
|
</script>
|
<style lang="less" scoped>
|
.home-index-page {
|
& {
|
background: #fff;
|
height:calc(100vh - 52px);
|
}
|
.top-bg-box{
|
&{
|
width: 100%;
|
height:calc(100vh - 52px);
|
background: url('../../../static/img/homeBack.jpg');
|
background-size: 100% 100%;
|
position: relative;
|
}
|
.btn-box{
|
position: absolute;
|
text-align: center;
|
bottom: 147px;
|
width: 100%;
|
button{
|
width:210px;
|
height:40px;
|
background:rgba(255,255,255,1);
|
box-shadow:0px 0px 10px 0px rgba(23,154,198,0.26), 0px -2px 5px 0px rgba(46,150,238,0.3) inset;
|
border-radius:20px;
|
outline: none;
|
border: 0;
|
color: #5194FE;
|
}
|
}
|
.text-box{
|
text-align: center;
|
width: 100%;
|
position: absolute;
|
bottom: 66px;
|
p{
|
font-size:12px;
|
font-family:PingFang SC;
|
font-weight:500;
|
color:rgba(255,255,255,1);
|
}
|
p:nth-of-type(1){
|
margin-bottom: 6px;
|
}
|
}
|
}
|
// .top-bg-box {
|
// position: relative;
|
// width: 100vw;
|
// height: 130px;
|
// background-image: url("../../../static/img/bg.png");
|
// background-size: cover;
|
// .sweep-box {
|
// width: 120px;
|
// height: 90px;
|
// background: rgba(255, 255, 255, 1);
|
// box-shadow: 0px 0px 15px 0px rgba(26, 100, 225, 0.12);
|
// border-radius: 8px;
|
// position: absolute;
|
// left: 50%;
|
// top: 78px;
|
// transform: translateX(-50%);
|
// text-align: center;
|
// .sweep-top {
|
// height: 52px;
|
// color: #5e9cff;
|
// line-height: 52px;
|
// i {
|
// font-size: 35px;
|
// }
|
// }
|
// .sweep-bottom {
|
// height: 38px;
|
// line-height: 38px;
|
// p {
|
// font-size: 16px;
|
// font-family: PingFang SC;
|
// font-weight: 500;
|
// color: rgba(51, 51, 51, 1);
|
// }
|
// }
|
// }
|
// }
|
.dialog-box{
|
height: 100px;
|
box-sizing: border-box;
|
padding: 25px 25px ;
|
text-align: left;
|
p{
|
line-height: 20px;
|
color: #666666;
|
font-size: 14px;
|
}
|
}
|
}
|
</style>
|