Files
dvcp_v2_webapp/project/fengdu/app/AppHelp/components/Detail.vue

280 lines
7.2 KiB
Vue
Raw Normal View History

2023-03-15 17:32:00 +08:00
<template>
<ai-detail class="detail">
<template slot="title">
2023-03-16 10:54:06 +08:00
<ai-title title="帖子详情" isShowBack isShowBottomBorder @onBackClick="cancel(false)">
2023-03-15 17:32:00 +08:00
</ai-title>
</template>
<template slot="content">
2023-03-16 10:54:06 +08:00
<ai-card title="帖子信息">
2023-03-15 17:32:00 +08:00
<template #content>
2023-03-16 10:54:06 +08:00
<div class="talk-info">
<div class="user">
2023-03-16 14:01:40 +08:00
<img :src="info.createUserAvatar" alt="">
2023-03-16 10:54:06 +08:00
<div class="info">
2023-03-16 14:01:40 +08:00
<h2>{{info.createUserName}}</h2>
2023-03-16 10:54:06 +08:00
<div class="time-flex">
2023-03-16 14:01:40 +08:00
<span class="area-name">{{info.publishDepartName}}</span>
<span>{{info.createTime}}</span>
2023-03-16 10:54:06 +08:00
</div>
</div>
</div>
<div class="content">
2023-03-16 14:01:40 +08:00
<span v-if="info.themeId">#{{info.themeInfo.title}}</span>{{info.content}}
2023-03-16 10:54:06 +08:00
</div>
<!-- <ai-uploader
:instance="instance"
disabled
v-model="row.urlList"
:limit="1">
</ai-uploader> -->
</div>
<div class="comment-list">
<div class="title">评论</div>
<div class="item">
<div class="user">
<img src="https://cdn.cunwuyun.cn/dvcp/h5/defaultAvatar.png" alt="">
<div class="info-flex">
<h2>张三</h2>
<span>2023-03-16 09:34:02</span>
2023-03-15 17:32:00 +08:00
</div>
2023-03-16 10:54:06 +08:00
</div>
<div class="content-flex">
<p>评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容</p>
<div>删除</div>
</div>
<div class="reply-list">
<div class="reply-item">
<div class="reply-user">
<img src="https://cdn.cunwuyun.cn/dvcp/h5/defaultAvatar.png" alt="">
<div class="reply-name">
<span>李四</span>回复<span>张三</span>
</div>
<span class="reply-time">2023-03-16 09:34:02</span>
</div>
<div class="content-flex">
<p>评论回复评论回复评论回复评论回复评论回复评论回复评论回复评论回复评论回复评论回复评论回复评论回复</p>
<div>删除</div>
</div>
</div>
</div>
<div class="reply-more" @click="isShowMore = !isShowMore" :class="[isShowMore ? 'active' : '']">
<span class="line"></span>{{isShowMore ? '收起' : `展开3条回复`}}
<i class="el-icon-arrow-down"></i>
</div>
</div>
</div>
2023-03-15 17:32:00 +08:00
</template>
</ai-card>
</template>
</ai-detail>
</template>
<script>
export default {
name: 'Detail',
props: {
instance: Function,
dict: Object,
params: Object
},
data () {
return {
2023-03-16 14:01:40 +08:00
commontList: [],
2023-03-16 10:54:06 +08:00
info: {},
isShowMore: false
}
},
computed: {
getAvatar(row){
return row.avatar||row.photo||'https://cdn.cunwuyun.cn/dvcp/h5/defaultAvatar.png'
2023-03-15 17:32:00 +08:00
}
},
created () {
this.getInfo()
this.getList()
},
methods: {
getList() {
2023-03-16 14:01:40 +08:00
this.instance.post(`/app/appneighborhoodassistance/commontList?id=${this.params.id}`).then(res => {
2023-03-15 17:32:00 +08:00
if (res.code == 0) {
2023-03-16 14:01:40 +08:00
this.commontList = res.data.records
2023-03-15 17:32:00 +08:00
}
})
},
getInfo () {
2023-03-16 14:01:40 +08:00
this.instance.post(`/app/appneighborhoodassistance/queryDetailById?id=${this.params.id}`).then(res => {
2023-03-15 17:32:00 +08:00
if (res.code == 0) {
if (res.data) {
this.info = res.data
}
}
})
},
cancel () {
this.$emit('change', {
type: 'List',
isRefresh: true
})
}
}
}
</script>
<style scoped lang="scss">
2023-03-16 10:54:06 +08:00
.detail {
.talk-info {
.user {
display: flex;
margin-bottom: 8px;
img {
width: 80px;
height: 80px;
margin-right: 16px;
border-radius: 50%;
}
.info {
width: calc(100% - 96px);
h2 {
font-size: 24px;
line-height: 40px;
font-weight: 400;
}
.time-flex {
display: flex;
justify-content: space-between;
color: #999;
font-size: 14px;
line-height: 40px;
.area-name {
color: #666;
}
}
}
}
.content {
font-size: 16px;
line-height: 32px;
word-break: break-all;
span {
color: #26f;
}
}
}
.comment-list {
.title {
color: #333;
font-size: 16px;
font-weight: 700;
line-height: 40px;
margin-bottom: 8px;
}
.item {
border-bottom: 1px solid #ddd;
padding-bottom: 16px;
.user {
display: flex;
margin-bottom: 8px;
img {
width: 80px;
height: 80px;
margin-right: 16px;
border-radius: 50%;
}
.info-flex {
width: calc(100% - 96px);
display: flex;
justify-content: space-between;
h2 {
font-size: 24px;
line-height: 40px;
font-weight: 400;
}
span {
color: #999;
font-size: 14px;
}
}
}
.content-flex {
display: flex;
font-size: 16px;
line-height: 30px;
margin-bottom: 8px;
p {
width: calc(100% - 50px);
word-break: break-all;
}
div {
color: #26f;
width: 50px;
text-align: right;
}
}
.reply-list {
padding-left: 100px;
.reply-item {
margin-bottom: 8px;
.reply-user {
font-size: 14px;
margin-bottom: 8px;
img {
width: 50px;
height: 50px;
border-radius: 50%;
vertical-align: middle;
margin-right: 8px;
}
.reply-name {
display: inline-block;
color: #333;
width: 300px;
span {
display: inline-block;
color: #666;
margin: 0 8px;
}
}
.reply-time {
color: #999;
}
}
.content-flex {
font-size: 14px;
line-height: 24px;
}
}
}
.reply-more {
font-size: 16px;
line-height: 28px;
color: #333;
.line {
display: inline-block;
width: 120px;
border-top: 1px solid #eee;
vertical-align: middle;
margin-right: 8px;
}
.el-icon-arrow-down {
transition: all ease 0.5s;
2023-03-16 14:01:40 +08:00
transform: rotate(0);
2023-03-16 10:54:06 +08:00
margin-left: 8px;
}
&.active .el-icon-arrow-down {
2023-03-16 14:01:40 +08:00
transform: rotate(180deg);
2023-03-16 10:54:06 +08:00
}
}
}
}
}
2023-03-15 17:32:00 +08:00
</style>