Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
aixianling
2022-02-18 19:09:29 +08:00
3 changed files with 227 additions and 90 deletions

View File

@@ -1,5 +1,5 @@
<template>
<div class="Page">
<div class="Page" v-if="showPage">
<u-tabs class="u-tabs1" :list="tabs" :is-scroll="false" :current="tabIndex0" @change="change" bg-color="#197df0" style="width: 50%" active-color="#FFF;" inactive-color="#FFF"></u-tabs>
<div class="top">
@@ -20,30 +20,36 @@
<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=";(delAndEdit = true), (editId = item.id), (deleId = item.id), (statDisabled = item.status)" 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 +60,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>
@@ -84,12 +92,16 @@
<AiEmpty description="暂无数据" class="emptyWrap" v-else></AiEmpty>
</div>
<!-- <AiFixedBtn v-if="tabIndex0 == 3 && tabCurrent1 == 1" @click.native="toAdd()">
<div class="addBtn iconfont iconfont-iconfangda">发起审核</div>
</AiFixedBtn> -->
<div class="addBtn" v-if="tabIndex0 == 3 && tabCurrent1 == 1" @click.native="toAdd()">发起审核</div>
<img class="addBtn" src="https://cdn.cunwuyun.cn/dvcp/AppVillager/icon111.png" alt="" v-if="tabIndex0 == 3 && tabCurrent1 == 1" @click.native="toAdd()" />
<u-modal v-model="delShow" content="确定删除该数据" :mask-close-able="true" @confirm="confirmDel"></u-modal>
<u-mask :show="delAndEdit" @click=";(delAndEdit = false), (statDisabled = '')">
<div class="warp">
<div class="rect" @tap.stop="toAdd(0)">编辑</div>
<div class="rect" @tap.stop=";(delAndEdit = false), (delShow = true)">删除</div>
</div>
</u-mask>
</div>
</template>
@@ -103,6 +115,7 @@ export default {
props: {},
data() {
return {
showPage: false,
tabs: [
{
name: '本村',
@@ -152,6 +165,10 @@ export default {
show: false,
TopicValue: '0',
TopicName: '美丽庭院',
flag: false,
delAndEdit: false,
editId: '',
statDisabled: '',
}
},
computed: { ...mapState(['user']) },
@@ -174,8 +191,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' : '',
},
})
@@ -184,30 +202,50 @@ export default {
this.data = this.current > 1 ? [...this.data, ...res.data.records] : res.data.records
}
})
.finally(() => {
this.showPage = true
})
},
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) {
if (item) {
this.$linkTo(`./add?id=${item.id}`)
toAdd(index) {
if (this.statDisabled == 0 && index == 0) {
this.delAndEdit = false
return this.$u.toast('该数据未审核')
}
this.delAndEdit = false
if (index == 0) {
this.$linkTo(`./add?id=${this.editId}`)
} else {
this.$linkTo(`./add`)
}
@@ -215,17 +253,22 @@ export default {
confirmDel() {
this.$instance
.post(`/app/appvillagercircleinfo/delete?ids=${this.deleId}`)
.post(this.tabIndex0 == 3 && this.tabCurrent1 == 1 ? '/app/appvillagercirclecomment/delete' : '/app/appvillagercircleinfo/delete', null, {
params: {
ids: this.deleId,
},
})
.then((res) => {
if (res?.data) {
if (res.code == 0) {
this.deleShow = false
this.modalShow = false
this.deleId = ''
this.getDetail()
this.statDisabled = ''
this.$u.toast('删除成功')
this.init()
}
})
.catch((e) => {
this.$hideLoading()
this.$u.toast(e)
})
},
@@ -233,6 +276,9 @@ export default {
conTopic(e) {
this.TopicValue = e[0].value
this.TopicName = e[0].label
this.$nextTick(() => {
this.init()
})
},
previewImage(images, img) {
@@ -241,6 +287,29 @@ 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
})
},
toDel() {},
},
onReachBottom() {
this.current = this.current + 1
@@ -274,10 +343,12 @@ export default {
}
.top {
padding: 0 0 32px 16px;
padding: 0 16px 32px 16px;
background: #fff;
border-radius: 32px 32px 0px 0px;
margin-top: -30px;
overflow: hidden;
.tabIndex012 {
padding-top: 32px;
display: flex;
@@ -344,6 +415,9 @@ export default {
font-size: 26px;
color: #6e727a;
margin-top: 6px;
.topics {
margin-right: 8px;
}
}
}
@@ -362,10 +436,16 @@ export default {
.status2 {
color: #ff883c;
}
.dels {
margin-left: 20px;
width: 68px;
height: 68px;
.statusRight {
display: flex;
flex-direction: column;
align-items: center;
.dels {
position: relative;
margin-left: 20px;
width: 68px;
height: 68px;
}
}
}
}
@@ -431,7 +511,7 @@ export default {
padding: 24px;
background: #f3f6f9;
border-radius: 16px;
margin: 24px;
margin-top: 24px;
.toReply {
font-size: 26px;
color: #999999;
@@ -485,5 +565,27 @@ export default {
border-radius: 50%;
box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.2);
}
::v-deep .u-mask {
.warp {
position: absolute;
top: 251px;
right: 70px;
display: flex;
flex-direction: column;
align-items: center;
width: 45%;
height: 22%;
box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.2);
border-radius: 5%;
.rect {
height: 50%;
width: 100%;
text-align: center;
line-height: 4;
background: #fff;
}
}
}
}
</style>

View File

@@ -2,8 +2,8 @@
<div class="add">
<div class="u-forms">
<u-form class="u-form" :model="forms" ref="uForm" label-width="auto" :border-bottom="false">
<u-form-item label="话题类型" class="topics" prop="topic" required :border-bottom="false" right-icon="arrow-right">
<u-input v-model="forms.topic" disabled placeholder="请选择话题类型" @click="showStstus = true" />
<u-form-item label="话题类型" class="topics" prop="topicValue" required :border-bottom="false" right-icon="arrow-right">
<u-input v-model="forms.topicValue" disabled placeholder="请选择话题类型" @click="showStstus = true" />
<u-select v-model="showStstus" :list="$dict.getDict('villagerCircleTopic')" value-name="dictValue" label-name="dictName" @confirm="selectStatus"></u-select>
</u-form-item>
@@ -60,6 +60,7 @@ export default {
onLoad(o) {
this.$dict.load('villagerCircleTopic').then(() => {
this.id = o.id
this.getDetail()
})
},
onShow() {},
@@ -75,6 +76,9 @@ export default {
if (!this.forms.content) {
return this.$u.toast('请输入内容')
}
if (!this.forms.gpsDesc) {
return this.$u.toast('请选择所在位置')
}
if (!this.forms.lat && !this.forms.lng) {
return this.$u.toast('请选择所在位置')
}
@@ -89,14 +93,15 @@ export default {
this.flag = true
this.$instance
.post(`/app/appvillagercircleinfo/addOrUpdate`, {
topic: this.forms.topicValue,
topic: this.forms.topic,
content: this.forms.content,
pictures: imgs || [],
createUserResidentId: this.user.id,
areaId: this.$areaId,
gpsDesc: this.gpsDesc,
gpsDesc: this.forms.gpsDesc,
lat: this.forms.lat,
lng: this.forms.lng,
id: this.id,
})
.then((res) => {
if (res.code == 0) {
@@ -122,22 +127,24 @@ export default {
if (this.id) {
this.$instance.post(`/app/appvillagercircleinfo/queryDetailById?id=${this.id}`).then((res) => {
if (res.code == 0) {
// this.forms = res.data
this.forms = res.data
console.log(this.form)
this.forms.topicValue = this.$dict.getLabel('villagerCircleTopic', this.forms.topic)
}
})
}
},
selectStatus(e) {
this.forms.topic = e[0].label
this.forms.topicValue = e[0].value
this.forms.topic = e[0].value
this.forms.topicValue = e[0].label
},
chooseAddress() {
uni.chooseLocation({
success: (res) => {
console.log(res)
this.forms.gpsDesc = res.gpsDesc
this.forms.gpsDesc = res.name
this.forms.lat = res.latitude
this.forms.lng = res.longitude
},

View File

@@ -6,20 +6,23 @@
<div class="middle">
<div class="cardTop">
<img :src="avatarUrl" alt="" />
<img :src="avatarUrl || user.avatarUrl" alt="" />
<div class="rightTop">
<div class="leftStaus">
<span class="names">{{ detail.createUserName }}</span>
<span class="names">{{ detail.createUserName || detail.replyUserName }}</span>
<span class="titless">{{ $dict.getLabel('villagerCircleTopic', detail.topic) }} | {{ detail.status }}</span>
<span class="titless">
<span class="topics" v-if="detail.topic"> {{ $dict.getLabel('villagerCircleTopic', detail.topic) }} |</span>
<span> {{ detail.createTime }}</span>
</span>
</div>
<div class="statusDele">
<div class="status status0" :class="detail.auditStatus == 0 ? 'status0' : detail.auditStatus == 1 ? 'status1' : 'status2'">{{ $dict.getLabel('auditStatus', detail.status) }}</div>
<div class="dels" @click.stop=";(modalShow = true), (deleId = detail.id)">删除</div>
<!-- <img src="https://cdn.cunwuyun.cn/dvcp/AppVillager4.png" alt="" @click.stop="delShow = true" class="dels" /> -->
<!-- <img src="https://cdn.cunwuyun.cn/dvcp/AppVillager/4.png" alt="" @click.stop="delShow = true" class="dels" /> -->
</div>
</div>
</div>
@@ -38,30 +41,44 @@
<div class="icones">
<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" @click="poupShow = true" />
<img src="https://cdn.cunwuyun.cn/dvcp/AppVillager3.png" alt="" class="img3" @click="like" />
<img src="https://cdn.cunwuyun.cn/dvcp/AppVillager/2.png" alt="" class="img2" @click="poupShow = true" />
<img src="https://cdn.cunwuyun.cn/dvcp/AppVillager/3.png" alt="" class="img3" @click="like" v-if="detail.upFlag == 0" />
<img src="https://cdn.cunwuyun.cn/dvcp/AppVillager/33.png" alt="" class="img3" @click="like" v-if="detail.upFlag == 1" />
</div>
</div>
</div>
<div class="reply">
<div class="reply" v-if="tabCurrent1 == 0">
<div class="replyTop" @click="deleShowBtn(item)">
<img src="https://cdn.cunwuyun.cn/dvcp/AppVillager3.png" alt="" />
<span class="people">张三李四陶白白等12人</span>
<img src="https://cdn.cunwuyun.cn/dvcp/AppVillager/3.png" alt="" />
<span class="people">
<span v-for="(items, index) in detail.comments" :key="index" v-if="index < 3">{{ items.replyUserName }}</span>
{{ detail.comments.length }}</span
>
</div>
<div class="replyCont" @click="deleShowBtn(item)">
<span class="nameLeft">张三</span>
<span class="contRight">非常不错</span>
<div class="replyCont" @click="deleShowBtn(item)" v-for="(item, i) in detail.comments" :key="i">
<span class="nameLeft">{{ item.replyUserName }} : </span>
<span class="contRight"> {{ item.content }}</span>
</div>
</div>
<div class="reply" v-if="tabCurrent1 == 1">
<div class="replyTop" @click="deleShowBtn(item)">
<img src="https://cdn.cunwuyun.cn/dvcp/AppVillager/3.png" alt="" />
<span class="people">
<span v-for="(items, index) in detail.villagerCircleInfo.comments" :key="index" v-if="index < 3">{{ items.replyUserName }}</span>
{{ detail.villagerCircleInfo.comments.length }}</span
>
</div>
<div class="replyCont" @click="deleShowBtn(item)">
<span class="nameLeft">张三</span>
<span class="contRight">为什么不带上我呢为什么不带上我呢为什么不带上我呢</span>
<div class="replyCont" @click="deleShowBtn(item)" v-for="(item, i) in detail.villagerCircleInfo.comments" :key="i">
<span class="nameLeft">{{ item.replyUserName }} : </span>
<span class="contRight"> {{ item.content }}</span>
</div>
</div>
</div>
@@ -101,7 +118,7 @@ export default {
return {
id: '',
avatarUrl: '',
data: {},
detail: {},
poupShow: false,
content: '',
flag: false,
@@ -109,34 +126,36 @@ export default {
deleShow: false,
modalShow: false,
deleId: '',
flagLike: false,
tabCurrent1: '',
delAndEdit: '',
}
},
computed: { ...mapState(['user']) },
watch: {},
onLoad(o) {
this.$dict.load('villagerCircleTopic').then(() => {
console.log(o)
this.id = o.id
this.avatarUrl = o.avatarUrl
this.tabCurrent1 = o.tabCurrent1
this.getDetail()
})
},
onShow() {},
methods: {
getDetail() {
this.$instance.post(`/app/appvillagercircleinfo/queryDetailById?id=${this.id}`).then((res) => {
if (res.code == 0) {
this.detail = res.data
this.getReplyList()
}
})
},
getReplyList() {
this.$instance.post(`/app/appvillagercirclecomment/list?id=${detail.id}&size=999`).then((res) => {
if (res.code == 0) {
this.replylist = res.data.records
}
})
this.$instance
.post(this.tabCurrent1 == 0 ? '/app/appvillagercircleinfo/queryDetailById' : '/app/appvillagercirclecomment/queryDetailById', null, {
params: {
id: this.id,
},
})
.then((res) => {
if (res.code == 0) {
this.detail = res.data
}
})
},
send() {
@@ -151,32 +170,38 @@ export default {
replyUserResidentId: this.user.id,
replyUserName: this.user.name,
areaId: this.$areaId,
id: '888',
vcId: this.detail.id,
})
.then((res) => {
if (res?.code == 0) {
this.$u.toast('留言成功')
this.$u.toast('发送成功')
this.flag = false
this.content = ''
this.poupShow = false
// this.getDetail()
this.getDetail()
}
})
},
like() {
var id = '88'
if (this.flagLike) return
this.flagLike = true
this.$instance
.post(`/app/appvillagediscussmessage/suport?id=${id}&userId=${this.user.id}`)
.post(`/app/appvillagercircleinfo/up?id=${this.detail.id}&userId=${this.user.id}`)
.then((res) => {
this.$hideLoading()
if (res.code === 0) {
this.$u.toast('点赞成功')
this.$u.toast(this.detail.upFlag == 0 ? '点赞成功' : '取消点赞成功')
this.getDetail()
setTimeout(() => {
this.flagLike = false
}, 600)
}
})
.catch((err) => {
this.$u.toast(err)
this.flagLike = false
})
},
@@ -184,10 +209,11 @@ export default {
this.$instance
.post(`/app/appvillagercirclecomment/delete?ids=${this.deleId}`)
.then((res) => {
if (res?.data) {
if (res.code == 0) {
this.deleShow = false
this.modalShow = false
this.deleId = ''
this.modalShow = false
this.$u.toast('删除成功')
this.getDetail()
}
})
@@ -198,8 +224,7 @@ export default {
},
deleShowBtn(item) {
// this.deleId = item.id
this.deleId = '999'
this.deleId = item.id
this.deleShow = true
},
@@ -235,10 +260,9 @@ export default {
}
.middle {
padding-bottom: 48px;
padding: 32px 0 48px 0;
.cardTop {
display: flex;
margin-top: 32px;
img {
width: 96px;
height: 96px;
@@ -261,6 +285,9 @@ export default {
font-size: 26px;
color: #6e727a;
margin-top: 6px;
.topics {
margin-right: 8px;
}
}
}
@@ -282,7 +309,7 @@ export default {
.dels {
margin-left: 20px;
width: 68px;
height: 68px;
// height: 68px;
}
}
}
@@ -363,6 +390,7 @@ export default {
font-weight: 500;
.nameLeft {
color: #485d87;
margin-right: 12px;
}
.contRight {
color: #485d87;