实名页面-优化刷新实名的功能
This commit is contained in:
parent
4f7a6c63b4
commit
ef8c6d1705
|
|
@ -32,6 +32,7 @@
|
||||||
<view v-if="isRefresh" class="refresh" @click="toGetshuaxin">
|
<view v-if="isRefresh" class="refresh" @click="toGetshuaxin">
|
||||||
<text>刷新实名状态</text>
|
<text>刷新实名状态</text>
|
||||||
</view>
|
</view>
|
||||||
|
<uv-toast ref="toast"></uv-toast>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
@ -73,44 +74,55 @@ export default {
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
toGetshuaxin() {
|
toGetshuaxin() {
|
||||||
uni.$uv.debounce(this.getshuaxin, 2000, true)
|
uni.$uv.debounce(this.getshuaxin, 500, true)
|
||||||
},
|
},
|
||||||
// 刷新人脸识别是否成功
|
|
||||||
getshuaxin() {
|
// 刷新人脸识别状态
|
||||||
refreshRealName().then(res => {
|
async getshuaxin() {
|
||||||
|
try {
|
||||||
|
// 显示加载Toast(30秒超时自动隐藏)
|
||||||
|
this.$refs.toast.show({
|
||||||
|
type: 'loading',
|
||||||
|
message: '正在刷新实名信息...',
|
||||||
|
overlay: true,
|
||||||
|
duration: 30000,
|
||||||
|
})
|
||||||
|
|
||||||
|
const res = await refreshRealName()
|
||||||
|
this.$refs.toast.hide()
|
||||||
|
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
if (res.data.pass === true) {
|
this.handleRefreshSuccess(res.data)
|
||||||
let realNameType = res.data.realNameType
|
} else {
|
||||||
let infoId = res.data.infoId
|
this.handleRefreshFail(res.msg || '人脸认证失败')
|
||||||
uni.showModal({
|
}
|
||||||
title: '温馨提示',
|
} catch (error) {
|
||||||
content: `人脸认证成功`,
|
this.$refs.toast.hide()
|
||||||
showCancel: false,
|
this.handleRefreshFail(error.message || '网络异常')
|
||||||
success: function (res) {
|
}
|
||||||
uni.navigateBack()
|
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// 处理成功响应
|
||||||
|
handleRefreshSuccess(data) {
|
||||||
|
if (data.pass) {
|
||||||
|
uni.showModal({
|
||||||
|
title: '认证成功',
|
||||||
|
showCancel: false,
|
||||||
|
complete: () => uni.navigateBack(),
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
uni.showModal({
|
this.handleRefreshFail('人脸验证未通过')
|
||||||
title: '温馨提示',
|
|
||||||
content: `人脸认证失败`,
|
|
||||||
showCancel: false,
|
|
||||||
success: function (res) {
|
|
||||||
uni.navigateBack()
|
|
||||||
},
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
uni.showModal({
|
|
||||||
title: '温馨提示',
|
|
||||||
content: `人脸认证失败`,
|
|
||||||
showCancel: false,
|
|
||||||
success: function (res) {
|
|
||||||
uni.navigateBack()
|
|
||||||
},
|
},
|
||||||
})
|
|
||||||
}
|
// 统一处理失败
|
||||||
})
|
handleRefreshFail(message) {
|
||||||
|
// uni.showModal({
|
||||||
|
// title: '提示',
|
||||||
|
// content: message,
|
||||||
|
// showCancel: false,
|
||||||
|
// // complete: () => uni.navigateBack(),
|
||||||
|
// })
|
||||||
},
|
},
|
||||||
|
|
||||||
// 点击进行实名认证
|
// 点击进行实名认证
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user