From 8b0700efb7d73990e80e3d4f00f809caf185ae71 Mon Sep 17 00:00:00 2001 From: sjf1256754123 <33301030+sjf1256754123@users.noreply.github.com> Date: Tue, 25 Feb 2020 19:31:23 +0800 Subject: [PATCH] d --- pages/index/index.vue | 178 ++++++++++++++++++++---------------- pages/leader/leader.vue | 28 +++--- pages/security/security.vue | 18 ++-- 3 files changed, 125 insertions(+), 99 deletions(-) diff --git a/pages/index/index.vue b/pages/index/index.vue index 6d9bf3e..72eedfd 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -10,16 +10,16 @@ --> {{park}} - 入园请出示二维码通行证 - - - - - - - - - + 入园请出示二维码通行证 + + + + + + + + + @@ -49,18 +49,18 @@ name: "home", data() { return { - park:'', - hiddenRegisterFlag:true, - imgSrc:'', - modalName:'', - flag:true, - securityFlag:false, - userId:'' + park: '', + hiddenRegisterFlag: true, + imgSrc: '', + modalName: '', + flag: true, + securityFlag: false, + userId: '' }; }, onLoad: function(option) { wx.showShareMenu({ - withShareTicket: true + withShareTicket: true }) }, onShow() { @@ -79,19 +79,19 @@ // #endif }, methods: { - leader(){ + leader() { uni.navigateTo({ url: `/pages/leader/leader` }) }, - temperature(){ + temperature() { uni.showToast({ icon: 'none', title: '即将上线!' }) }, - - getImg(){ + + getImg() { this.$http.get(`/sict-ncov/user/qrcode`).then(res => { const d = res.data if (d.code == 1) { @@ -107,44 +107,60 @@ url: `/pages/fillIn/fillIn` }) }, - + // 安保跳转 // security() { // uni.navigateTo({ // url: `/pages/security/security?userId=${this.userId}` // }) // }, - getScancode(){ - if(this.$store.state.user.userInfo.roleId&&this.$store.state.user.userInfo.roleId == '1003'){ + getScancode() { + if (this.$store.state.user.userInfo.roleId && this.$store.state.user.userInfo.roleId == '1003') { var _this = this; // 允许从相机和相册扫码 wx.scanCode({ - success: (res) => { - if(res.result.indexOf('userId')>-1&&res.result.indexOf('date')>-1){ - _this.userId = res.result; - let arr = res.result.split("&") - _this.userId = arr[0].split("=")[1] - if(getSampleId() == arr[1].split("=")[1]){ - if(_this.securityFlag&&_this.userId){ - uni.navigateTo({ - url: `/pages/security/security?userId=${_this.userId}` - }) - } - }else{ - uni.showToast({ - icon: 'none', - title: '二维码已失效!' - }) - } - }else{ - uni.showToast({ - icon: 'none', - title: '请扫描小程序首页内的二维码!' - }) - } - } + success: (res) => { + if (res.result.indexOf('userId') > -1 && res.result.indexOf('date') > -1) { + let arr = res.result.split("&") + if (arr.length == 3) { + _this.userId = arr[0].split("=")[1] + if (arr[2].split("=")[1] == _this.$store.state.user.userInfo.userOrg.parkId) { + if (getSampleId() == arr[1].split("=")[1]) { + if (_this.securityFlag && _this.userId) { + uni.navigateTo({ + url: `/pages/security/security?userId=${_this.userId}` + }) + } + } else { + uni.showToast({ + icon: 'none', + title: '二维码已失效!' + }) + } + } else { + uni.showToast({ + icon: 'none', + title: '不是该园区二维码!' + }) + } + } else { + uni.showToast({ + icon: 'none', + title: '二维码已失效!' + }) + } + } else { + uni.showToast({ + icon: 'none', + title: '请扫描小程序首页内的二维码!' + }) + } + + } }) - }else{ + + + } else { uni.showToast({ icon: 'none', title: '暂无权限,仅安保人员有此权限!' @@ -152,14 +168,14 @@ } }, fillInDay() { - if(!this.$store.state.user.userInfo.idCard){ + if (!this.$store.state.user.userInfo.idCard) { uni.showToast({ icon: 'none', title: '请先上报个人资料!' }) - }else{ + } else { uni.navigateTo({ - url:`/pages/fillInDay/fillInDay` + url: `/pages/fillInDay/fillInDay` }) } }, @@ -169,15 +185,15 @@ const d = res.data if (d.code == 1) { let userInfo = d.object - this.park = userInfo.userOrg?userInfo.userOrg.park:'' - if(userInfo.roleId == '1003'){ - this.securityFlag=true + this.park = userInfo.userOrg ? userInfo.userOrg.park : '' + if (userInfo.roleId == '1003') { + this.securityFlag = true } - - if(userInfo.isVip == '1'){ + + if (userInfo.isVip == '1') { this.hiddenRegisterFlag = false } - + let obj = Object.assign({}, this.$store.getters.userInfo) if (obj.avatarUrl) { userInfo.avatarUrl = obj.avatarUrl @@ -185,9 +201,6 @@ this.$store.dispatch('user/setInfo', Object.assign(obj, userInfo)) this.$store.dispatch('user/setToken', d.result) this.getImg() - if(this.userId){ - this.security() - } } }).catch(err => { console.log(err) @@ -204,26 +217,31 @@ height: 100vh; width: 100vw; background-repeat: no-repeat; - background-size: cover; - background-image: url('http://139.9.163.126/gastric/static/background.jpg'); - .btnList{ + background-size: cover; + background-image: url('http://139.9.163.126/gastric/static/backgroundSict.jpg'); + + .btnList { padding-top: 225upx; text-align: center; - .btnSecurity{ + + .btnSecurity { background-color: #92d0f1; color: #FFFFFF; border-radius: 60upx; width: 52%; text-align: center; } - .btnSecurity{ - margin-top:45upx; + + .btnSecurity { + margin-top: 45upx; } - .btnStaff{ + + .btnStaff { color: #FFFFFF; border-radius: 60upx; } - .btnStaff2{ + + .btnStaff2 { text-align: left; display: inline-block; width: 140upx; @@ -231,20 +249,24 @@ background-color: #92d0f1; color: #FFFFFF; } - .img{ + + .img { width: 350upx; height: 350upx; } - .tips,.park{ - margin-top:25upx; - margin-bottom:45upx; + + .tips, + .park { + margin-top: 25upx; + margin-bottom: 45upx; font-weight: bold; font-size: 32upx; - color:#FFFFFF; + color: #FFFFFF; } - .park{ - margin-top:0; - margin-bottom:45upx; + + .park { + margin-top: 0; + margin-bottom: 45upx; } } } diff --git a/pages/leader/leader.vue b/pages/leader/leader.vue index 7ccc2ee..77bb8c0 100644 --- a/pages/leader/leader.vue +++ b/pages/leader/leader.vue @@ -3,23 +3,21 @@ 提示:请输入您申报复工时同样的信息(名字,手机号,身份证)! -
- - *姓名 - - - *手机号码 - + *姓名: + + + + *手机号码: + + + + *身份证/护照号: + + + + - - *身份证/护照号 - - - - - -
diff --git a/pages/security/security.vue b/pages/security/security.vue index 4dfe600..25298f9 100644 --- a/pages/security/security.vue +++ b/pages/security/security.vue @@ -3,17 +3,18 @@ - {{obj.userName?obj.userName:''}} - + {{obj.orgName?obj.orgName:''}} + {{obj.userName?obj.userName:''}} + 体温值: - + - + @@ -42,6 +43,7 @@ name: "home", data() { return { + disabled:false, form:{ heat:'', heatNomal:-1, @@ -75,6 +77,7 @@ }, // 体温正常 normal() { + this.disabled = true this.form.heatNomal = 0 this.form.heat = '' this.$http.post(`/sict-ncov/report/daily/heat`,this.form).then(res => { @@ -82,6 +85,7 @@ if (d.code == 1) { this.getData() } + this.disabled = false }).catch(err => { console.log(err) }) @@ -96,12 +100,14 @@ }, // 提交异常体温 submit(){ + this.disabled = true this.form.heatNomal = this.form.heat<37.2?0:1 this.$http.post(`/sict-ncov/report/daily/heat`,this.form).then(res => { const d = res.data if (d.code == 1) { this.getData() } + this.disabled = false }).catch(err => { console.log(err) }) @@ -124,11 +130,11 @@ color: #FFFFFF; border-radius: 60upx; width: 52%; - margin-top:75upx; + margin-top:45upx; text-align: center; } .btnAbnormal{ - margin-top:95upx; + margin-top:65upx; } } .cu-form-group{ -- 2.22.0