Commit ba765a3e authored by sjf1256754123's avatar sjf1256754123

demo

parent 79ea1e7e
This diff is collapsed.
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<view v-show="abnormalFlag"> <view v-show="abnormalFlag">
<view class="cu-form-group"> <view class="cu-form-group">
<view class="title">体温值:</view> <view class="title">体温值:</view>
<input class="text-left" placeholder="请输入体温" type="number" :value="temperature" name="input" @input="updateInputVal($event,'temperature')"></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: 55upx;">
<button class="btnSubmit" type="primary" @click="submit">提交</button> <button class="btnSubmit" type="primary" @click="submit">提交</button>
...@@ -24,6 +24,11 @@ ...@@ -24,6 +24,11 @@
name: "home", name: "home",
data() { data() {
return { return {
form:{
heat:'',
heatNomal:-1,
userId:''
},
temperature:'', temperature:'',
abnormalFlag:false abnormalFlag:false
}; };
...@@ -35,10 +40,18 @@ ...@@ -35,10 +40,18 @@
methods: { methods: {
// 体温正常 // 体温正常
normal() { normal() {
uni.showToast({ this.form.heatNomal = 0
icon: 'success', this.form.userId = this.$store.state.user.userInfo.id
title: "允许通行!" 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() { abnormal() {
...@@ -46,13 +59,24 @@ ...@@ -46,13 +59,24 @@
}, },
// 更新输入框绑定的表单内容 // 更新输入框绑定的表单内容
updateInputVal(event, props) { updateInputVal(event, props) {
this.temperature = event.target.value this.form[props] = event.target.value
}, },
// 提交异常体温 // 提交异常体温
submit(){ submit(){
uni.showToast({ this.form.heatNomal = this.form.heat<37.2?0:1
icon: 'none', this.form.userId = this.$store.state.user.userInfo.id
title: "提交异常体温!" 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)
}) })
} }
} }
...@@ -67,7 +91,7 @@ ...@@ -67,7 +91,7 @@
width: 100vw; width: 100vw;
background-color: #24A1E3; background-color: #24A1E3;
.btnList{ .btnList{
padding-top: 305upx; padding-top: 235upx;
.btnNormal,.btnAbnormal,.btnSubmit{ .btnNormal,.btnAbnormal,.btnSubmit{
background-color: #92d0f1; background-color: #92d0f1;
color: #FFFFFF; color: #FFFFFF;
......
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