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

123 lines
2.5 KiB
Vue
Raw Normal View History

2021-12-16 16:04:21 +08:00
<template>
<div class="Detail">
<div class="header-top">
2021-12-23 15:09:25 +08:00
<div class="titles">{{data.title}}</div>
2021-12-16 16:04:21 +08:00
<div class="titles-bottom">
<span>类型</span>
2021-12-23 15:09:25 +08:00
<span>{{selectList[data.showIndex].categoryName}}</span>
2021-12-16 16:04:21 +08:00
<span class="to-left">浏览量</span>
2021-12-23 15:09:25 +08:00
<span>{{data.viewCount}}</span>
2021-12-16 16:04:21 +08:00
</div>
</div>
<div class="header-middle">
2021-12-23 15:09:25 +08:00
<span class="contsnts">{{data.content}}</span>
<div class="img-list" v-if="data.files && data.files.length">
<img :src="item.accessUrl" alt="" v-for="(item, index) in data.files" :key="index" />
</div>
2021-12-16 16:04:21 +08:00
</div>
</div>
</template>
<script>
export default {
name: 'Detail',
components: {},
props: {},
data() {
2021-12-16 17:13:18 +08:00
return {
2021-12-23 15:09:25 +08:00
data: {},
2021-12-16 17:13:18 +08:00
id: '',
2021-12-23 15:09:25 +08:00
listName: '',
selectList: []
2021-12-16 17:13:18 +08:00
}
2021-12-16 16:04:21 +08:00
},
computed: {},
watch: {},
2021-12-16 17:13:18 +08:00
onLoad(o) {
this.id = o.id
2021-12-23 15:09:25 +08:00
this.listName = o.listName
this.getType()
2021-12-23 16:56:41 +08:00
uni.setNavigationBarTitle({title: this.listName})
2021-12-16 17:13:18 +08:00
},
2021-12-16 16:04:21 +08:00
mounted() {},
2021-12-16 17:13:18 +08:00
methods: {
getDetail() {
2021-12-23 15:09:25 +08:00
this.$http.post(`/app/appcontentinfo/queryDetailById?id=${this.id}`).then((res) => {
2021-12-16 17:13:18 +08:00
if (res?.data) {
this.data = res.data
2021-12-23 15:09:25 +08:00
if(this.selectList.length) {
this.selectList.map((item, index) => {
if(item.id == res.data.categoryId) {
this.data.showIndex = index
}
})
}
}
})
},
getType() {
this.$http.post(`/app/appcontentmoduleinfo/listByName?names=${this.listName}`).then((res) => {
if (res.code == 0) {
if(res.data && res.data[0].categoryList.length) {
this.selectList = res.data[0].categoryList
this.getDetail()
2021-12-16 17:13:18 +08:00
}
}
})
},
},
2021-12-16 16:04:21 +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;
}
img {
margin-top: 30px;
width: 686px;
height: 486px;
}
}
2021-12-23 15:09:25 +08:00
.img-list{
img{
width: 204px;
height: 204px;
margin: 0 8px 8px 0;
}
}
2021-12-16 16:04:21 +08:00
}
</style>