diff --git a/pages/index/index.vue b/pages/index/index.vue index 5ef432e..0d2cb64 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -88,7 +88,7 @@ export default { this.fnUpdateVersion(false) }, methods: { - async fnScan() { + async fnScan() { uni.scanCode({ success: async (res) => { let obj = JSON.parse(res.result) @@ -99,12 +99,11 @@ export default { CORPINFO_ID: obj[0].CORPINFO_ID, RELEVANT_UNIT_NAME: obj[0].RELEVANT_UNIT_NAME }); - if (info.code === 200){ + if (info.code === 200) { uni.$u.toast('入职成功') - }else { - uni.$u.toast('入职失败,请联系管理员') + } else { + uni.$u.toast(info.msg ? info.msg : '系统异常请联系管理员') } - } else if (type === '1') { // type=1时跳转电子工牌页面 uni.$u.route({ @@ -118,8 +117,8 @@ export default { } }); }, - fnIsShow(index){ - if(index === 5) return !!this.userInfo.CORPINFO_ID + fnIsShow(index) { + if (index === 5) return !!this.userInfo.CORPINFO_ID return true }, fnNavigator(e) {