Commit 227de48b authored by linwenqing's avatar linwenqing

refactor:我的信息,认证样式优化

parent f6cfded1
......@@ -171,6 +171,9 @@ export default {
}
},
onLoad() {
this.checkType = '特种作业操作证查询'
},
onShow: function(param) {
if (!this.vuex_token) {
this.$u.toast('请先登录')
let that = this
......@@ -180,9 +183,6 @@ export default {
})
}, 1000)
}
this.checkType = '特种作业操作证查询'
},
onShow: function(param) {
// try {
// if (param.tabs) {
// this.current = param.tabs
......
......@@ -45,7 +45,7 @@ export default {
return {
title: '我的题库',
nothing: process.uniEnv.qn_base_url + 'zanwucuoti@3x.png',
lists: null,
lists: [],
}
},
onLoad() {
......@@ -107,18 +107,19 @@ export default {
case 15:
status = '已失效'
data[i].statusStyle = { color: '#9EA5BB' }
data[i].subtitle = '题库已失效'
data[i].subtitle = '题库已过期'
break
default:
break
}
data[i].status = status
this.lists.push(data[i])
}
if (data.length > 0) {
this.lists = data
console.log('tiku data', data)
}
// if (data.length > 0) {
// this.lists = data
// console.log('tiku data', data)
// }
})
},
getTodayDate() {
......
......@@ -15,7 +15,9 @@
<text class="line-1"
>请上传您的:<text class="name">身份证</text>
</text>
<text class="line-2">请按照下面提示依次点击上传身份证正反面</text>
<view style="margin: 24rpx 0;">
<text class="line-2">请按照下面提示依次点击上传身份证正反面</text>
</view>
<view class="upload-image">
<image
class="cert-image"
......@@ -159,6 +161,8 @@ export default {
this.student.identityNumber = res.number
})
.catch((data) => {
this.student.name = ''
this.student.identityNumber = ''
this.$u.toast('识别身份证信息错误')
})
})
......@@ -176,6 +180,7 @@ export default {
this.student.certificateValidityDate = res.expire
})
.catch((data) => {
this.student.certificateValidityDate = ''
this.$u.toast('识别身份证信息错误')
})
})
......@@ -201,17 +206,14 @@ page {
background-color: #f7f9fc;
background-size: 100% 920rpx;
background-repeat: no-repeat;
height: 120vh;
position: absolute;
top: 0;
height: 100vh;
width: 100%;
overflow-x: hidden;
}
.content {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
width: 100%;
height: 100%;
overflow: auto;
}
.upload-image {
padding: 0 28rpx;
......
......@@ -150,41 +150,62 @@ export default {
})
},
getPhonenumber(e) {
var that = this
login.appLogin().then((res) => {
that.code = res.code
var code = that.code
if (e && e.detail) {
if (e.detail.errMsg.indexOf('user deny') > -1) {
//拒绝授权
} else if (e.detail.encryptedData && e.detail.iv) {
//允许授权-解析-更新手机号
let params = {
encryptedData: e.detail.encryptedData,
iv: e.detail.iv,
}
uni.checkSession({
success(ccc) {
//session_key 未过期,并且在本生命周期一直有效
params.code = code
that.$u.api.loginWechatAuth(params).then((res) => {
that.student.phoneNumber = res.phoneNumber
that.$u.api.updateUserInfo({
phoneNumber: res.phoneNumber,
})
})
},
fail() {
// session_key 已经失效,需要重新执行登录流程
that.toLogin()
},
})
} else {
this.$u.toast(e.detail.errMsg)
console.log('eeeee', e)
let that = this
let params = {}
if (e && e.detail) {
if (e.detail.errMsg.indexOf('user deny') > -1) {
//拒绝授权
return
} else if (e.detail.encryptedData && e.detail.iv) {
//允许授权-解析-更新手机号
params = {
encryptedData: e.detail.encryptedData,
iv: e.detail.iv,
}
} else {
this.$u.toast('授权失败,请重新授权')
that.$u.toast(e.detail.errMsg)
return
}
} else {
that.$u.toast('授权失败,请重新授权')
return
}
if (that.code) {
console.log('走的第一个')
uni.checkSession({
success() {
console.log('走的第一个1')
//session_key 未过期,并且在本生命周期一直有效
params.code = that.code
that.syncUserinfo(params)
},
fail() {
console.log('走的第一个2')
// session_key 已经失效,需要重新执行登录流程
that.toLogin()
},
})
} else {
console.log('走的第二个')
uni.login({
provider: 'weixin',
success: (code_res) => {
if (code_res.errMsg == 'login:ok') {
that.code = code_res.code
params.code = code_res.code
that.syncUserinfo(params)
}
},
})
}
},
syncUserinfo(params) {
this.$u.api.loginWechatAuth(params).then((res) => {
this.student.phoneNumber = res.phoneNumber
this.$u.api.updateUserInfo({
phoneNumber: res.phoneNumber,
})
})
},
toLogin() {
......
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