Files
dvcp_v2_wxcp_app/src/apps/AppVillagersCircle/commentList.vue

216 lines
5.4 KiB
Vue
Raw Normal View History

2022-02-18 14:33:36 +08:00
<template>
<div class="commentList">
<!-- tab栏 -->
<div class="tab-select">
<div class="item" :class="tabIndex == index ? 'active' : ''" v-for="(item, index) in tabs" :key="index" @click="tabClick(index)">{{item}}<span></span></div>
</div>
<!-- 全部 -->
<div>
<div class="search-box" v-if="tabIndex==0">
<div class="integral-types" @click="showType = true">{{ topicType? topicType:'话题类型' }}<u-icon name="arrow-down"></u-icon></div>
<u-search placeholder="请输入关键字" v-model="content" :show-action="false" @search="getList()" @clear="getList()"></u-search>
</div>
2022-02-18 17:05:32 +08:00
<div class="card-list" v-if="data.length">
<div class="card-item" v-for="(item,index) in data" :key="index" @click="toDetail(item)">
<div class="card-title" v-if="item.villagerCircleInfo && item.villagerCircleInfo.content">{{ item.villagerCircleInfo.content }}</div>
2022-02-18 14:33:36 +08:00
<div class="card-name">
2022-02-18 17:05:32 +08:00
<div class="name" v-if="item.villagerCircleInfo && item.villagerCircleInfo.topic">{{$dict.getLabel('villagerCircleTopic',item.villagerCircleInfo.topic)}}</div>
<div class="time" v-if="item.villagerCircleInfo && item.villagerCircleInfo.createTime">{{ item.villagerCircleInfo.createTime }}</div>
2022-02-18 14:33:36 +08:00
</div>
<div class="card-type">
2022-02-18 17:05:32 +08:00
<div class="comment">
<span>{{ item.replyUserName}}</span><span>:</span><span>{{ item.content }}</span>
</div>
<div class="type" :style="{color: item.status==0? '#4181FF':item.status==1? '#07c160' : '#dd5347'}">{{$dict.getLabel('auditStatus',item.status)}}</div>
2022-02-18 14:33:36 +08:00
</div>
</div>
</div>
<AiEmpty description="暂无数据" class="emptyWrap" v-else></AiEmpty>
<u-select v-model="showType" :list="$dict.getDict('villagerCircleTopic')" label-name="dictName" value-name="dictValue"
@confirm="confirmTypeSelect"/>
</div>
</div>
</template>
<script>
export default {
name: 'commentList',
data () {
return {
tabs: ['全部', '待处理', '已处理'],
tabIndex: '',
showType: false,
content: '',
typeList: [],
current: 1,
topic: '',
topicType: '',
2022-02-18 17:05:32 +08:00
data: {}
2022-02-18 14:33:36 +08:00
}
},
2022-02-18 17:05:32 +08:00
created() {
this.getList()
2022-02-18 14:33:36 +08:00
this.$dict.load('villagerCircleTopic','auditStatus').then(()=>{
2022-02-18 18:11:38 +08:00
uni.$on('update',()=>{
2022-02-18 17:05:32 +08:00
this.current = 1
this.getList()
})
2022-02-18 14:33:36 +08:00
})
},
methods: {
tabClick(index) {
this.tabIndex = index
this.current = 1,
this.topic = '',
this.topicType = '',
2022-02-18 17:05:32 +08:00
this.data = [],
2022-02-18 14:33:36 +08:00
this.getList()
},
2022-02-18 17:05:32 +08:00
2022-02-18 14:33:36 +08:00
getList() {
2022-02-18 17:05:32 +08:00
this.$http.post('/app/appvillagercirclecomment/list?current=1&size=10',null,{
2022-02-18 14:33:36 +08:00
params: {
current: 1,
size: 10,
2022-02-18 17:05:32 +08:00
auditType: this.tabIndex==0? '': this.tabIndex==1? 0 : 1
2022-02-18 14:33:36 +08:00
}
}).then(res=>{
if(res?.data) {
2022-02-18 17:05:32 +08:00
this.data = this.current >1 ? [...this.data, ...this.res.data.records] : res.data.records
2022-02-18 14:33:36 +08:00
}
})
},
confirmTypeSelect(e) {
2022-02-18 17:05:32 +08:00
console.log(e);
2022-02-18 14:33:36 +08:00
this.topic = e[0].value,
this.topicType = e[0].label
this.current = 1,
this.villagerList = []
this.getList()
},
toDetail(item) {
2022-02-18 17:05:32 +08:00
uni.navigateTo({url: `./commentDetail?id=${item.id}`})
2022-02-18 14:33:36 +08:00
}
},
onShow() {
2022-02-18 17:05:32 +08:00
document.title = '发布评论审核'
2022-02-18 14:33:36 +08:00
},
}
</script>
<style lang="scss" scoped>
.commentList {
.tab-select {
width: 100%;
height: 96px;
line-height: 96px;
background: #3975C6;
display: flex;
.item{
flex: 1;
text-align: center;
font-size: 28px;
font-family: PingFangSC-Regular, PingFang SC;
color: #CDDCF0;
}
.active{
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
position: relative;
color: #fff;
span{
width: 48px;
height: 4px;
background: #FFF;
position: absolute;
bottom: 14px;
left: 50%;
margin-left: -24px;
}
}
}
.search-box {
display: flex;
width: 100%;
height: 112px;
line-height: 112px;
background-color: #FFFFFF;
padding: 0 32px;
box-sizing: border-box;
.integral-types {
width: 30%;
}
}
.card-list {
width: 100%;
padding: 0 32px;
box-sizing: border-box;
.card-item {
margin-top: 24px;
background-color: #FFFFFF;
box-shadow: 0px 0px 8px 8px rgba(0, 0, 0, 0.02);
border-radius: 16px;
padding: 30px 32px 20px 32px;
.card-title {
height: 60px;
line-height: 60px;
font-size: 36px;
color: #333333;
overflow:hidden;
white-space: nowrap;
text-overflow: ellipsis;
-o-text-overflow:ellipsis;
}
.card-name {
margin-top: 30px;
display: flex;
height: 50px;
line-height: 50px;
font-size: 28px;
color: #999999;
.name {
padding: 0 15px;
background: #EEEEEE;
border-radius: 24px;
margin-right: 20px;
}
}
.card-type {
2022-02-18 17:05:32 +08:00
display: flex;
justify-content: space-between;
2022-02-18 14:33:36 +08:00
margin-top: 30px;
font-size: 28px;
2022-02-18 17:05:32 +08:00
.comment {
width: 70%;
overflow:hidden;
text-overflow:ellipsis;
white-space:nowrap;
2022-02-18 14:33:36 +08:00
}
2022-02-18 17:05:32 +08:00
.type {
width: 20%;
text-align: right;
2022-02-18 14:33:36 +08:00
}
}
}
}
}
</style>