1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
<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?obj.userName:''}}</span>
<button class="btnNormal" type="primary" @click="normal">体温正常</button>
<button class="btnAbnormal" type="primary" @click="abnormal">体温异常</button>
</view>
<view v-show="abnormalFlag">
<view class="cu-form-group">
<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: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?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.heatNormal?'体温异常、建议劝返':'体温正常、允许通行'}}</span>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
components: {},
name: "home",
data() {
return {
form:{
heat:'',
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
this.form.heat = ''
this.$http.post(`/sict-ncov/report/daily/heat`,this.form).then(res => {
const d = res.data
if (d.code == 1) {
this.getData()
}
}).catch(err => {
console.log(err)
})
},
// 体温异常
abnormal() {
this.abnormalFlag = true
},
// 更新输入框绑定的表单内容
updateInputVal(event, props) {
this.form[props] = event.target.value
},
// 提交异常体温
submit(){
this.form.heatNomal = this.form.heat<37.2?0:1
this.form.userId = this.$store.state.user.userInfo.id
this.$http.post(`/sict-ncov/report/daily/heat`,this.form).then(res => {
const d = res.data
if (d.code == 1) {
this.getData()
}
}).catch(err => {
console.log(err)
})
}
}
}
</script>
<style lang="scss" scoped>
.temp {
font-size: 40px;
text-align: center;
height: 100vh;
width: 100vw;
background-color: #24A1E3;
.btnList{
padding-top: 235upx;
.btnNormal,.btnAbnormal,.btnSubmit{
background-color: #92d0f1;
color: #FFFFFF;
border-radius: 60upx;
width: 52%;
margin-top:75upx;
text-align: center;
}
.btnAbnormal{
margin-top:95upx;
}
}
.cu-form-group{
margin-top:55upx;
padding: 1upx 150upx;
background-color: #24A1E3;
.title,.text-left{
font-size: 40upx;
color:#FFFFFF;
}
.text-left{
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>