From f9390b247a07cf658e1416660fbd891d568f20aa Mon Sep 17 00:00:00 2001 From: sjf1256754123 <33301030+sjf1256754123@users.noreply.github.com> Date: Sun, 16 Feb 2020 22:13:08 +0800 Subject: [PATCH] d --- pages/index/index.vue | 33 ++++++++++++++++++++------------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/pages/index/index.vue b/pages/index/index.vue index cd81e33..6094c29 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -4,7 +4,7 @@ - + 入园请向门卫出示健康码 @@ -85,18 +85,25 @@ // }) // }, getScancode(){ - var _this = this; - // 允许从相机和相册扫码 - wx.scanCode({ - success: (res) => { - _this.userId = res.result; - if(_this.securityFlag&&_this.userId){ - uni.navigateTo({ - url: `/pages/security/security?userId=${_this.userId}` - }) - } - } - }) + if(userInfo.roleId == '1003'){ + var _this = this; + // 允许从相机和相册扫码 + wx.scanCode({ + success: (res) => { + _this.userId = res.result; + if(_this.securityFlag&&_this.userId){ + uni.navigateTo({ + url: `/pages/security/security?userId=${_this.userId}` + }) + } + } + }) + }else{ + uni.showToast({ + icon: 'none', + title: '暂无权限,仅安保人员有此权限!' + }) + } }, fillInDay() { if(!this.$store.state.user.userInfo.idCard){ -- 2.22.0