Browse Source

我的健康打卡预览图修复

remotes/origin/HEAD
wally 5 years ago
parent
commit
e3e8a8c7e1
  1. 76
      pages/my-code/my-code.vue

76
pages/my-code/my-code.vue

@ -5,14 +5,10 @@
<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>
<view class="cu-item text-green cuIcon-wefill"> <view class="cu-item text-green cuIcon-wefill">
<view class="content shadow-blur light" <view class="content shadow-blur light" :class="item.healthLevel === 0 ? 'bg-green' : item.healthLevel === 1 ? 'bg-yellow' : 'bg-red'">
:class="item.healthLevel === 0 ? 'bg-green' : item.healthLevel === 1 ? 'bg-yellow' : 'bg-red'"
>
<view class="margin-bottom flex"> <view class="margin-bottom flex">
体温{{ item.animalHeat }} 体温{{ item.animalHeat }}
<text v-for="state in status" :key="state.id"> <text v-for="state in status" :key="state.id">
@ -20,57 +16,45 @@
</text> </text>
</view> </view>
<view> <view>
<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.touchHubei === 1">武汉接触史</text>
武汉接触史 <text class="radius bg-red margin-tb margin-right padding-xs" v-show="item.touchSick === 1">患者接触史</text>
</text>
<text class="radius bg-red margin-tb margin-right padding-xs" v-show="item.touchSick === 1">
患者接触史
</text>
</view> </view>
<view class="margin-tb-sm"> <view class="margin-tb-sm">
<text class="radius bg-red margin-tb margin-right padding-xs" v-show="item.touchOverseas === 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-green margin-tb margin-right padding-xs" v-if="item.schoolLocation === 1">
在校
</text>
<text class="radius bg-green margin-tb margin-right padding-xs" v-else>
不在校
</text>
</view> </view>
<view class="margin-top">紧急联系人:{{ item.emergencyName }}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{{ item.emergencyPhone }}</view> <view class="margin-top">紧急联系人:{{ item.emergencyName }}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{{ item.emergencyPhone }}</view>
<view class="margin-top" v-show="item.remark || item.filePath.length > 0"> <view class="margin-top" v-show="item.remark || item.filePath.length > 0">
备注:{{ item.remark }} 备注:{{ item.remark }}
<view class="margin-top"> <view class="padding-top">
<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> <image
</view> @tap="viewImage(item.filePath, i)"
:key="i"
v-for="(file, i) in item.filePath"
:src="file"
style="width: 69px;height: 75px;"
class="margin-lr-xs"
></image>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
<view v-if="tableList && tableList.length === 0" class="padding-lg">
您还没有申请健康码请点击右下角加号申请健康码
</view> </view>
<view v-if="tableList && tableList.length === 0" class="padding-lg">您还没有申请健康码请点击右下角加号申请健康码</view>
</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 {
showToast
} from 'common/script/util';
import {
HEALTH_SIGN_HISTORY
} from 'api/api';
import { mapState, mapMutations } from 'vuex'; import { mapState, mapMutations } from 'vuex';
export default { export default {
data() { data() {
return { return {
tableList: [], tableList: []
}; };
}, },
@ -108,12 +92,7 @@
async getHealthSignHistory(params) { async getHealthSignHistory(params) {
try { try {
const res = await this.$http.post(HEALTH_SIGN_HISTORY, params); const res = await this.$http.post(HEALTH_SIGN_HISTORY, params);
const { const { success, code, msg, data } = res.data;
success,
code,
msg,
data
} = res.data;
if (success && code === 200) { if (success && code === 200) {
this.success = true; this.success = true;
this.tableList = data; this.tableList = data;
@ -136,16 +115,15 @@
// //
viewImage(filePath, index) { viewImage(filePath, index) {
console.log(filePath,index)
if (filePath && filePath.length > 0) { if (filePath && filePath.length > 0) {
uni.previewImage({ uni.previewImage({
urls: filePath, urls: filePath,
current:filePath[index] current: filePath[index],
}) indicator: 'number',
});
}
}
} }
},
},
}; };
</script> </script>

Loading…
Cancel
Save