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
<template name="index">
<view class="index">
<view class="temp">
<view class="btnList">
<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: 55upx;">
<button class="btnSubmit" type="primary" @click="submit">提交</button>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
components: {},
name: "home",
data() {
return {
form:{
heat:'',
heatNomal:-1,
userId:''
},
temperature:'',
abnormalFlag:false
};
},
onLoad: function(option) {
console.log(option)
},
onShow() {},
methods: {
// 体温正常
normal() {
this.form.heatNomal = 0
this.form.userId = this.$store.state.user.userInfo.id
this.form.heat = ''
this.$http.post(`/sict-ncov/report/daily/heat`,this.form).then(res => {
const d = res.data
if (d.code == 1) {
console.log(d)
}
}).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
console.log(this.form)
// uni.showToast({
// icon: 'none',
// title: "提交异常体温!"
// })
this.$http.post(`/sict-ncov/report/daily/heat`,this.form).then(res => {
const d = res.data
if (d.code == 1) {
console.log(d)
}
}).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%;
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;
}
}
}
</style>