Files
dvcp_v2_wxcp_app/src/apps/AppEpidemicSituation/HealthDetail.vue

268 lines
6.4 KiB
Vue
Raw Normal View History

2022-01-10 14:16:05 +08:00
<template>
2022-01-10 15:05:53 +08:00
<div class="HealthDetail">
2022-01-11 19:18:22 +08:00
<div class="top">
2022-01-10 15:05:53 +08:00
<div class="templates">
2022-01-11 19:18:22 +08:00
<img :src="userList.avatar" alt="" v-if="userList.avatar" />
2022-01-10 15:05:53 +08:00
<img src="./components/img/user-img.png" alt="" />
<div class="rightCont">
<div class="rightContLeft">
<div class="nameLeft">
<div class="nameTop">
2022-01-11 19:18:22 +08:00
<div class="names">{{ userList.name }}</div>
<div class="types" v-if="userList.status == '0'">异常</div>
2022-01-10 15:05:53 +08:00
</div>
<div class="nameBottom">
<span>上报第</span>
2022-01-11 19:18:22 +08:00
<span class="num">{{ userList.diffNum }}</span>
2022-01-10 15:05:53 +08:00
<span></span>
</div>
</div>
</div>
2022-01-11 19:18:22 +08:00
<div class="rightContRight" @click.stop="callPhone(userList.phone)">
2022-01-10 15:05:53 +08:00
<img src="./components/img/phone2@.png" alt="" />
<span class="call">拨打电话</span>
</div>
</div>
</div>
</div>
<div class="middle">
<div class="record">异常情况记录</div>
2022-01-11 19:18:22 +08:00
<template v-if="data.length">
<div class="templatess" v-for="(item, i) in data" :key="i" @click="toUserDetail(item)">
2022-01-10 15:05:53 +08:00
<div class="left">
2022-01-11 19:18:22 +08:00
<div class="recordType recordType1" v-if="item.status == 1">正常</div>
<div class="recordType recordType2" v-if="item.status == 0">异常</div>
2022-01-10 15:05:53 +08:00
</div>
<div class="right">
2022-01-11 19:18:22 +08:00
<div class="times">{{ item.checkTime }}</div>
2022-01-10 15:05:53 +08:00
<u-icon name="arrow-right" color="#CCCCCC"></u-icon>
</div>
</div>
</template>
2022-01-11 19:18:22 +08:00
<AiEmpty description="暂无数据" class="emptyWrap" v-else></AiEmpty>
2022-01-10 15:05:53 +08:00
</div>
2022-01-12 14:33:54 +08:00
<div class="fixedBtn" @click="toErr" v-if="userList.status == '0'">异常情况处理</div>
2022-01-10 15:05:53 +08:00
</div>
2022-01-10 14:16:05 +08:00
</template>
<script>
2022-01-10 15:28:18 +08:00
import { mapState } from 'vuex'
2022-01-10 14:16:05 +08:00
export default {
name: 'HealthDetail',
components: {},
props: {},
data() {
2022-01-10 15:05:53 +08:00
return {
data: [],
2022-01-11 15:56:08 +08:00
id: '',
2022-01-11 19:18:22 +08:00
name: '',
userList: [],
2022-01-10 15:05:53 +08:00
}
2022-01-10 14:16:05 +08:00
},
2022-01-10 15:28:18 +08:00
computed: {
...mapState(['user']),
},
2022-01-10 14:16:05 +08:00
watch: {},
2022-01-11 15:56:08 +08:00
onLoad(o) {
2022-01-11 19:18:22 +08:00
console.log(o)
2022-01-11 15:56:08 +08:00
if (o.id) {
2022-01-11 19:18:22 +08:00
this.name = o.name
2022-01-11 15:56:08 +08:00
this.id = o.id
2022-01-11 19:18:22 +08:00
this.phone = o.phone
this.getUser()
2022-01-11 15:56:08 +08:00
}
this.getRecord()
2022-01-11 19:18:22 +08:00
uni.$on('updateDetail', () => {
2022-01-12 14:27:58 +08:00
this.getUser()
2022-01-11 19:18:22 +08:00
this.getRecord()
})
2022-01-11 15:56:08 +08:00
},
onShow() {
document.title = '健康监测'
},
2022-01-10 15:05:53 +08:00
methods: {
2022-01-11 19:18:22 +08:00
getUser() {
2022-01-11 15:56:08 +08:00
this.$loading()
this.$http
2022-01-11 19:18:22 +08:00
.post(`/app/appepidemicreportmember/queryDetailById?id=${this.id}`)
2022-01-11 15:56:08 +08:00
.then((res) => {
2022-01-12 14:26:18 +08:00
if (res.code == 0) {
2022-01-11 19:18:22 +08:00
this.userList = res.data
2022-01-11 15:56:08 +08:00
this.$hideLoading()
} else {
this.$hideLoading()
}
})
.catch(() => {
this.$hideLoading()
})
},
getRecord() {
this.$loading()
this.$http
2022-01-11 19:18:22 +08:00
.post(`/app/appepidemichealthreport/list?memberId=${this.id}`)
2022-01-11 15:56:08 +08:00
.then((res) => {
2022-01-12 14:26:18 +08:00
if (res.code == 0) {
2022-01-11 19:18:22 +08:00
this.data = this.current > 1 ? [...this.data, ...res.data.records] : res.data.records
2022-01-11 15:56:08 +08:00
this.$hideLoading()
} else {
this.$hideLoading()
}
})
.catch(() => {
this.$hideLoading()
})
},
2022-01-11 19:18:22 +08:00
callPhone(phone) {
uni.makePhoneCall({ phoneNumber: phone })
},
toUserDetail(item) {
2022-01-10 15:05:53 +08:00
uni.navigateTo({
2022-01-12 13:59:35 +08:00
url: `./UserDetail?id=${item.id}&temperature=${item.temperature}&touchInFourteen=${item.touchInFourteen}&health=${item.health}&checkTime=${item.checkTime}&checkResult=${item.checkResult}&checkPhoto=${item.checkPhoto}&status=${item.status}&memberId=${this.id}&vaccine=${item.vaccine}&healthCode=${item.healthCode}`,
2022-01-10 15:05:53 +08:00
})
},
toErr() {
uni.navigateTo({
2022-01-11 19:18:22 +08:00
url: `./ErrorDetail?id=${this.id}`,
2022-01-10 15:05:53 +08:00
})
},
},
2022-01-10 14:16:05 +08:00
}
</script>
<style scoped lang="scss">
.HealthDetail {
2022-01-11 19:18:22 +08:00
height: 100%;
2022-01-10 15:05:53 +08:00
padding-bottom: 120px;
2022-01-10 17:08:12 +08:00
background: #f3f6f9;
2022-01-10 15:05:53 +08:00
.top {
.templates {
display: flex;
align-items: center;
padding: 32px;
box-shadow: inset 0px -1px 0px 0px #dddddd;
background: #fff;
img {
width: 128px;
height: 128px;
// border-radius: 50%;
// border: 1px solid #cccccc;
}
.rightCont {
display: flex;
justify-content: space-between;
margin-left: 32px;
width: 100%;
.rightContLeft {
// display: flex;
// justify-content: space-between;
// align-items: center;
// width: 100%;
.nameLeft {
.nameTop {
display: flex;
.names {
font-size: 32px;
font-weight: 500;
color: #333333;
}
.types {
margin-left: 16px;
padding: 4px 16px 8px 16px;
background: #faeceb;
border-radius: 20px;
font-size: 24px;
color: #cd413a;
}
}
.nameBottom {
margin-top: 12px;
font-size: 28px;
color: #999999;
.num {
color: #135ab8;
}
}
}
}
.rightContRight {
display: flex;
flex-direction: column;
align-items: center;
width: 25%;
img {
width: 64px;
height: 64px;
}
.call {
font-size: 24px;
color: #3d94fb;
}
}
}
}
}
.middle {
margin-top: 16px;
background: #fff;
.record {
padding: 26px 0 26px 32px;
box-shadow: inset 0px -1px 0px 0px #dddddd;
}
.templatess {
display: flex;
justify-content: space-between;
padding: 28px 32px;
box-shadow: inset 0px -1px 0px 0px #dddddd;
.left,
.right {
display: flex;
.recordType {
font-size: 28px;
font-weight: 500;
}
.recordType1 {
color: #5aad6a;
}
.recordType2 {
color: #cd413a;
}
}
}
.emptyWrap {
background: #f5f5f5;
margin-top: 0 !important;
}
}
.fixedBtn {
position: fixed;
bottom: 0;
width: 100%;
padding: 34px 0;
text-align: center;
background: #1365dd;
box-sizing: border-box;
font-size: 32px;
font-weight: 500;
color: #ffffff;
}
2022-01-10 14:16:05 +08:00
}
</style>