Commit cbbecf99 authored by sjf1256754123's avatar sjf1256754123

demo

parent cc8af0bc
...@@ -2,9 +2,16 @@ ...@@ -2,9 +2,16 @@
<view class="index"> <view class="index">
<view class="temp"> <view class="temp">
<view class="btnList"> <view class="btnList">
<button class="btnStaff" type="primary" @click="staff">首次填报</button> <view class="btnStaff">
<button class="btnSecurity" type="primary" @click="fillInDay">每日签到</button> <image src="../../static/5.png" class="btnStaff2" mode=""></image>
<button class="btnSecurity" type="primary" @click="getScancode">安保测温</button> <image src="../../static/4.png" class="btnStaff2" @click="staff" mode=""></image>
<image src="../../static/3.png" class="btnStaff2" @click="fillInDay" mode=""></image>
<image src="../../static/6.png" class="btnStaff2" @click="temperature" mode=""></image>
</view>
<view class="btnStaff">
<image src="../../static/2.png" class="btnStaff2" mode=""></image>
<image src="../../static/7.png" class="btnStaff2" @click="getScancode" style="width: 484upx;" mode=""></image>
</view>
<image class="img" :src="imgSrc" mode="widthFix" @click="modalName = 'Image'"> <image class="img" :src="imgSrc" mode="widthFix" @click="modalName = 'Image'">
<view class="tips">入园请向门卫出示健康码</view> <view class="tips">入园请向门卫出示健康码</view>
</view> </view>
...@@ -61,6 +68,13 @@ ...@@ -61,6 +68,13 @@
} }
}, },
methods: { methods: {
temperature(){
uni.showToast({
icon: 'none',
title: '即将上线!'
})
},
getImg(){ getImg(){
this.$http.get(`/sict-ncov/user/qrcode`).then(res => { this.$http.get(`/sict-ncov/user/qrcode`).then(res => {
const d = res.data const d = res.data
...@@ -85,7 +99,8 @@ ...@@ -85,7 +99,8 @@
// }) // })
// }, // },
getScancode(){ getScancode(){
if(this.$store.state.user.userInfo.roleId == '1003'){ console.log(this.$store.state.user.userInfo.roleId)
if(this.$store.state.user.userInfo.roleId&&this.$store.state.user.userInfo.roleId == '1003'){
var _this = this; var _this = this;
// 允许从相机和相册扫码 // 允许从相机和相册扫码
wx.scanCode({ wx.scanCode({
...@@ -156,7 +171,8 @@ ...@@ -156,7 +171,8 @@
background-image: url('http://139.9.163.126/gastric/static/background.jpg'); background-image: url('http://139.9.163.126/gastric/static/background.jpg');
.btnList{ .btnList{
padding-top: 395upx; padding-top: 395upx;
.btnStaff,.btnSecurity{ text-align: center;
.btnSecurity{
background-color: #92d0f1; background-color: #92d0f1;
color: #FFFFFF; color: #FFFFFF;
border-radius: 60upx; border-radius: 60upx;
...@@ -166,6 +182,18 @@ ...@@ -166,6 +182,18 @@
.btnSecurity{ .btnSecurity{
margin-top:45upx; margin-top:45upx;
} }
.btnStaff{
color: #FFFFFF;
border-radius: 60upx;
}
.btnStaff2{
text-align: left;
display: inline-block;
width: 160upx;
height: 99upx;
background-color: #92d0f1;
color: #FFFFFF;
}
.img{ .img{
margin-top:45upx; margin-top:45upx;
width: 200upx; width: 200upx;
......
<template name="index"> <template name="index">
<view class="index"> <view class="index">
<view class="temp"> <view class="temp">
<view v-show="!hiddenFlag">
<view class="btnList"> <view class="btnList">
<span style="font-weight: bold;color:#fff;font-size: 58upx;">{{obj.userName}}</span>
<button class="btnNormal" type="primary" @click="normal">体温正常</button> <button class="btnNormal" type="primary" @click="normal">体温正常</button>
<button class="btnAbnormal" type="primary" @click="abnormal">体温异常</button> <button class="btnAbnormal" type="primary" @click="abnormal">体温异常</button>
</view> </view>
...@@ -10,11 +12,27 @@ ...@@ -10,11 +12,27 @@
<view class="title">体温值:</view> <view class="title">体温值:</view>
<input class="text-left" type="number" :value="form['heat']" name="input" @input="updateInputVal($event,'heat')"></input> <input class="text-left" type="number" :value="form['heat']" name="input" @input="updateInputVal($event,'heat')"></input>
</view> </view>
<view class="btnList" style="padding-top: 55upx;"> <view class="btnList" style="padding-top:5upx;">
<button class="btnSubmit" type="primary" @click="submit">提交</button> <button class="btnSubmit" type="primary" @click="submit">提交</button>
</view> </view>
</view> </view>
</view> </view>
<view v-show="hiddenFlag" class="tip">
<view class="tips">
<span style="font-weight: bold;">{{obj.userName}}</span>
今日已测温
</view>
<view class="tips" v-show="obj.heat>0">
体温值:<span style="font-weight: bold;">{{obj.heat}}</span>
</view>
<view class="tips" v-show="obj.notice">
提示:<span style="font-weight: bold;">{{obj.notice}}</span>
</view>
<view class="tips">
结果 :<span style="font-weight: bold;">{{obj.heatNomal?'体温异常':'体温正常'}}</span>
</view>
</view>
</view>
</view> </view>
</template> </template>
...@@ -29,15 +47,32 @@ ...@@ -29,15 +47,32 @@
heatNomal:-1, heatNomal:-1,
userId:'' userId:''
}, },
obj:{
heat:'',
heatNormal:'',
notice:''
},
hiddenFlag:false,
temperature:'', temperature:'',
abnormalFlag:false abnormalFlag:false
}; };
}, },
onLoad: function(option) { onLoad: function(option) {
this.form.userId = option.userId this.form.userId = option.userId
this.getData()
}, },
onShow() {}, onShow() {},
methods: { methods: {
getData(){
this.$http.get(`/sict-ncov/report/daily/heat?userId=${this.form.userId}`).then(res => {
if (res.data.code == 1) {
this.obj = res.data.object
this.hiddenFlag = this.obj.heatNormal == 1 || this.obj.heatNormal == 0
}
}).catch(err => {
console.log(err)
})
},
// 体温正常 // 体温正常
normal() { normal() {
this.form.heatNomal = 0 this.form.heatNomal = 0
...@@ -45,10 +80,7 @@ ...@@ -45,10 +80,7 @@
this.$http.post(`/sict-ncov/report/daily/heat`,this.form).then(res => { this.$http.post(`/sict-ncov/report/daily/heat`,this.form).then(res => {
const d = res.data const d = res.data
if (d.code == 1) { if (d.code == 1) {
uni.showToast({ this.getData()
icon: 'success',
title: d.object || d.message
})
} }
}).catch(err => { }).catch(err => {
console.log(err) console.log(err)
...@@ -69,10 +101,7 @@ ...@@ -69,10 +101,7 @@
this.$http.post(`/sict-ncov/report/daily/heat`,this.form).then(res => { this.$http.post(`/sict-ncov/report/daily/heat`,this.form).then(res => {
const d = res.data const d = res.data
if (d.code == 1) { if (d.code == 1) {
uni.showToast({ this.getData()
icon: 'none',
title: d.object
})
} }
}).catch(err => { }).catch(err => {
console.log(err) console.log(err)
...@@ -96,6 +125,7 @@ ...@@ -96,6 +125,7 @@
color: #FFFFFF; color: #FFFFFF;
border-radius: 60upx; border-radius: 60upx;
width: 52%; width: 52%;
margin-top:75upx;
text-align: center; text-align: center;
} }
.btnAbnormal{ .btnAbnormal{
...@@ -114,5 +144,15 @@ ...@@ -114,5 +144,15 @@
border-bottom: 2upx solid #FFFFFF; border-bottom: 2upx solid #FFFFFF;
} }
} }
.tip{
font-size: 42upx;
color: #fff;
margin-left:25%;
padding-top: 300upx;
.tips{
text-align: left;
margin-top: 30upx;
}
}
} }
</style> </style>
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