Commit 85397e1d authored by Jennie Shi's avatar Jennie Shi

个人认证逻辑修改

parent e42abb85
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
</h-header> </h-header>
<!-- <div :class="['top',(multipleRole!=='GUTA'&&user_bp_type!=='GUTA')?'has':'antiHas']" style="margin-top:-1px;"> --> <!-- <div :class="['top',(multipleRole!=='GUTA'&&user_bp_type!=='GUTA')?'has':'antiHas']" style="margin-top:-1px;"> -->
<div class="top" style="margin-top: -1px"> <div class="top" style="margin-top:-1px;">
<div class="card-top"> <div class="card-top">
<img :src="upLoadObj" @click="checkType" > <img :src="upLoadObj" @click="checkType" >
<div class="sign"> <div class="sign">
...@@ -21,11 +21,9 @@ ...@@ -21,11 +21,9 @@
<div> <div>
电子签 电子签
<p <p
:class="[elecStatus ? 'across' : 'un-across']" :class="[elecStatus?'across':'un-across']"
@click="certification" @click="certification"
> >{{ elecStatusDesceibe }}</p>
{{ elecStatusDesceibe }}
</p>
</div> </div>
</div> </div>
</div> </div>
...@@ -35,7 +33,7 @@ ...@@ -35,7 +33,7 @@
<div class="card-bottom"> <div class="card-bottom">
<div v-if="((user_bp_type!=='TENANT')&&(user_bp_type!=='GUTA')&&(multipleRole!=='GUTA')&&(multipleRole!=='TENANT'))||multipleRole==='AGENT'" @click="goStart"> <div v-if="((user_bp_type!=='TENANT')&&(user_bp_type!=='GUTA')&&(multipleRole!=='GUTA')&&(multipleRole!=='TENANT'))||multipleRole==='AGENT'" @click="goStart">
<img src="@/assets/myInfo/car.png" > <img src="@/assets/myInfo/car.png" >
<p>融租合同创建</p> <p>发车申请</p>
</div> </div>
<div v-if="((user_bp_type==='TENANT')&&(multipleRole==='TENANT'))||(multipleRole==='TENANT')||((user_bp_type==='TENANT')&&(!multipleRole))" @click="changePay"> <div v-if="((user_bp_type==='TENANT')&&(multipleRole==='TENANT'))||(multipleRole==='TENANT')||((user_bp_type==='TENANT')&&(!multipleRole))" @click="changePay">
<img src="@/assets/myInfo/pay.png" > <img src="@/assets/myInfo/pay.png" >
...@@ -65,86 +63,43 @@ ...@@ -65,86 +63,43 @@
<div class="content-top"> <div class="content-top">
<list-item :item-height="44" class="list"> <list-item :item-height="44" class="list">
<item @click.native="goContract"> <item @click.native="goContract">
<img <img slot="left-icon" src="@/assets/myInfo/agreement.png" class="left-icon" >
slot="left-icon"
src="@/assets/myInfo/agreement.png"
class="left-icon"
>
<div slot="name">我的合同</div> <div slot="name">我的合同</div>
</item> </item>
<item <item
v-if=" v-if="((user_bp_type==='TENANT')||(user_bp_type==='GUTA'||(multipleRole==='GUTA')||(multipleRole==='TENANT')))&&multipleRole!=='AGENT'"
(user_bp_type === 'TENANT' ||
user_bp_type === 'GUTA' ||
multipleRole === 'GUTA' ||
multipleRole === 'TENANT') &&
multipleRole !== 'AGENT'
"
@click.native="goReimburse" @click.native="goReimburse"
> >
<img <img slot="left-icon" src="@/assets/myInfo/repay.png" class="left-icon" >
slot="left-icon"
src="@/assets/myInfo/repay.png"
class="left-icon"
>
<div slot="name">我的还款</div> <div slot="name">我的还款</div>
</item> </item>
<item v-if="user_bp_type === 'TENANT'" @click.native="goInvoice"> <item v-if="user_bp_type==='TENANT'" @click.native="goInvoice">
<img <img slot="left-icon" src="@/assets/myInfo/invoice.png" class="left-icon" >
slot="left-icon"
src="@/assets/myInfo/invoice.png"
class="left-icon"
>
<div slot="name">我的发票</div> <div slot="name">我的发票</div>
</item> </item>
<item @click.native="goMyProduct"> <item @click.native="goMyProduct">
<img <img slot="left-icon" src="@/assets/myInfo/collect.png" class="left-icon" >
slot="left-icon"
src="@/assets/myInfo/collect.png"
class="left-icon"
>
<div slot="name">我的收藏</div> <div slot="name">我的收藏</div>
<div <div
v-if="productCount > 0" v-if="productCount > 0"
slot="right-icon" slot="right-icon"
:class="{ :class="{'right-icon-width':productCount>99, 'right-icon':productCount<99}"
'right-icon-width': productCount > 99, >{{ productCount > 99 ? '99+' : productCount }}</div>
'right-icon': productCount < 99,
}"
>
{{ productCount > 99 ? "99+" : productCount }}
</div>
</item> </item>
<item @click.native="changeHelp"> <item @click.native="changeHelp">
<img <img slot="left-icon" src="@/assets/myInfo/help.png" class="left-icon" >
slot="left-icon"
src="@/assets/myInfo/help.png"
class="left-icon"
>
<div slot="name">帮助与反馈</div> <div slot="name">帮助与反馈</div>
</item> </item>
<item @click.native="goAbout"> <item @click.native="goAbout">
<img <img slot="left-icon" src="@/assets/myInfo/about.png" class="left-icon" >
slot="left-icon"
src="@/assets/myInfo/about.png"
class="left-icon"
>
<div slot="name">关于徐工</div> <div slot="name">关于徐工</div>
</item> </item>
<item @click.native="goSetting"> <item @click.native="goSetting">
<img <img slot="left-icon" src="@/assets/myInfo/setting.png" class="left-icon" >
slot="left-icon"
src="@/assets/myInfo/setting.png"
class="left-icon"
>
<div slot="name">设置</div> <div slot="name">设置</div>
</item> </item>
<item @click.native="goContactUs"> <item @click.native="goContactUs">
<img <img slot="left-icon" src="@/assets/myInfo/contact.png" class="left-icon" >
slot="left-icon"
src="@/assets/myInfo/contact.png"
class="left-icon"
>
<div slot="name">联系我们</div> <div slot="name">联系我们</div>
</item> </item>
<!-- <item @click.native="updateVersion"> <!-- <item @click.native="updateVersion">
...@@ -157,24 +112,13 @@ ...@@ -157,24 +112,13 @@
<div slot="content">{{ currentVersion }}</div> <div slot="content">{{ currentVersion }}</div>
</item> --> </item> -->
<item @click.native="logOut"> <item @click.native="logOut">
<img <img slot="left-icon" src="@/assets/myInfo/exit.png" class="left-icon" >
slot="left-icon"
src="@/assets/myInfo/exit.png"
class="left-icon"
>
<div slot="name">退出登录</div> <div slot="name">退出登录</div>
</item> </item>
</list-item> </list-item>
<div class="version">版本号:{{ currentVersion }}</div> <div class="version">版本号:{{ currentVersion }}</div>
<button <button v-if="!popSetect" @click="approveBtn ? unBind() : changePageHead()">{{ description }}</button>
v-if="!popSetect" <button v-if="popSetect" @click="popSetectBox=true">{{ description }}</button>
@click="approveBtn ? unBind() : changePageHead()"
>
{{ description }}
</button>
<button v-if="popSetect" @click="popSetectBox = true">
{{ description }}
</button>
</div> </div>
</h-content> </h-content>
<role-switch <role-switch
...@@ -244,7 +188,7 @@ export default { ...@@ -244,7 +188,7 @@ export default {
} }
}, },
computed: { computed: {
roleList () { 'roleList' () {
let obj = { let obj = {
bp_type: this.user_bp_type, bp_type: this.user_bp_type,
bp_type_n: this.bp_type_n, bp_type_n: this.bp_type_n,
...@@ -316,7 +260,7 @@ export default { ...@@ -316,7 +260,7 @@ export default {
}, },
}, },
beforeRouteEnter (to, from, next) { beforeRouteEnter (to, from, next) {
next((vm) => { next(vm => {
vm.signCount = '0' vm.signCount = '0'
vm.carNum = '0' vm.carNum = '0'
vm.faceSign = '0' vm.faceSign = '0'
...@@ -358,8 +302,7 @@ export default { ...@@ -358,8 +302,7 @@ export default {
vm.hlsPopup.hideLoading() vm.hlsPopup.hideLoading()
if (res.result === 'S') { if (res.result === 'S') {
if (res.info) { if (res.info) {
vm.upLoadObj = vm.upLoadObj = process.env.filePath +
process.env.filePath +
'attachment_id=' + 'attachment_id=' +
res.info.attachment_id + res.info.attachment_id +
'&access_token=' + '&access_token=' +
...@@ -387,8 +330,7 @@ export default { ...@@ -387,8 +330,7 @@ export default {
} }
console.log('选择后的角色为:' + role) console.log('选择后的角色为:' + role)
}, },
typeConfirm (e) { typeConfirm (e) { // 选择操作方式后
// 选择操作方式后
this.popSetectBox = false this.popSetectBox = false
if (e.bp_type === '0') { if (e.bp_type === '0') {
this.changePageHead() this.changePageHead()
...@@ -419,7 +361,7 @@ export default { ...@@ -419,7 +361,7 @@ export default {
} else if (this.bp_id && this.user_bp_status === 'NEW') { } else if (this.bp_id && this.user_bp_status === 'NEW') {
this.description = '待提交' this.description = '待提交'
this.approveBtn = false this.approveBtn = false
this.popSetect = true // 是否弹出选择框 this.popSetect = true// 是否弹出选择框
} else if (this.bp_id && this.user_bp_status === 'APPROVED') { } else if (this.bp_id && this.user_bp_status === 'APPROVED') {
this.description = '解除绑定' this.description = '解除绑定'
this.approveBtn = true this.approveBtn = true
...@@ -430,7 +372,7 @@ export default { ...@@ -430,7 +372,7 @@ export default {
) { ) {
this.description = '审核未通过' this.description = '审核未通过'
this.approveBtn = false this.approveBtn = false
this.popSetect = true // 是否弹出选择框 this.popSetect = true// 是否弹出选择框
} else { } else {
this.description = '审批中' this.description = '审批中'
this.approveBtn = false this.approveBtn = false
...@@ -457,7 +399,7 @@ export default { ...@@ -457,7 +399,7 @@ export default {
}, },
}) })
}, },
// 进入待签约功能,客户类型为经销商则进入经销商功能,非经销商则进入融租方案确认 // 进入待签约功能,客户类型为经销商则进入经销商功能,非经销商则进入合同签约
goSign () { goSign () {
if (this.bp_id) { if (this.bp_id) {
// if (this.user_bp_type === 'AGENT') { // if (this.user_bp_type === 'AGENT') {
...@@ -510,7 +452,7 @@ export default { ...@@ -510,7 +452,7 @@ export default {
}, },
}) })
}, },
// 进入融租合同创建 // 进入发车申请
goStart () { goStart () {
if (this.bp_id) { if (this.bp_id) {
this.$router.push({ this.$router.push({
...@@ -520,7 +462,7 @@ export default { ...@@ -520,7 +462,7 @@ export default {
hlsPopup.showLongCenter('请先进行用户绑定') hlsPopup.showLongCenter('请先进行用户绑定')
} }
}, },
// 进入合同签订 // 进入发车确认
goCarConfirm () { goCarConfirm () {
if (this.bp_id) { if (this.bp_id) {
this.$router.push({ this.$router.push({
...@@ -647,7 +589,9 @@ export default { ...@@ -647,7 +589,9 @@ export default {
}, },
} }
vm.hlsPopup.showLoading('请稍候') vm.hlsPopup.showLoading('请稍候')
vm.hlsHttp.post(url, param).then(function (res) { vm.hlsHttp
.post(url, param)
.then(function (res) {
vm.hlsPopup.hideLoading() vm.hlsPopup.hideLoading()
if (res.result === 'S') { if (res.result === 'S') {
vm.hlsPopup.showLongCenter('解绑成功') vm.hlsPopup.showLongCenter('解绑成功')
...@@ -683,7 +627,9 @@ export default { ...@@ -683,7 +627,9 @@ export default {
}, },
} }
vm.hlsPopup.showLoading('请稍候') vm.hlsPopup.showLoading('请稍候')
vm.hlsHttp.post(url, param).then(function (res) { vm.hlsHttp
.post(url, param)
.then(function (res) {
vm.hlsPopup.hideLoading() vm.hlsPopup.hideLoading()
if (res.result === 'S') { if (res.result === 'S') {
vm.hlsPopup.showLongCenter('解绑成功') vm.hlsPopup.showLongCenter('解绑成功')
...@@ -705,18 +651,13 @@ export default { ...@@ -705,18 +651,13 @@ export default {
this.bp_id === undefined this.bp_id === undefined
? ['修改头像'] ? ['修改头像']
: ['修改头像', '用户信息', '角色切换'], : ['修改头像', '用户信息', '角色切换'],
callback: (index) => { callback: index => {
if (index === 0) { if (index === 0) {
this.imgUploadShow(vm.app_user_id) this.imgUploadShow(vm.app_user_id)
} else if (index === 1) { } else if (index === 1) {
this.changePageHead() this.changePageHead()
} else if (index === 2) { } else if (index === 2) {
if ( if (((vm.user_bp_type === 'TENANT') || (vm.user_bp_type === 'GUTA') || (vm.user_bp_type === 'AGENT')) && (vm.user_bp_status === 'APPROVED')) {
(vm.user_bp_type === 'TENANT' ||
vm.user_bp_type === 'GUTA' ||
vm.user_bp_type === 'AGENT') &&
vm.user_bp_status === 'APPROVED'
) {
vm.$refs.roleSwitchRoleList.show() vm.$refs.roleSwitchRoleList.show()
} else { } else {
hlsPopup.showLongCenter('您当前尚无可用角色') hlsPopup.showLongCenter('您当前尚无可用角色')
...@@ -755,7 +696,7 @@ export default { ...@@ -755,7 +696,7 @@ export default {
hlsPopup.showActionSheet({ hlsPopup.showActionSheet({
titleText: '请选择照片', titleText: '请选择照片',
buttonArray: ['拍照', '从相册取'], buttonArray: ['拍照', '从相册取'],
callback: (index) => { callback: index => {
if (index === 0) { if (index === 0) {
vm.imgUploadOpenCamera(check_id) vm.imgUploadOpenCamera(check_id)
} else { } else {
...@@ -866,7 +807,10 @@ export default { ...@@ -866,7 +807,10 @@ export default {
changePageHead () { changePageHead () {
let vm = this let vm = this
if (vm.bp_id) { if (vm.bp_id) {
if (vm.user_bp_status === 'NEW' || vm.user_bp_status === 'RETURN') { if (
vm.user_bp_status === 'NEW' ||
vm.user_bp_status === 'RETURN'
) {
vm.flag = true vm.flag = true
if (vm.user_bp_class === 'NP') { if (vm.user_bp_class === 'NP') {
vm.$router.push({ vm.$router.push({
...@@ -912,7 +856,9 @@ export default { ...@@ -912,7 +856,9 @@ export default {
}, },
}) })
} }
} else if (vm.user_bp_status === 'REJECT') { } else if (
vm.user_bp_status === 'REJECT'
) {
vm.flag = true vm.flag = true
if (vm.user_bp_class === 'NP') { if (vm.user_bp_class === 'NP') {
vm.$router.push({ vm.$router.push({
...@@ -966,10 +912,7 @@ export default { ...@@ -966,10 +912,7 @@ export default {
vm.app_user_id = res.info.app_user_id vm.app_user_id = res.info.app_user_id
window.localStorage.removeItem('bp_id') window.localStorage.removeItem('bp_id')
window.localStorage.setItem('bp_id', res.info.user_bp_id) window.localStorage.setItem('bp_id', res.info.user_bp_id)
window.localStorage.setItem( window.localStorage.setItem('user_bp_status', res.info.user_bp_status)
'user_bp_status',
res.info.user_bp_status
)
window.localStorage.setItem('bp_name', res.info.user_bp_name) window.localStorage.setItem('bp_name', res.info.user_bp_name)
window.localStorage.setItem('bp_identity', res.info.bp_identity) window.localStorage.setItem('bp_identity', res.info.bp_identity)
window.localStorage.setItem('bp_class', res.info.user_bp_class) window.localStorage.setItem('bp_class', res.info.user_bp_class)
...@@ -979,6 +922,7 @@ export default { ...@@ -979,6 +922,7 @@ export default {
vm.user_phone = res.info.user_phone vm.user_phone = res.info.user_phone
vm.bp_type_n = res.info.user_bp_type_n vm.bp_type_n = res.info.user_bp_type_n
if (window.localStorage.multipleRole) { if (window.localStorage.multipleRole) {
} else { } else {
if (res.info.user_bp_type === 'TENANT') { if (res.info.user_bp_type === 'TENANT') {
window.localStorage.setItem('multipleRole', 'TENANT') window.localStorage.setItem('multipleRole', 'TENANT')
...@@ -996,11 +940,7 @@ export default { ...@@ -996,11 +940,7 @@ export default {
} else { } else {
vm.isAGENT = false vm.isAGENT = false
} }
if ( if (vm.user_bp_type === 'GUTA' || vm.user_bp_type === 'TENANT' || vm.user_bp_type === 'AGENT') {
vm.user_bp_type === 'GUTA' ||
vm.user_bp_type === 'TENANT' ||
vm.user_bp_type === 'AGENT'
) {
vm.isMultiRole = true vm.isMultiRole = true
} else { } else {
vm.isMultiRole = false vm.isMultiRole = false
...@@ -1035,39 +975,47 @@ export default { ...@@ -1035,39 +975,47 @@ export default {
async certification () { async certification () {
let vm = this let vm = this
if (vm.bp_id) { if (vm.bp_id) {
if (vm.bp_identity === 'NP_NO' || vm.bp_identity === 'ORG_L_NO' || vm.bp_identity === 'ORG_AUTH_NO') { if (
let url = process.env.basePath + 'bp_query' vm.bp_identity === 'NP_NO' ||
let param = { vm.bp_identity === 'ORG_L_NO'
bp_id: window.localStorage.bp_id, ) {
} let authUrl = await vm.getNpCertificationUrl()
hlsPopup.showLoading('请稍候') if (authUrl) {
vm.hlsHttp.post(url, param).then((result) => { const u = navigator.userAgent
hlsPopup.hideLoading() const isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/)
if (result.result === 'S') { if (isiOS) {
let data = result.lists[0] let ref = cordova.InAppBrowser.open(authUrl, '_blank', 'location=yes,toolbar=yes')
cordova.plugins.IdCardPlugin.idCardIdentify( ref.addEventListener('exit', function () {
{ console.log('Browser is closed...')
idNum: data.id_card_no, vm.userQuery()
idName: data.bp_name, })
phoneNum: window.localStorage.user_phone, console.log('ios')
}, } else {
function (suc) { vm.$router.push({
let success = JSON.parse(suc) name: 'Certification',
if (success.code === 1) { params: {
vm.getNpCertificationUrl() authUrl: authUrl,
}
}, },
function (reason) { })
let error = JSON.parse(reason) console.log('android')
vm.hlsPopup.showLongCenter('认证失败: ' + error.message)
} }
)
} else { } else {
vm.hlsPopup.showLongCenter(result.message) // hlsPopup.showLongCenter('获取认证url失败')
} }
}) } else if (vm.bp_identity === 'ORG_NO' ||
} else if (vm.bp_identity === 'ORG_NO') { vm.bp_identity === 'ORG_AUTH_NO') {
hlsPopup.showLongCenter('APP端不支持认证企业账号,请移步PC端操作') // let authUrl = await vm.getOrgCertificationUrl()
// if (authUrl) {
// vm.$router.push({
// name: 'Certification',
// params: {
// authUrl: authUrl,
// },
// })
// } else {
// // hlsPopup.showLongCenter('获取认证url失败')
// }
hlsPopup.showLongCenter('请联系对应业务人员为企业进行认证')
} else { } else {
hlsPopup.showLongCenter('您已认证通过') hlsPopup.showLongCenter('您已认证通过')
} }
...@@ -1075,6 +1023,7 @@ export default { ...@@ -1075,6 +1023,7 @@ export default {
hlsPopup.showLongCenter('请先进行用户绑定') hlsPopup.showLongCenter('请先进行用户绑定')
} }
}, },
// 获取个人认证url
async getNpCertificationUrl () { async getNpCertificationUrl () {
let vm = this let vm = this
let url = $config.basePath + 'auth_user_sign' let url = $config.basePath + 'auth_user_sign'
...@@ -1084,13 +1033,42 @@ export default { ...@@ -1084,13 +1033,42 @@ export default {
hlsPopup.showLoading('请稍候') hlsPopup.showLoading('请稍候')
let res = await vm.$post(url, param) let res = await vm.$post(url, param)
hlsPopup.hideLoading() hlsPopup.hideLoading()
if (res.info.code === 0 && res.info.data.authUrl) { if ((res.info.code === 0) && (res.info.data.authUrl)) {
hlsPopup.showLongCenter('绑定失败!') vm.authUrl = res.info.data.authUrl
} else if (res.info.code === 0 && res.info.data.openId) { return vm.authUrl
hlsPopup.showLongCenter('绑定成功!') } else if ((res.info.code === 0) && (res.info.data.openId)) {
vm.userQuery() vm.authUrl = res.info.data.openId
return vm.authUrl
} else { } else {
hlsPopup.showLongCenter(res.info.msg) hlsPopup.showError(res.info.msg)
return ''
}
},
// 获取企业认证url
async getOrgCertificationUrl () {
let vm = this
let url = $config.basePath + 'auth_company_sign'
let param = {
phone: vm.user_phone,
}
hlsPopup.showLoading('请稍候')
let res = await vm.$post(url, param)
hlsPopup.hideLoading()
// if (res.info.code === 0) {
// return res.info.data.authUrl
// } else {
// hlsPopup.showLongCenter(res.info.msg)
// return null
// }
if ((res.info.code === 0) && (res.info.data.authUrl)) {
vm.authUrl = res.info.data.authUrl
return vm.authUrl
} else if ((res.info.code === 0) && (res.info.data.openId)) {
vm.authUrl = res.info.data.openId
return vm.authUrl
} else {
hlsPopup.showError(res.info.msg)
return ''
} }
}, },
goAbout () { goAbout () {
...@@ -1172,12 +1150,12 @@ export default { ...@@ -1172,12 +1150,12 @@ export default {
border: 1px solid #00469c; border: 1px solid #00469c;
} }
} }
.has { .has{
height: 206px; height:206px;
}
.antiHas {
height: 3.12rem;
} }
.antiHas{
height:3.12rem;
}
.top { .top {
width: 100%; width: 100%;
// height: 206px; // height: 206px;
...@@ -1247,7 +1225,7 @@ export default { ...@@ -1247,7 +1225,7 @@ export default {
text-align: center; text-align: center;
font-family: PingFangSC-Regular; font-family: PingFangSC-Regular;
font-size: 14px; font-size: 14px;
color: #656464; color:#656464;
} }
} }
.userInfo { .userInfo {
......
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