村民圈

This commit is contained in:
花有清香月有阴
2022-02-18 15:45:31 +08:00
parent c7454c23b4
commit f189e13195
2 changed files with 120 additions and 63 deletions

View File

@@ -20,30 +20,35 @@
<div class="datas" v-if="data.length">
<div class="card" v-for="(item, index) in data" :key="index" @click="toDetail(item)">
<div class="cardTop">
<img :src="item.avatarUrl" alt="" />
<img :src="item.avatarUrl || user.avatarUrl" alt="" />
<div class="rightTop">
<div class="leftStaus">
<span class="names">{{ item.createUserName }}</span>
<span class="names">{{ item.createUserName || user.realName }}</span>
<span class="titless">{{ $dict.getLabel('villagerCircleTopic', item.topic) }} | {{ item.createTime }}</span>
<span class="titless">
<span v-if="item.topic" class="topics"> {{ $dict.getLabel('villagerCircleTopic', item.topic) }} |</span>
<span> {{ item.createTime }}</span>
</span>
</div>
<div class="statusDele">
<div class="status status0" :class="item.auditStatus == 0 ? 'status0' : item.auditStatus == 1 ? 'status1' : 'status2'" v-if="tabIndex0 == 3">{{ $dict.getLabel('auditStatus', item.status) }}</div>
<div class="dels" @click.stop="toAdd(item)">编辑</div>
<div class="dels" @click.stop=";(delShow = true), (deleId = item.id)">删除</div>
<!-- <img src="https://cdn.cunwuyun.cn/dvcp/AppVillager4.png" alt="" @click.stop="delShow = true" class="dels" /> -->
<div class="statusRight">
<div class="dels" @click.stop="toAdd(item)">编辑</div>
<div class="dels" @click.stop=";(delShow = true), (deleId = item.id)">删除</div>
</div>
<!-- <img src="https://cdn.cunwuyun.cn/dvcp/AppVillager/4.png" alt="" @click.stop="delShow = true" class="dels" /> -->
</div>
</div>
</div>
<div class="tabCurrent0" v-if="tabIndex0 != 3">
<div class="tabCurrent0" v-if="tabCurrent1 != 1">
<div class="cardConts">{{ item.content }}</div>
<div class="cardImg" v-if="item.pictures">
<img :src="item.url" alt="" v-for="(items, i) in item.pictures" :key="i" @click.stop="previewImage(item.pictures, item.url)" />
<img :src="items.url" alt="" v-for="(items, i) in item.pictures" :key="i" @click.stop="previewImage(item.pictures, items.url)" />
</div>
<div class="cardBot">
@@ -54,28 +59,30 @@
<div class="icones" v-if="tabIndex0 != 3">
<div class="img1">
<img src="https://cdn.cunwuyun.cn/dvcp/AppVillager1.png" alt="" class="img11" />
<img src="https://cdn.cunwuyun.cn/dvcp/AppVillager/1.png" alt="" class="img11" />
</div>
<div class="rightFlex">
<img src="https://cdn.cunwuyun.cn/dvcp/AppVillager2.png" alt="" class="img2" />
<img src="https://cdn.cunwuyun.cn/dvcp/AppVillager3.png" alt="" class="img3" />
<img src="https://cdn.cunwuyun.cn/dvcp/AppVillager/2.png" alt="" class="img2" />
<img src="https://cdn.cunwuyun.cn/dvcp/AppVillager/3.png" alt="" class="img3" @click.stop="like(item)" v-if="item.upFlag == 0" />
<img src="https://cdn.cunwuyun.cn/dvcp/AppVillager/33.png" alt="" class="img3" @click.stop="like(item)" v-if="item.upFlag == 1" />
</div>
</div>
</div>
</div>
<div class="tabCurrent11" v-if="tabIndex0 == 3 && tabCurrent1 == 1">
<div class="cardsConts">针不戳</div>
<div class="cardsConts">{{ item.content }}</div>
<div class="reply">
<span class="toReply">回复的话</span>
<span class="contens"></span>
<span class="toReply">回复的话 </span>
<span class="contens">{{ item.villagerCircleInfo.content }}</span>
</div>
<div class="nopass">
<div class="nopass" v-if="item.status == 2">
<span>未通过理由</span>
<span>请勿带情绪进行评论</span>
<span>{{ item.auditOpinion }}</span>
</div>
</div>
</div>
@@ -152,6 +159,7 @@ export default {
show: false,
TopicValue: '0',
TopicName: '美丽庭院',
flag: false,
}
},
computed: { ...mapState(['user']) },
@@ -174,8 +182,9 @@ export default {
size: 6,
current: this.current,
topic: this.tabIndex0 != 3 ? this.TopicValue : '',
status: this.tabIndex0 == 3 && this.indexTab2 == 0 ? '' : this.tabIndex0 == 3 && this.indexTab2 == 1 ? 1 : this.tabIndex0 == 3 && this.indexTab2 == 2 ? 2 : this.tabIndex0 == 3 && this.indexTab2 == 3 ? 0 : '',
areaId: this.tabIndex0 != 3 ? this.user.areaId : '',
residentId: this.tabIndex0 != 3 ? this.user.residentId : '',
listType: this.tabIndex0 == 3 && this.tabCurrent1 == 0 ? '0' : this.tabIndex0 == 3 && this.tabCurrent1 == 1 ? '1' : this.tabIndex0 == 0 ? '0' : this.tabIndex0 == 1 ? '1' : this.tabIndex0 == 2 ? '2' : '',
},
})
@@ -186,23 +195,34 @@ export default {
})
},
change(index) {
init() {
this.data = []
this.tabIndex0 = index
this.current = 1
this.getList()
},
change(index) {
this.tabIndex0 = index
this.init()
},
changetabIndex(e) {
this.tabCurrent1 = e
this.$nextTick(() => {
this.indexTab2 = 0
this.init()
})
},
hander(i) {
this.indexTab2 = i
this.$nextTick(() => {
this.init()
})
},
toDetail(item) {
this.$linkTo(`./detail?id=${item.id}&avatarUrl=${item.avatarUrl}`)
this.$linkTo(`./detail?id=${item.id}&avatarUrl=${item.avatarUrl ? item.avatarUrl : ''}&tabCurrent1=${this.tabCurrent1}`)
},
toAdd(item) {
@@ -233,6 +253,9 @@ export default {
conTopic(e) {
this.TopicValue = e[0].value
this.TopicName = e[0].label
this.$nextTick(() => {
this.init()
})
},
previewImage(images, img) {
@@ -241,6 +264,27 @@ export default {
current: img,
})
},
like(item) {
if (this.flag) return
this.flag = true
this.$instance
.post(`/app/appvillagercircleinfo/up?id=${item.id}`)
.then((res) => {
if (res.code === 0) {
this.$u.toast(item.upFlag == 0 ? '点赞成功' : '取消点赞成功')
this.init()
setTimeout(() => {
this.flag = false
}, 600)
}
})
.catch((err) => {
this.$u.toast(err)
this.flag = false
})
},
},
onReachBottom() {
this.current = this.current + 1
@@ -344,6 +388,9 @@ export default {
font-size: 26px;
color: #6e727a;
margin-top: 6px;
.topics {
margin-right: 8px;
}
}
}
@@ -362,10 +409,15 @@ export default {
.status2 {
color: #ff883c;
}
.dels {
margin-left: 20px;
width: 68px;
height: 68px;
.statusRight {
display: flex;
flex-direction: column;
align-items: center;
.dels {
margin-left: 20px;
// width: 68px;
// height: 68px;
}
}
}
}