'新签证页面'

This commit is contained in:
proudlx
2021-04-06 17:46:27 +08:00
parent b476070c9e
commit 35eedbcb67
3 changed files with 274 additions and 1 deletions

View File

@@ -7,7 +7,7 @@ module.exports = {
rules: {
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'prettier/prettier': 'error'
'prettier/prettier': 'off'
},
parserOptions: {
parser: 'babel-eslint'

View File

@@ -28,6 +28,7 @@ const PractisingCertificateInfo = () => import('@/views/ebiz/agentEenter/Practis
const recordList = () => import('@/views/ebiz/agentEenter/approve/RecordList')
const recordDetail = () => import('@/views/ebiz/agentEenter/approve/RecordDetail')
const ResultEnd = () => import('@/views/ebiz/agentEenter/ResultEnd')
const InformationInspectionAuthorization = () => import('@/views/ebiz/agentEenter/InformationInspectionAuthorization')
export default [
{
@@ -57,6 +58,15 @@ export default [
index: 1
}
},
{
path: '/agentEenter/InformationInspectionAuthorization',
name: 'InformationInspectionAuthorization',
component: InformationInspectionAuthorization,
meta: {
title: '个人信息查询授权书',
index: 1
}
},
{
path: '/agentEenter/LetterOfCommitment',
name: 'letterOfCommitment',

View File

@@ -0,0 +1,263 @@
<template>
<div>
<van-notice-bar :scrollable="false" v-if="!Time" class="notice">{{ `提示阅读时长需在${time}秒以上` }}</van-notice-bar>
<iframe :src="src + pdfUrl" class="iframe"></iframe>
<div class="fixed bottom0 left0 bg-white" style="width:100%">
<van-radio-group v-model="radio" class="pb10 pt20 pl30">
<van-radio name="1" @click="click" class="fs12">
本人确认已阅读
<span class="blue">个人信息查询授权书</span>
</van-radio>
</van-radio-group>
<div class="pl30 pb15">
本人签字
<van-button type="danger" size="small" @click="sign" :disabled="isDisable" v-no-more-click="1000">{{
appntSign.signState == '0' ? '签名' : '已签名'
}}</van-button>
</div>
<van-button type="danger" :disabled="isDisabledComplite" @click="goNext" v-no-more-click="1000" size="large">下一步</van-button>
</div>
</div>
</template>
<script>
import { Field, Icon, Button, Radio, NoticeBar, Dialog, RadioGroup } from 'vant'
import { agreementQuery, signAgreement } from '@/api/ebiz/agentEenter/agentEenter.js'
import config from '@/config'
import { filtSignList, getAgreementNextPagePath } from './js/methods'
export default {
data() {
return {
src: location.origin + '/pdfjs/web/viewer.html?file=',
pdfUrl: '',
radio: '',
// 定时器时间
time: '10',
// 定时器名称
timer: null,
isOver: false,
// 判断验证码是否开始倒计时
Time: false,
// 签名是否可以点击
isDisable: true,
// 是否可以点击下一步
isDisabledComplite: true,
// 是否签名 true 签名 false 未签名
isSign: false,
//协议list
signList: [],
//当前页面协议签署后下一页路由
nextPagePath: '',
//签署人 0-申请人 1-担保人
code: '',
//推荐人信息
agentInfo: {},
// 推荐人签名信息
appntSign: {
signState: '0'
},
//原生返回的加密包
base64: ''
}
},
components: {
[Field.name]: Field,
[Icon.name]: Icon,
[Button.name]: Button,
[Radio.name]: Radio,
[RadioGroup.name]: RadioGroup,
[NoticeBar.name]: NoticeBar,
[Dialog.name]: Dialog
},
created() {
if (!this.Time) {
this.timeOut()
}
this.agreementQuery()
this.code = this.$route.query.code
},
methods: {
//获取签署协议人信息
agreementQuery() {
let that = this
let data = {}
this.$toast.loading({
duration: 0, // 持续展示 toast
forbidClick: true, // 禁用背景点击
loadingType: 'spinner',
message: '加载中……'
})
agreementQuery(data).then(res => {
console.log(res)
if (res.result == '0') {
this.$toast.clear()
that.signList = res.content.ebizAgreementDtoList
res.content.ebizAgreementDtoList.map(item => {
console.log(item)
// 获取当前要签署的文件信息
if (item.type == '17') {
that.appntSign = item
}
})
filtSignList(that, that.signList)
that.nextPagePath = getAgreementNextPagePath(that.signList, that.code, that.appntSign)
that.pdfUrl = encodeURIComponent(config.imgDomain + `/returnDirectStream?imgPath=${that.appntSign.rgssUrl}`)
} else {
this.$toast(res.resultMessage)
}
})
},
timeOut() {
let timer = setInterval(() => {
this.time--
if (this.time <= 0) {
this.time = 0
clearInterval(timer)
this.Time = true
this.isOver = true
}
}, 1000)
},
// 点击阅读时
click() {
let that = this
if (that.isOver == false) {
Dialog.confirm({
title: '提示',
message: '该内容涉及您的重大权益,请您仔细阅读',
showCancelButton: false
}).then(() => {
that.radio = ''
})
}
},
sign() {
this.$toast.loading({
duration: 0, // 持续展示 toast
forbidClick: true, // 禁用背景点击
loadingType: 'spinner',
message: '加载中……'
})
// eslint-disable-next-line no-undef
EWebBridge.webCallAppInJs('ca_sign', {
//身份证号码
number: localStorage.idNo,
//姓名
name: localStorage.idName,
//身份证号码id
type: '1',
keyword: '承诺人签字',
pageNo: '1',
index: '1',
offset: '5',
pos: '3',
signatureWidth: this.$utils.signParams().signatureWidth,
signatureHeight: this.$utils.signParams().signatureHeight
}).then(data => {
this.$toast.clear()
if (JSON.parse(data).state == '1') {
this.base64 = decodeURI(JSON.parse(data).sign)
this.appntSign.signState = '1'
this.isDisabledComplite = false
this.isSign = false
}
})
},
goNext() {
if (this.$route.query.isChange && !this.base64) {
this.goBack()
} else {
let that = this
let data = {
baseEncryp: that.base64,
ebizAgreementDto: that.appntSign
}
this.$toast.loading({
duration: 0, // 持续展示 toast
forbidClick: true, // 禁用背景点击
loadingType: 'spinner',
message: '加载中……'
})
signAgreement(data).then(res => {
console.log(res)
if (res.result == '0') {
if (this.$route.query.isChange) {
this.goBack()
} else {
this.$toast.clear()
this.$jump({
flag: 'h5',
extra: {
url: location.origin + `/#/agentEenter/${that.nextPagePath}?code=${that.code}`,
pullRefresh: that.nextPagePath == 'signContract' ? '1' : '0'
},
routerInfo: {
path: `/agentEenter/${that.nextPagePath}?code=${that.code}`
}
})
}
} else {
this.$toast(res.resultMessage)
}
})
}
},
goBack() {
this.$jump({
flag: 'goBack',
extra: {
refresh: '1',
index: '-1',
forbidSwipeBack: '1'
},
routerInfo: {
type: 2,
index: -1,
path: `/agentEenter/signContract`
}
})
}
},
computed: {
listenChange() {
const { isOver, radio, appntSign } = this
return { isOver, radio, appntSign }
}
},
watch: {
listenChange(val) {
let that = this
if (val.isOver == true && val.radio != '') {
that.isDisable = false
} else {
that.isDisable = true
}
if (that.radio == '1' && val.appntSign.signState == '1') {
//线上改为1
that.isDisabledComplite = false
} else {
that.isDisabledComplite = true
}
}
},
beforeRouteLeave(to, from, next) {
document.body.style.backgroundColor = ''
next()
}
}
</script>
<style lang="scss" scoped>
.notice {
width: 100%;
position: fixed;
top: 0;
z-index: 20;
}
.iframe {
width: 100vw;
height: 75vh;
}
</style>