Files
dvcp_v2_wxcp_app/library/project/saas/AppWalkask/detail.vue

160 lines
3.3 KiB
Vue
Raw Normal View History

2022-01-25 16:31:39 +08:00
<template>
<div class="detail">
<div class="header-top">
<div class="hint">{{ data.title }}</div>
<div class="walk-item">
<span>走访对象</span>
2022-08-18 17:29:53 +08:00
<span class="info-value">
2022-01-25 16:31:39 +08:00
{{ data.name }}
2022-08-18 17:29:53 +08:00
<span v-if="data.labelList">
<span class="tags" v-for="(item, index) in data.labelList" :key="index">{{ item }}</span>
</span>
2022-01-25 16:31:39 +08:00
</span>
</div>
<div class="walk-item" v-if="data.reality">
<span>现实状态</span>
<span>{{ $dict.getLabel('realityStatus', data.reality) }} </span>
</div>
<div class="walk-item">
<span>走访人员</span>
2022-03-15 15:37:56 +08:00
<span><AiOpenData v-if="data.createUserName" type="userName" :openid="data.createUserName" style="display: inline-block" /></span>
2022-01-25 16:31:39 +08:00
</div>
<div class="walk-item">
<span>走访时间</span>
2022-03-15 15:37:56 +08:00
<span>{{ data.visitTime }}</span>
2022-01-25 16:31:39 +08:00
</div>
</div>
<div class="header-middle">
<div class="hint-con" v-if="data.description">{{ data.description }}</div>
<div class="imgs">
<img :src="item.url" alt="" v-for="(item, index) in data.images" :key="index" @click.stop="previewImage(data.images, item.url)" />
</div>
</div>
</div>
</template>
<script>
export default {
name: 'detail',
components: {},
props: {
params: {},
},
data() {
return {
data: {},
id: '',
}
},
computed: {},
onLoad(o) {
this.id = o.id
2022-02-11 14:26:59 +08:00
this.$dict.load('realityStatus', 'appSpecialTypeFive').then(() => {
2022-01-25 16:31:39 +08:00
this.getDetail()
})
},
onShow() {
document.title = '走访详情'
},
mounted() {},
methods: {
getDetail() {
this.$http.post(`/app/appvisitvondolence/queryDetailById?id=${this.id}`).then((res) => {
if (res?.data) {
this.data = res.data
if (this.data.images) {
this.data.images = JSON.parse(this.data.images || '[]')
2022-08-18 17:29:53 +08:00
this.data.labelList = this.data.labels.split(',') || []
2022-01-25 16:31:39 +08:00
}
}
})
},
previewImage(images, img) {
uni.previewImage({
urls: images.map((v) => v.url),
current: img,
})
},
},
}
</script>
<style lang="scss" scoped>
2022-03-15 15:37:56 +08:00
uni-page-body {
height: 100%;
}
2022-01-25 16:31:39 +08:00
.detail {
height: 100%;
background: #fff;
.header-top {
background: #3975c6;
padding: 24px 32px 32px;
.hint {
font-size: 40px;
font-weight: 500;
color: #ffffff;
}
.walk-item {
font-size: 28px;
color: #d7e3f3;
margin-top: 16px;
.tags {
display: inline-block;
padding: 0 12px;
height: 40px;
border-radius: 4px;
2022-03-15 15:37:56 +08:00
border: 1px solid #ffffff;
2022-08-19 14:14:10 +08:00
margin: 0 8px 0 0;
2022-08-18 17:29:53 +08:00
}
.tags:nth-of-type(1) {
margin-left: 8px;
2022-01-25 16:31:39 +08:00
}
}
}
.header-middle {
background: #fff;
padding: 32px 32px 32px 32px;
.hint-con {
font-size: 32px;
color: #666666;
2022-03-15 15:41:43 +08:00
line-height: 56px;
2022-01-25 16:31:39 +08:00
}
.imgs {
margin: 32px 0 48px 0;
img {
width: 218px;
height: 218px;
margin-right: 16px;
}
img:nth-child(3n + 0) {
margin-right: 0;
}
}
}
2022-08-18 17:29:53 +08:00
.info-value{
display: inline-block;
width: 540px;
2022-08-19 14:14:10 +08:00
overflow:hidden;
white-space: nowrap;
text-overflow: ellipsis;
2022-08-18 17:29:53 +08:00
vertical-align: text-top;
}
2022-01-25 16:31:39 +08:00
}
</style>