Files
dvcp_v2_wxcp_app/src/apps/AppUniMsg/Detail.vue

113 lines
2.1 KiB
Vue
Raw Normal View History

2021-12-21 19:13:37 +08:00
<template>
<div class="Detail">
<div class="header-top">
<div class="titles">{{ data.title }}</div>
<div class="titles-bottom">
<span>发布单位</span>
<span>{{ data.publishUnitName }}</span>
</div>
2022-01-07 10:25:59 +08:00
<div class="titles-bottom">
<span>发布时间</span>
<span>{{ data.createTime }}</span>
</div>
2021-12-21 19:13:37 +08:00
</div>
<div class="header-middle">
<span class="contsnts">{{ data.content }}</span>
2021-12-22 09:44:40 +08:00
<div class="imgs">
2021-12-23 16:48:14 +08:00
<img :src="item.url" alt="" v-for="(item, i) in data.images" :key="i" @click="previewImage(data.images, item.url)" />
2021-12-22 09:44:40 +08:00
</div>
2021-12-21 19:13:37 +08:00
</div>
</div>
</template>
<script>
export default {
name: 'Detail',
components: {},
props: {},
data() {
return {
data: [],
id: '',
}
},
computed: {},
watch: {},
onLoad(o) {
2022-01-04 16:06:12 +08:00
document.title = '小程序公告详情'
2021-12-21 19:13:37 +08:00
this.id = o.id
this.getDetail()
},
mounted() {},
methods: {
getDetail() {
this.$http.post(`/app/appmininotice/queryDetailById?id=${this.id}`).then((res) => {
if (res?.data) {
this.data = res.data
if (res.data.images) {
this.data.images = JSON.parse(res.data.images || '[]')
}
}
})
},
2021-12-24 11:26:12 +08:00
previewImage(images, img) {
2021-12-23 16:48:14 +08:00
uni.previewImage({
2021-12-24 11:26:12 +08:00
urls: images.map((v) => v.url),
current: img,
2021-12-23 16:48:14 +08:00
})
},
2021-12-21 19:13:37 +08:00
},
}
</script>
<style scoped lang="scss">
uni-page-body {
height: 100%;
}
.Detail {
height: 100%;
padding: 0 32px;
background: #fff;
.header-top {
padding: 40px 0 32px 0;
.titles {
font-size: 48px;
font-weight: 600;
}
.titles-bottom {
margin-top: 16px;
font-size: 30px;
color: #999999;
.to-left {
margin-left: 32px;
}
}
}
.header-middle {
padding: 32px 0;
.contsnts {
font-size: 36px;
line-height: 1.5;
word-break: break-all;
}
2021-12-22 09:44:40 +08:00
.imgs {
margin-top: 32px;
img {
width: 224px;
height: 218px;
margin-right: 8px;
}
img:nth-child(3n) {
margin-right: 0;
}
2021-12-21 19:13:37 +08:00
}
}
}
</style>