健康上报

This commit is contained in:
liuye
2022-02-09 14:47:06 +08:00
parent ef27a36a58
commit 2d90591da4
2 changed files with 208 additions and 50 deletions

View File

@@ -7,32 +7,32 @@
<div class="form-item__title">
<span class="label">姓名</span>
</div>
<div class="form-item__right">张三</div>
<div class="form-item__right"><AiOpenData v-if="user.wxUserId" type="userName" :openid="user.wxUserId" /></div>
</div>
</div>
</div>
<div class="time-content">
<div class="title">上报记录<span>(12)</span></div>
<div class="title">上报记录<span>({{month}})</span></div>
<div class="time">
<div class="week-list">
<span v-for="(item, index) in weekList" :key="index">{{item}}</span>
</div>
<div class="day-list">
<div v-for="(item, index) in 30" :key="index" class="item" :class="index == 7 ? 'active' : ''">
<div class="num">{{item}}</div>
<span class="status"></span>
<div v-for="(item, index) in dayList" :key="index" class="item" :class="selectDay == item.day ? 'active' : ''" @click="dayClick(item)">
<div class="num">{{item.day}}</div>
<span class="status" :class="'bg-'+item.status" v-if="item.day"></span>
</div>
</div>
</div>
</div>
<div class="form-item__group">
<div class="form-item__group" v-if="healthInfo.id">
<div class="group_title">健康状况</div>
<div class="form-item">
<div class="form-item__wrapper">
<div class="form-item__title">
<span class="label">当前体温</span>
</div>
<div class="form-item__right">36.2</div>
<div class="form-item__right" :style="healthInfo.temperature >= 37.3 ? 'color:#f46;' : ''">{{healthInfo.temperature}}</div>
</div>
</div>
<div class="form-item">
@@ -40,7 +40,9 @@
<div class="form-item__title">
<span class="label" style="width:190px;">14天内是否接触新冠确诊或疑似患者</span>
</div>
<div class="form-item__right"></div>
<div class="form-item__right">
<div class="value" :class="'color-'+healthInfo.touchInFourteen">{{$dict.getLabel('epidemicTouchInFourteen', healthInfo.touchInFourteen)}}</div>
</div>
</div>
</div>
<div class="form-item">
@@ -48,7 +50,11 @@
<div class="form-item__title">
<span class="label">当前健康状况</span>
</div>
<div class="form-item__right">感冒症状;乏力咳嗽发烧肌肉痛头痛</div>
<div class="form-item__right">
<span>
<span v-for="(item, index) in healthInfo.health" :key="index" :style="item != 0 ? 'color:#FF4466;' : ''"><span v-if="index>0">;</span>{{$dict.getLabel('epidemicRecentHealth', item)}}</span>
</span>
</div>
</div>
</div>
</div>
@@ -66,22 +72,76 @@ export default {
name: 'OtherStatistics',
data() {
return {
weekList: ['一', '二', '三', '四', '五', '六', '日']
weekList: ['一', '二', '三', '四', '五', '六', '日'],
dayList: [],
month: '',
selectDay: '',
healthInfo: {},
userId: ''
}
},
computed: {
...mapState(['user']),
},
onLoad() {
onLoad(option) {
this.userId = option.id
var date = new Date();
this.selectDay = date.getDate()
this.month = date.getMonth() + 1
this.$dict.load('epidemicTouchInFourteen', 'epidemicRecentHealth').then(() => {
this.getStatis()
})
},
onShow() {
document.title = '健康上报'
},
methods: {
dayClick(item) {
this.healthInfo = {}
this.selectDay = item.day
if(!item.id) {
return this.$u.toast("当日未上报");
}
this.$http.post(`/app/appepidemichealthreport/queryDetailById?id=${item.id}`).then((res) => {
if (res.code == 0) {
this.healthInfo = res.data
this.healthInfo.health = res.data.health.split(',')
}
})
},
getStatis() {
this.dayList = []
this.$http.post(`/app/appepidemichealthreport/statistic?userId=${this.userId}`).then((res) => {
if (res.code == 0) {
Object.keys(res.data).forEach((key) => {
var info = {
week: res.data[key].week,
day: key,
status: res.data[key].status || '2',
id: res.data[key].id || '',
}
this.dayList.push(info)
})
var week = Number(this.dayList[0].week) - 1
if(week > 0) {
for(var i= 0; i<week; i++){
var info = {
id: '',
}
this.dayList.unshift(info)
}
}
this.dayList.map((item) => {
if(item.day == this.selectDay && item.id) {
this.dayClick(item)
}
})
}
})
},
back() {
uni.navigateBack()
}
},
},
}
</script>
@@ -206,8 +266,7 @@ uni-page-body {
display: flex;
align-items: center;
justify-content: space-between;
height: 128px;
padding-right: 28px;
padding: 40px 28px 40px 0;
border-bottom: 1px solid #dddddd;
input {
@@ -233,9 +292,7 @@ uni-page-body {
max-width: 400px;
margin-right: 8px;
color: #333333;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
word-break: break-all;
}
i {
@@ -345,7 +402,6 @@ uni-page-body {
font-size: 32px!important;
}
.group_title{
width: 100%;
height: 116px;
line-height: 116px;
background: #FFF;
@@ -418,15 +474,14 @@ uni-page-body {
top: 60px;
left: 50%;
margin-left: -4px;
background: #3B87F6;
}
.status0{
.bg-2{
background: #999;
}
.status1{
.bg-1{
background: #3B87F6;
}
.status2{
.bg-0{
background: #f46;
}
}
@@ -445,5 +500,14 @@ uni-page-body {
.pad-b112{
padding-bottom: 112px;
}
.color-0{
color: #42D784;
}
.color-1{
color: #f46;
}
.color-2{
color: #1365DD;
}
}
</style>
</style>