1 changed files with 155 additions and 177 deletions
@ -1,187 +1,165 @@ |
|||||
<template> |
<template> |
||||
<view> |
<view> |
||||
<!-- 添加 --> |
<!-- 添加 --> |
||||
<button class="shadow round bg-cyan add-btn iconfont icon-plus" hover-class="cc-active" @tap="openPage('/pages/apply-code/apply-code')"></button> |
<button class="shadow round bg-cyan add-btn iconfont icon-plus" hover-class="cc-active" @tap="openPage('/pages/apply-code/apply-code')"></button> |
||||
<view v-if="tableList && tableList.length>0" class="cu-timeline" :key="index" v-for="(item,index) in tableList"> |
<view v-if="tableList && tableList.length > 0" class="cu-timeline" :key="index" v-for="(item, index) in tableList"> |
||||
<view class="cu-time">{{ +item.time | formatDate }}</view> |
<view class="cu-time">{{ +item.time | formatDate }}</view> |
||||
<view class="cu-item text-blue cuIcon-locationfill"> |
<view class="cu-item text-blue cuIcon-locationfill"> |
||||
<view class="content shadow-blur bg-blue light"> |
<view class="content shadow-blur bg-blue light">{{ item.district }},{{ item.address }}</view> |
||||
{{ item.district }},{{ item.address }} |
</view> |
||||
</view> |
<view class="cu-item text-green cuIcon-wefill"> |
||||
</view> |
<view class="content shadow-blur light" :class="item.healthLevel === 0 ? 'bg-green' : item.healthLevel === 1 ? 'bg-yellow' : 'bg-red'"> |
||||
<view class="cu-item text-green cuIcon-wefill"> |
<view class="margin-bottom flex"> |
||||
<view class="content shadow-blur light" |
体温:{{ item.animalHeat }}℃, |
||||
:class="item.healthLevel === 0 ? 'bg-green' : item.healthLevel === 1 ? 'bg-yellow' : 'bg-red'" |
<text v-for="state in status" :key="state.id"> |
||||
> |
<text v-if="state.id === item.healthTypeId">状态:{{ state.name }}</text> |
||||
<view class="margin-bottom flex"> |
</text> |
||||
体温:{{ item.animalHeat }}℃, |
</view> |
||||
<text v-for="state in status" :key="state.id"> |
<view> |
||||
<text v-if="state.id === item.healthTypeId">状态:{{ state.name }}</text> |
<text class="radius bg-red margin-tb margin-right padding-xs" v-show="item.touchHubei === 1">武汉接触史</text> |
||||
</text> |
<text class="radius bg-red margin-tb margin-right padding-xs" v-show="item.touchSick === 1">患者接触史</text> |
||||
</view> |
</view> |
||||
<view> |
<view class="margin-tb-sm"> |
||||
<text class="radius bg-red margin-tb margin-right padding-xs" v-show="item.touchHubei === 1"> |
<text class="radius bg-red margin-tb margin-right padding-xs" v-show="item.touchOverseas === 1">境外人员接触史</text> |
||||
武汉接触史 |
<text class="radius bg-green margin-tb margin-right padding-xs" v-if="item.schoolLocation === 1">在校</text> |
||||
</text> |
<text class="radius bg-green margin-tb margin-right padding-xs" v-else>不在校</text> |
||||
<text class="radius bg-red margin-tb margin-right padding-xs" v-show="item.touchSick === 1"> |
</view> |
||||
患者接触史 |
<view class="margin-top">紧急联系人:{{ item.emergencyName }} {{ item.emergencyPhone }}</view> |
||||
</text> |
<view class="margin-top" v-show="item.remark || item.filePath.length > 0"> |
||||
</view> |
备注:{{ item.remark }} |
||||
<view class="margin-tb-sm"> |
<view class="padding-top"> |
||||
<text class="radius bg-red margin-tb margin-right padding-xs" v-show="item.touchOverseas === 1"> |
<image |
||||
境外人员接触史 |
@tap="viewImage(item.filePath, i)" |
||||
</text> |
:key="i" |
||||
<text class="radius bg-green margin-tb margin-right padding-xs" v-if="item.schoolLocation === 1"> |
v-for="(file, i) in item.filePath" |
||||
在校 |
:src="file" |
||||
</text> |
style="width: 69px;height: 75px;" |
||||
<text class="radius bg-green margin-tb margin-right padding-xs" v-else> |
class="margin-lr-xs" |
||||
不在校 |
></image> |
||||
</text> |
</view> |
||||
</view> |
</view> |
||||
<view class="margin-top">紧急联系人:{{ item.emergencyName }} {{ item.emergencyPhone }}</view> |
</view> |
||||
<view class="margin-top" v-show="item.remark || item.filePath.length > 0"> |
</view> |
||||
备注:{{ item.remark }} |
</view> |
||||
<view class="margin-top"> |
<view v-if="tableList && tableList.length === 0" class="padding-lg">您还没有申请健康码,请点击右下角加号申请健康码。</view> |
||||
<image @tap="viewImage(item.filePath,index)" :key="index" v-for="(file,index) in item.filePath" :src="file" style="width: 69px;height: 75px;" class="margin-lr-xs"></image> |
</view> |
||||
</view> |
|
||||
</view> |
|
||||
</view> |
|
||||
</view> |
|
||||
</view> |
|
||||
<view v-if="tableList && tableList.length === 0" class="padding-lg"> |
|
||||
您还没有申请健康码,请点击右下角加号申请健康码。 |
|
||||
</view> |
|
||||
</view> |
|
||||
|
|
||||
</template> |
</template> |
||||
|
|
||||
<script> |
<script> |
||||
import { |
import { formatDate } from 'common/script/filters'; |
||||
formatDate |
import { showToast } from 'common/script/util'; |
||||
} from 'common/script/filters'; |
import { HEALTH_SIGN_HISTORY } from 'api/api'; |
||||
import { |
import { mapState, mapMutations } from 'vuex'; |
||||
showToast |
|
||||
} from 'common/script/util'; |
|
||||
import { |
|
||||
HEALTH_SIGN_HISTORY |
|
||||
} from 'api/api'; |
|
||||
import { mapState,mapMutations } from 'vuex'; |
|
||||
|
|
||||
export default { |
|
||||
data() { |
|
||||
return { |
|
||||
tableList: [], |
|
||||
}; |
|
||||
}, |
|
||||
|
|
||||
computed: mapState('user', ['token','userInfo','status']), |
export default { |
||||
|
data() { |
||||
|
return { |
||||
|
tableList: [] |
||||
|
}; |
||||
|
}, |
||||
|
|
||||
// 时间戳转化日期 |
computed: mapState('user', ['token', 'userInfo', 'status']), |
||||
filters: { |
|
||||
formatDate(time) { |
|
||||
var data = new Date(time); |
|
||||
return formatDate(data, 'MM-dd'); |
|
||||
} |
|
||||
}, |
|
||||
|
|
||||
onLoad() { |
// 时间戳转化日期 |
||||
const startTime = +this.$moment() |
filters: { |
||||
.startOf('year') |
formatDate(time) { |
||||
.format('x'); |
var data = new Date(time); |
||||
const endTime = +this.$moment() |
return formatDate(data, 'MM-dd'); |
||||
.endOf('day') |
} |
||||
.format('x'); |
}, |
||||
const params = { |
|
||||
param: { |
|
||||
startTime, |
|
||||
endTime, |
|
||||
token: this.token |
|
||||
} |
|
||||
}; |
|
||||
this.getHealthSignHistory(params); |
|
||||
}, |
|
||||
|
|
||||
methods: { |
onLoad() { |
||||
...mapMutations('user', ['setStatus','setUserInfo']), |
const startTime = +this.$moment() |
||||
|
.startOf('year') |
||||
|
.format('x'); |
||||
|
const endTime = +this.$moment() |
||||
|
.endOf('day') |
||||
|
.format('x'); |
||||
|
const params = { |
||||
|
param: { |
||||
|
startTime, |
||||
|
endTime, |
||||
|
token: this.token |
||||
|
} |
||||
|
}; |
||||
|
this.getHealthSignHistory(params); |
||||
|
}, |
||||
|
|
||||
// 获取健康打卡记录 |
methods: { |
||||
async getHealthSignHistory(params) { |
...mapMutations('user', ['setStatus', 'setUserInfo']), |
||||
try { |
|
||||
const res = await this.$http.post(HEALTH_SIGN_HISTORY, params); |
|
||||
const { |
|
||||
success, |
|
||||
code, |
|
||||
msg, |
|
||||
data |
|
||||
} = res.data; |
|
||||
if (success && code === 200) { |
|
||||
this.success = true; |
|
||||
this.tableList = data; |
|
||||
} else { |
|
||||
uni.showToast({ |
|
||||
title: msg || '获取健康打卡记录失败', |
|
||||
icon: 'none' |
|
||||
}); |
|
||||
} |
|
||||
} catch (error) { |
|
||||
console.log('error: ', error); |
|
||||
if (error.msg) { |
|
||||
uni.showToast({ |
|
||||
title: error.msg || '获取健康打卡记录失败', |
|
||||
icon: 'none' |
|
||||
}); |
|
||||
} |
|
||||
} |
|
||||
}, |
|
||||
|
|
||||
// 预览图片 |
// 获取健康打卡记录 |
||||
viewImage(filePath,index) { |
async getHealthSignHistory(params) { |
||||
console.log(filePath,index) |
try { |
||||
if(filePath && filePath.length > 0){ |
const res = await this.$http.post(HEALTH_SIGN_HISTORY, params); |
||||
uni.previewImage({ |
const { success, code, msg, data } = res.data; |
||||
urls: filePath, |
if (success && code === 200) { |
||||
current:filePath[index] |
this.success = true; |
||||
}) |
this.tableList = data; |
||||
} |
} else { |
||||
}, |
uni.showToast({ |
||||
|
title: msg || '获取健康打卡记录失败', |
||||
|
icon: 'none' |
||||
|
}); |
||||
|
} |
||||
|
} catch (error) { |
||||
|
console.log('error: ', error); |
||||
|
if (error.msg) { |
||||
|
uni.showToast({ |
||||
|
title: error.msg || '获取健康打卡记录失败', |
||||
|
icon: 'none' |
||||
|
}); |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
|
||||
}, |
// 预览图片 |
||||
}; |
viewImage(filePath, index) { |
||||
|
if (filePath && filePath.length > 0) { |
||||
|
uni.previewImage({ |
||||
|
urls: filePath, |
||||
|
current: filePath[index], |
||||
|
indicator: 'number', |
||||
|
}); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
}; |
||||
</script> |
</script> |
||||
|
|
||||
<style lang="scss" scoped> |
<style lang="scss" scoped> |
||||
.data-wrap { |
.data-wrap { |
||||
display: flex; |
display: flex; |
||||
flex-direction: column; |
flex-direction: column; |
||||
align-items: left; |
align-items: left; |
||||
justify-content: flex-start; |
justify-content: flex-start; |
||||
padding: 40rpx 0; |
padding: 40rpx 0; |
||||
|
|
||||
.data-item { |
.data-item { |
||||
display: flex; |
display: flex; |
||||
flex-wrap: wrap; |
flex-wrap: wrap; |
||||
align-items: left; |
align-items: left; |
||||
font-size: 36rpx; |
font-size: 36rpx; |
||||
margin-bottom: 20rpx; |
margin-bottom: 20rpx; |
||||
|
|
||||
.data-title{ |
.data-title { |
||||
line-height: 60rpx; |
line-height: 60rpx; |
||||
color: $black; |
color: $black; |
||||
} |
} |
||||
} |
} |
||||
} |
} |
||||
|
|
||||
.add-btn{ |
.add-btn { |
||||
position: fixed; |
position: fixed; |
||||
bottom: 40rpx; |
bottom: 40rpx; |
||||
right: 40rpx; |
right: 40rpx; |
||||
width: 96rpx; |
width: 96rpx; |
||||
height: 96rpx; |
height: 96rpx; |
||||
line-height: 96rpx; |
line-height: 96rpx; |
||||
padding: 0; |
padding: 0; |
||||
z-index: 1; |
z-index: 1; |
||||
} |
} |
||||
.add-btn::after{ |
.add-btn::after { |
||||
border: none; |
border: none; |
||||
} |
} |
||||
</style> |
</style> |
||||
|
Loading…
Reference in new issue