推送精选
This commit is contained in:
@@ -1,69 +1,41 @@
|
||||
<template>
|
||||
<ai-detail class="detail">
|
||||
<ai-detail>
|
||||
<template slot="title">
|
||||
<ai-title title="帖子详情" isShowBack isShowBottomBorder @onBackClick="cancel(false)">
|
||||
<ai-title title="详情" isShowBack isShowBottomBorder @onBackClick="cancel(false)">
|
||||
</ai-title>
|
||||
</template>
|
||||
<template slot="content">
|
||||
<ai-card title="帖子信息">
|
||||
<ai-card title="基本信息">
|
||||
<template #content>
|
||||
<div class="talk-info">
|
||||
<div class="user">
|
||||
<img :src="info.createUserAvatar" alt="">
|
||||
<div class="info">
|
||||
<h2>{{info.createUserName}}</h2>
|
||||
<div class="time-flex">
|
||||
<span class="area-name">{{info.publishDepartName}}</span>
|
||||
<span>{{info.createTime}}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="content">
|
||||
<span v-if="info.themeId">#【{{info.themeInfo.title}}】</span>{{info.content}}
|
||||
</div>
|
||||
<ai-uploader :instance="instance" disabled v-model="info.files">
|
||||
</ai-uploader>
|
||||
</div>
|
||||
</template>
|
||||
</ai-card>
|
||||
<ai-card title="评论信息">
|
||||
<template #content>
|
||||
<div class="comment-list" v-if="commontList.length">
|
||||
<div class="title">评论</div>
|
||||
<div class="item" v-for="(item, index) in commontList" :key="index">
|
||||
<div class="user">
|
||||
<img :src="item.createUserAvatar" alt="">
|
||||
<div class="info-flex">
|
||||
<h2>{{item.createUserName}}</h2>
|
||||
<span>{{item.createTime}}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="content-flex">
|
||||
<p>{{item.content}}</p>
|
||||
<div @click="delCommontOrReply('评论', item.id)">删除</div>
|
||||
</div>
|
||||
<div class="reply-list" v-if="item.replyList && item.replyList.length && item.isShowReply">
|
||||
<div class="reply-item" v-for="(reply, indexs) in item.replyList" :key="indexs">
|
||||
<div class="reply-user">
|
||||
<img :src="item.createUserAvatar" alt="">
|
||||
<div class="reply-name">
|
||||
<span>{{reply.createUserName}}</span>回复<span>{{item.createUserName}}</span>
|
||||
</div>
|
||||
<span class="reply-time">{{reply.createTime}}</span>
|
||||
</div>
|
||||
<div class="content-flex">
|
||||
<p>{{reply.content}}</p>
|
||||
<div @click="delCommontOrReply('回复', reply.id)">删除</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="reply-more" @click="item.isShowReply = !item.isShowReply" :class="[item.isShowReply ? 'active' : '']">
|
||||
<span class="line"></span>{{item.isShowReply ? '收起' : `展开${item.replyList.length}条回复`}}
|
||||
<i class="el-icon-arrow-down"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<ai-empty v-else>暂无评论</ai-empty>
|
||||
<ai-wrapper
|
||||
label-width="120px">
|
||||
<ai-info-item label="标题" isLine :value="info.title"></ai-info-item>
|
||||
<ai-info-item label="发布地区" isLine :value="info.areaName"></ai-info-item>
|
||||
<ai-info-item label="文章类型" isLine :value="info.contentType === '0' ? '文章' : '视频'"></ai-info-item>
|
||||
<ai-info-item label="分类" v-if="info.categoryName" isLine :value="info.categoryName"></ai-info-item>
|
||||
<ai-info-item label="正文" v-if="info.contentType === '0'" isLine>
|
||||
<AiArticle :value="info.content"></AiArticle>
|
||||
</ai-info-item>
|
||||
<ai-info-item v-if="info.contentType === '0'" isLine label="封面图片">
|
||||
<ai-uploader
|
||||
:instance="instance"
|
||||
disabled
|
||||
v-model="info.files"
|
||||
:limit="9">
|
||||
</ai-uploader>
|
||||
</ai-info-item>
|
||||
<ai-info-item v-if="info.contentType === '1'" isLine label="封面图片">
|
||||
<video style="width:100%; height:100%; object-fit: fill;" :src="info.files[0].url" controls></video>
|
||||
</ai-info-item>
|
||||
<ai-info-item v-if="info.contentType === '1'" isLine label="视频封面">
|
||||
<ai-uploader
|
||||
:instance="instance"
|
||||
disabled
|
||||
v-model="info.pictureUrl"
|
||||
:limit="1">
|
||||
</ai-uploader>
|
||||
</ai-info-item>
|
||||
</ai-wrapper>
|
||||
</template>
|
||||
</ai-card>
|
||||
</template>
|
||||
@@ -77,218 +49,45 @@
|
||||
props: {
|
||||
instance: Function,
|
||||
dict: Object,
|
||||
params: Object
|
||||
params: Object,
|
||||
moduleId: String
|
||||
},
|
||||
|
||||
data () {
|
||||
return {
|
||||
commontList: [],
|
||||
info: {},
|
||||
}
|
||||
},
|
||||
|
||||
computed: {
|
||||
getAvatar(row){
|
||||
return row.avatar||row.photo||'https://cdn.cunwuyun.cn/dvcp/h5/defaultAvatar.png'
|
||||
id: ''
|
||||
}
|
||||
},
|
||||
|
||||
created () {
|
||||
this.getInfo()
|
||||
this.getList()
|
||||
if (this.params && this.params.id) {
|
||||
this.id = this.params.id
|
||||
this.getInfo(this.params.id)
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
getList() {
|
||||
this.instance.post(`/app/appneighborhoodassistance/commontList?id=${this.params.id}&size=100`).then(res => {
|
||||
if (res.code == 0) {
|
||||
res.data.records.map((item) => {
|
||||
item.isShowReply = false
|
||||
})
|
||||
this.commontList = res.data.records
|
||||
getInfo (id) {
|
||||
this.instance.post(`/app/appcontentinfo/queryDetailById?id=${id}`).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.info = res.data
|
||||
this.info.pictureUrl = res.data.pictureUrl ? [{
|
||||
url: res.data.pictureUrl
|
||||
}] : []
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
getInfo () {
|
||||
this.instance.post(`/app/appneighborhoodassistance/queryDetailById?id=${this.params.id}`).then(res => {
|
||||
if (res.code == 0) {
|
||||
if (res.data) {
|
||||
this.info = res.data
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
cancel () {
|
||||
cancel (isRefresh) {
|
||||
this.$emit('change', {
|
||||
type: 'List',
|
||||
isRefresh: true
|
||||
isRefresh: !!isRefresh
|
||||
})
|
||||
},
|
||||
|
||||
delCommontOrReply(text, id) {
|
||||
this.$confirm(`确定删除该${text}?`).then(() => {
|
||||
this.instance.post(`/app/appneighborhoodassistance/delComment?id=${id}`).then(res => {
|
||||
if (res.code == 0) {
|
||||
this.$message.success('删除成功!')
|
||||
this.getList()
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.detail {
|
||||
.talk-info {
|
||||
.user {
|
||||
display: flex;
|
||||
margin-bottom: 8px;
|
||||
img {
|
||||
width: 60px;
|
||||
height: 60px;
|
||||
margin-right: 16px;
|
||||
border-radius: 50%;
|
||||
}
|
||||
.info {
|
||||
width: calc(100% - 76px);
|
||||
h2 {
|
||||
font-size: 20px;
|
||||
line-height: 30px;
|
||||
font-weight: 400;
|
||||
}
|
||||
.time-flex {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
color: #999;
|
||||
font-size: 14px;
|
||||
line-height: 30px;
|
||||
.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: 60px;
|
||||
height: 60px;
|
||||
margin-right: 16px;
|
||||
border-radius: 50%;
|
||||
}
|
||||
.info-flex {
|
||||
width: calc(100% - 76px);
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
line-height: 60px;
|
||||
h2 {
|
||||
font-size: 20px;
|
||||
font-weight: 400;
|
||||
}
|
||||
span {
|
||||
color: #999;
|
||||
font-size: 14px;
|
||||
}
|
||||
}
|
||||
}
|
||||
.content-flex {
|
||||
display: flex;
|
||||
font-size: 16px;
|
||||
line-height: 30px;
|
||||
margin-bottom: 8px;
|
||||
padding-left: 76px;
|
||||
p {
|
||||
width: calc(100% - 50px);
|
||||
word-break: break-all;
|
||||
}
|
||||
div {
|
||||
color: #26f;
|
||||
width: 50px;
|
||||
text-align: right;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
.reply-list {
|
||||
padding-left: 100px;
|
||||
.reply-item {
|
||||
margin-bottom: 8px;
|
||||
.reply-user {
|
||||
font-size: 14px;
|
||||
img {
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
border-radius: 50%;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.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;
|
||||
padding-left: 58px;
|
||||
}
|
||||
}
|
||||
}
|
||||
.reply-more {
|
||||
font-size: 14px;
|
||||
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;
|
||||
transform: rotate(0);
|
||||
margin-left: 8px;
|
||||
}
|
||||
|
||||
&.active .el-icon-arrow-down {
|
||||
transform: rotate(180deg);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user