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

个人认证逻辑修改

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