Commit cbbecf99 authored by sjf1256754123's avatar sjf1256754123

demo

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