接入村民圈
This commit is contained in:
@@ -1,586 +0,0 @@
|
||||
<template>
|
||||
<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">
|
||||
<div class="tabIndex012" v-if="tabIndex0 != 3">
|
||||
<div class="tags" @click="show = true">{{ TopicName }}</div>
|
||||
|
||||
<u-select v-model="show" :list="$dict.getDict('villagerCircleTopic')" value-name="dictValue" label-name="dictName" @confirm="conTopic"></u-select>
|
||||
</div>
|
||||
|
||||
<u-tabs class="u-tabs2" :list="tabList" :is-scroll="false" :current="tabCurrent1" @change="changetabIndex" bg-color="#fff" active-color="#333;" inactive-color="#999" v-if="tabIndex0 == 3"></u-tabs>
|
||||
|
||||
<div class="indexTab22" v-if="tabIndex0 == 3">
|
||||
<div class="tags" v-for="(e, i) in itemList" :key="i" :class="indexTab2 == i ? 'active' : 'noactive'" @click="hander(i)">{{ e.name }}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="middle">
|
||||
<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 || user.avatarUrl" alt="" />
|
||||
|
||||
<div class="rightTop">
|
||||
<div class="leftStaus">
|
||||
<span class="names">{{ item.createUserName || user.realName }}</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>
|
||||
|
||||
<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="tabCurrent1 != 1">
|
||||
<div class="cardConts">{{ item.content }}</div>
|
||||
|
||||
<div class="cardImg" v-if="item.pictures">
|
||||
<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">
|
||||
<div class="icons">
|
||||
<u-icon name="map-fill"></u-icon>
|
||||
<span>{{ item.gpsDesc }}</span>
|
||||
</div>
|
||||
|
||||
<div class="icones" v-if="tabIndex0 != 3">
|
||||
<div class="img1">
|
||||
<img src="https://cdn.cunwuyun.cn/dvcp/AppVillager/1.png" alt="" class="img11" />
|
||||
</div>
|
||||
|
||||
<div class="rightFlex">
|
||||
<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">{{ item.content }}</div>
|
||||
|
||||
<div class="reply">
|
||||
<span class="toReply">回复的话题 :</span>
|
||||
<span class="contens">{{ item.villagerCircleInfo.content }}</span>
|
||||
</div>
|
||||
|
||||
<div class="nopass" v-if="item.status == 2">
|
||||
<span>未通过理由:</span>
|
||||
<span>{{ item.auditOpinion }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<AiEmpty description="暂无数据" class="emptyWrap" v-else></AiEmpty>
|
||||
</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>
|
||||
|
||||
<script>
|
||||
import { mapState } from 'vuex'
|
||||
|
||||
export default {
|
||||
name: 'AppVillager',
|
||||
appName: '村民圈',
|
||||
components: {},
|
||||
props: {},
|
||||
data() {
|
||||
return {
|
||||
showPage: false,
|
||||
tabs: [
|
||||
{
|
||||
name: '本村',
|
||||
},
|
||||
{
|
||||
name: '本镇',
|
||||
},
|
||||
{
|
||||
name: '本县',
|
||||
},
|
||||
{
|
||||
name: '我参与的',
|
||||
},
|
||||
],
|
||||
tabIndex0: 0,
|
||||
tabList: [
|
||||
{
|
||||
name: '我的话题',
|
||||
},
|
||||
{
|
||||
name: '我的评论',
|
||||
},
|
||||
],
|
||||
tabCurrent1: 0,
|
||||
data: [],
|
||||
itemList: [
|
||||
{
|
||||
name: '全部',
|
||||
indexTab2: 0,
|
||||
},
|
||||
{
|
||||
name: '已通过',
|
||||
indexTab2: 1,
|
||||
},
|
||||
{
|
||||
name: '未通过',
|
||||
indexTab2: 2,
|
||||
},
|
||||
{
|
||||
name: '审核中',
|
||||
indexTab2: 3,
|
||||
},
|
||||
],
|
||||
indexTab2: 0,
|
||||
delShow: false,
|
||||
current: 1,
|
||||
show: false,
|
||||
TopicValue: '0',
|
||||
TopicName: '美丽庭院',
|
||||
flag: false,
|
||||
delAndEdit: false,
|
||||
editId: '',
|
||||
statDisabled: '',
|
||||
}
|
||||
},
|
||||
computed: { ...mapState(['user']) },
|
||||
watch: {},
|
||||
onLoad() {
|
||||
this.$dict.load('villagerCircleTopic', 'auditStatus').then(() => {
|
||||
this.getList()
|
||||
})
|
||||
},
|
||||
onShow() {
|
||||
uni.$on('updateList', () => {
|
||||
this.getList()
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
getList() {
|
||||
this.$instance
|
||||
.post(this.tabIndex0 == 3 ? '/app/appvillagercircleinfo/list-xcxme' : '/app/appvillagercircleinfo/list-xcx', null, {
|
||||
params: {
|
||||
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 : '',
|
||||
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' : '',
|
||||
},
|
||||
})
|
||||
.then((res) => {
|
||||
if (res.code == 0) {
|
||||
this.data = this.current > 1 ? [...this.data, ...res.data.records] : res.data.records
|
||||
}
|
||||
})
|
||||
.finally(() => {
|
||||
this.showPage = true
|
||||
})
|
||||
},
|
||||
|
||||
init() {
|
||||
this.data = []
|
||||
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 ? item.avatarUrl : ''}&tabCurrent1=${this.tabCurrent1}`)
|
||||
},
|
||||
|
||||
toAdd(index) {
|
||||
this.delAndEdit = false
|
||||
if (this.statDisabled == 0 && index == 0) {
|
||||
return this.$u.toast('该数据未审核')
|
||||
}
|
||||
if (this.tabIndex0 == 3 && this.tabCurrent1 == 1) {
|
||||
return
|
||||
}
|
||||
|
||||
if (index == 0) {
|
||||
this.$linkTo(`./add?id=${this.editId}`)
|
||||
} else {
|
||||
this.$linkTo(`./add`)
|
||||
}
|
||||
},
|
||||
|
||||
confirmDel() {
|
||||
this.$instance
|
||||
.post(this.tabIndex0 == 3 && this.tabCurrent1 == 1 ? '/app/appvillagercirclecomment/delete' : '/app/appvillagercircleinfo/delete', null, {
|
||||
params: {
|
||||
ids: this.deleId,
|
||||
},
|
||||
})
|
||||
.then((res) => {
|
||||
if (res.code == 0) {
|
||||
this.deleShow = false
|
||||
this.modalShow = false
|
||||
this.deleId = ''
|
||||
this.statDisabled = ''
|
||||
this.$u.toast('删除成功')
|
||||
this.init()
|
||||
}
|
||||
})
|
||||
.catch((e) => {
|
||||
this.$u.toast(e)
|
||||
})
|
||||
},
|
||||
|
||||
conTopic(e) {
|
||||
this.TopicValue = e[0].value
|
||||
this.TopicName = e[0].label
|
||||
this.$nextTick(() => {
|
||||
this.init()
|
||||
})
|
||||
},
|
||||
|
||||
previewImage(images, img) {
|
||||
uni.previewImage({
|
||||
urls: images.map((v) => v.url),
|
||||
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
|
||||
this.getList()
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.Page {
|
||||
height: 100%;
|
||||
background: #fff;
|
||||
.active {
|
||||
color: #4181ff !important;
|
||||
border: 1px solid #4181ff !important;
|
||||
}
|
||||
|
||||
.noactive {
|
||||
color: #666;
|
||||
border: 1px solid #ddd;
|
||||
}
|
||||
|
||||
::v-deep .u-tabs1 {
|
||||
.u-tabs {
|
||||
padding-top: 32px;
|
||||
padding-bottom: 60px;
|
||||
padding-right: 300px;
|
||||
width: 100%;
|
||||
background: #197df0;
|
||||
}
|
||||
}
|
||||
|
||||
.top {
|
||||
padding: 0 16px 32px 16px;
|
||||
background: #fff;
|
||||
border-radius: 32px 32px 0px 0px;
|
||||
margin-top: -30px;
|
||||
overflow: hidden;
|
||||
|
||||
.tabIndex012 {
|
||||
padding-top: 32px;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
.tags {
|
||||
padding: 8px 32px;
|
||||
background: #ffffff;
|
||||
border-radius: 32px;
|
||||
margin-left: 16px;
|
||||
border: 1px solid #4181ff;
|
||||
}
|
||||
.tags:nth-child(n + 4) {
|
||||
margin-top: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
.indexTab22 {
|
||||
padding-top: 32px;
|
||||
display: flex;
|
||||
.tags {
|
||||
padding: 8px 32px;
|
||||
background: #ffffff;
|
||||
border-radius: 32px;
|
||||
margin-left: 16px;
|
||||
border: 1px solid #ddd;
|
||||
}
|
||||
}
|
||||
|
||||
::v-deep .u-tabs2 {
|
||||
.u-tabs {
|
||||
padding: 0 !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.middle {
|
||||
padding: 0 32px;
|
||||
background: #fff;
|
||||
.datas {
|
||||
.card {
|
||||
padding: 32px 0 48px 0;
|
||||
box-shadow: inset 0px -1px 0px 0px #dddddd;
|
||||
.cardTop {
|
||||
display: flex;
|
||||
img {
|
||||
width: 96px;
|
||||
height: 96px;
|
||||
border-radius: 50%;
|
||||
}
|
||||
.rightTop {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
.leftStaus {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
margin-left: 16px;
|
||||
.names {
|
||||
font-size: 32px;
|
||||
font-weight: 500;
|
||||
}
|
||||
.titless {
|
||||
font-size: 26px;
|
||||
color: #6e727a;
|
||||
margin-top: 6px;
|
||||
.topics {
|
||||
margin-right: 8px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.statusDele {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
.status {
|
||||
font-size: 28px;
|
||||
}
|
||||
.status0 {
|
||||
color: #42d784;
|
||||
}
|
||||
.status1 {
|
||||
color: #ff4466;
|
||||
}
|
||||
.status2 {
|
||||
color: #ff883c;
|
||||
}
|
||||
.statusRight {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
.dels {
|
||||
position: relative;
|
||||
margin-left: 20px;
|
||||
width: 68px;
|
||||
height: 68px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.tabCurrent0 {
|
||||
.cardConts {
|
||||
margin-top: 24px;
|
||||
font-size: 32px;
|
||||
}
|
||||
|
||||
.cardImg {
|
||||
margin-top: 24px;
|
||||
img {
|
||||
width: 226px;
|
||||
height: 226px;
|
||||
margin-right: 4px;
|
||||
}
|
||||
img:nth-child(3n + 0) {
|
||||
margin-right: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.cardBot {
|
||||
margin-top: 24px;
|
||||
.icons {
|
||||
padding: 8px 32px 8px 16px;
|
||||
background: #eff1f3;
|
||||
border-radius: 28px;
|
||||
}
|
||||
.icones {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
margin-top: 24px;
|
||||
.img1 {
|
||||
width: 60%;
|
||||
.img11 {
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
}
|
||||
}
|
||||
.rightFlex {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
width: 27%;
|
||||
.img2,
|
||||
.img3 {
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.tabCurrent11 {
|
||||
.cardsConts {
|
||||
margin-top: 24px;
|
||||
font-size: 32px;
|
||||
}
|
||||
|
||||
.reply {
|
||||
padding: 24px;
|
||||
background: #f3f6f9;
|
||||
border-radius: 16px;
|
||||
margin-top: 24px;
|
||||
.toReply {
|
||||
font-size: 26px;
|
||||
color: #999999;
|
||||
}
|
||||
.contens {
|
||||
color: #333;
|
||||
}
|
||||
}
|
||||
|
||||
.nopass {
|
||||
padding: 24px;
|
||||
margin-top: 24px;
|
||||
background: #fff5f7;
|
||||
border-radius: 16px;
|
||||
font-size: 26px;
|
||||
color: #ff4466;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.AiFixedBtn {
|
||||
.movableArea {
|
||||
.addBtn {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
width: 96px;
|
||||
height: 96px;
|
||||
flex-shrink: 0;
|
||||
background: #fff;
|
||||
box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.2);
|
||||
font-size: 28px;
|
||||
color: #1365dd;
|
||||
border-radius: 50%;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.addBtn {
|
||||
position: fixed;
|
||||
right: 5%;
|
||||
bottom: 15%;
|
||||
width: 96px;
|
||||
height: 96px;
|
||||
line-height: 96px;
|
||||
text-align: center;
|
||||
font-size: 24px;
|
||||
color: #1365dd;
|
||||
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>
|
||||
@@ -1,242 +0,0 @@
|
||||
<template>
|
||||
<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="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>
|
||||
|
||||
<div class="line"></div>
|
||||
|
||||
<u-form-item label="内容" prop="content" required :border-bottom="false" label-position="top" class="contents">
|
||||
<u-input v-model="forms.content" placeholder="请输入详细描述信息" type="textarea" :auto-height="true" maxlength="500" />
|
||||
</u-form-item>
|
||||
<div class="wordLength">{{ forms.content.length }}/500</div>
|
||||
|
||||
<div class="line"></div>
|
||||
|
||||
<u-form-item label="图片上传 (最多9张)" prop="pictures" :border-bottom="false" class="avatars" label-position="top">
|
||||
<AiUploader v-model="forms.pictures" multiple placeholder="上传图片" :limit="9" action="/admin/file/add2"></AiUploader>
|
||||
</u-form-item>
|
||||
|
||||
<div class="line"></div>
|
||||
|
||||
<u-form-item label="所在位置" class="topics" prop="gpsDesc" required :border-bottom="false" right-icon="arrow-right">
|
||||
<u-input v-model="forms.gpsDesc" disabled placeholder="点击定位" @click="chooseAddress" />
|
||||
</u-form-item>
|
||||
</u-form>
|
||||
</div>
|
||||
|
||||
<div class="btn" @click="submit">提交</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapState } from 'vuex'
|
||||
|
||||
export default {
|
||||
name: 'add',
|
||||
components: {},
|
||||
props: {},
|
||||
data() {
|
||||
return {
|
||||
forms: {
|
||||
topic: '',
|
||||
topicValue: '',
|
||||
content: '',
|
||||
pictures: [],
|
||||
gpsDesc: '',
|
||||
lat: '',
|
||||
lng: '',
|
||||
},
|
||||
showStstus: false,
|
||||
flag: false,
|
||||
id: '',
|
||||
}
|
||||
},
|
||||
computed: { ...mapState(['user']) },
|
||||
onLoad(o) {
|
||||
this.$dict.load('villagerCircleTopic').then(() => {
|
||||
this.id = o.id
|
||||
this.getDetail()
|
||||
})
|
||||
},
|
||||
onShow() {},
|
||||
methods: {
|
||||
submit() {
|
||||
if (this.flag) return
|
||||
|
||||
this.$refs.uForm.validate((valid) => {
|
||||
if (valid) {
|
||||
if (!this.forms.topicValue) {
|
||||
return this.$u.toast('请选择话题类型')
|
||||
}
|
||||
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('请选择所在位置')
|
||||
}
|
||||
|
||||
const imgs = []
|
||||
if (this.forms.pictures) {
|
||||
this.forms.pictures.map((e) => {
|
||||
imgs.push({ url: e.url, id: e.id })
|
||||
})
|
||||
}
|
||||
|
||||
this.flag = true
|
||||
this.$instance
|
||||
.post(`/app/appvillagercircleinfo/addOrUpdate`, {
|
||||
topic: this.forms.topic,
|
||||
content: this.forms.content,
|
||||
pictures: imgs || [],
|
||||
createUserResidentId: this.user.id,
|
||||
areaId: this.$areaId,
|
||||
gpsDesc: this.forms.gpsDesc,
|
||||
lat: this.forms.lat,
|
||||
lng: this.forms.lng,
|
||||
id: this.id,
|
||||
})
|
||||
.then((res) => {
|
||||
if (res.code == 0) {
|
||||
this.flag = false
|
||||
this.$u.toast('提交成功')
|
||||
uni.$emit('updateList')
|
||||
setTimeout(() => {
|
||||
uni.navigateBack()
|
||||
}, 600)
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
this.$u.toast('提交失败')
|
||||
})
|
||||
.finally(() => {
|
||||
this.flag = false
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
getDetail() {
|
||||
if (this.id) {
|
||||
this.$instance.post(`/app/appvillagercircleinfo/queryDetailById?id=${this.id}`).then((res) => {
|
||||
if (res.code == 0) {
|
||||
this.forms = res.data
|
||||
this.forms.topicValue = this.$dict.getLabel('villagerCircleTopic', this.forms.topic)
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
selectStatus(e) {
|
||||
this.forms.topic = e[0].value
|
||||
this.forms.topicValue = e[0].label
|
||||
},
|
||||
|
||||
chooseAddress() {
|
||||
uni.chooseLocation({
|
||||
success: (res) => {
|
||||
console.log(res)
|
||||
this.forms.gpsDesc = res.name
|
||||
this.forms.lat = res.latitude
|
||||
this.forms.lng = res.longitude
|
||||
},
|
||||
})
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.add {
|
||||
height: 100%;
|
||||
|
||||
.u-forms {
|
||||
padding-bottom: 112px;
|
||||
::v-deep .u-form {
|
||||
background: #fff;
|
||||
.u-form-item {
|
||||
padding: 0 32px !important;
|
||||
.u-form-item__body {
|
||||
.u-form-item--right__content__slot {
|
||||
padding-bottom: 0;
|
||||
.u-input {
|
||||
text-align: right !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.u-form-item:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.topics {
|
||||
.u-form-item__body {
|
||||
padding: 30px 0 !important;
|
||||
}
|
||||
}
|
||||
|
||||
.contents {
|
||||
padding-bottom: 20px !important;
|
||||
.u-form-item__body {
|
||||
.u-form-item--right__content__slot {
|
||||
.u-input {
|
||||
text-align: left !important;
|
||||
}
|
||||
}
|
||||
.default {
|
||||
width: 160px;
|
||||
height: 160px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.avatars {
|
||||
::v-deep .ai-uploader {
|
||||
.imgs {
|
||||
.img {
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
.image {
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.line {
|
||||
height: 24px;
|
||||
background: #f3f6f9;
|
||||
}
|
||||
}
|
||||
}
|
||||
.wordLength {
|
||||
color: #999;
|
||||
text-align: right;
|
||||
padding: 10px 40px;
|
||||
background-color: #ffffff;
|
||||
}
|
||||
|
||||
.btn {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
height: 112px;
|
||||
line-height: 112px;
|
||||
background: #1365dd;
|
||||
text-align: center;
|
||||
font-size: 32px;
|
||||
font-weight: 500;
|
||||
color: #ffffff;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,478 +0,0 @@
|
||||
<template>
|
||||
<div class="Page">
|
||||
<div class="top" v-if="detail.status == 2">
|
||||
<div class="tops">{{ detail.auditOpinion }}</div>
|
||||
</div>
|
||||
|
||||
<div class="middle">
|
||||
<div class="cardTop">
|
||||
<img :src="avatarUrl || user.avatarUrl" alt="" />
|
||||
|
||||
<div class="rightTop">
|
||||
<div class="leftStaus">
|
||||
<span class="names">{{ detail.createUserName || detail.replyUserName }}</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/AppVillager/4.png" alt="" @click.stop="delShow = true" class="dels" /> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="cardConts">{{ detail.content }}</div>
|
||||
|
||||
<div class="cardImg">
|
||||
<img :src="item.url" alt="" v-for="(items, i) in detail.pictures" :key="i" @click.stop="previewImage(detail.pictures, item.url)" />
|
||||
</div>
|
||||
|
||||
<div class="cardBot">
|
||||
<div class="icons">
|
||||
<u-icon name="map-fill"></u-icon>
|
||||
<span>{{ detail.gpsDesc }}</span>
|
||||
</div>
|
||||
|
||||
<div class="icones">
|
||||
<div class="img1">
|
||||
<img src="https://cdn.cunwuyun.cn/dvcp/AppVillager/1.png" alt="" class="img11" />
|
||||
</div>
|
||||
|
||||
<div class="rightFlex">
|
||||
<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" v-if="tabCurrent1 == 0">
|
||||
<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.comments" :key="index" v-if="index < 3">{{ items.replyUserName }}</span>
|
||||
等{{ detail.comments.length }}人</span
|
||||
>
|
||||
</div>
|
||||
|
||||
<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)" 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>
|
||||
|
||||
<u-popup v-model="poupShow" height="auto" mode="bottom" @close="close">
|
||||
<div class="comments-wrapper">
|
||||
<u-input v-model="content" placeholder="写下你的想法" type="textarea" auto-height :clearable="false" height="180" maxlength="140"> </u-input>
|
||||
<div class="words">字数{{ content.length }}/140</div>
|
||||
|
||||
<div class="bottombtn">
|
||||
<div class="emptys" @click="content = ''">清空内容</div>
|
||||
|
||||
<div class="publishs" @click="send">发送</div>
|
||||
</div>
|
||||
</div>
|
||||
</u-popup>
|
||||
|
||||
<u-popup v-model="deleShow" mode="bottom" class="popupdele">
|
||||
<div class="hint">删除评论</div>
|
||||
<div class="dele" @click="modalShow = true">删除</div>
|
||||
<div class="liness"></div>
|
||||
<div class="cancel" @click="deleShow = false">取消</div>
|
||||
</u-popup>
|
||||
|
||||
<u-modal v-model="modalShow" content="确定删除该留言" :mask-close-able="true" @confirm="confirmDelete"></u-modal>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapState } from 'vuex'
|
||||
|
||||
export default {
|
||||
name: 'detail',
|
||||
components: {},
|
||||
props: {},
|
||||
data() {
|
||||
return {
|
||||
id: '',
|
||||
avatarUrl: '',
|
||||
detail: {},
|
||||
poupShow: false,
|
||||
content: '',
|
||||
flag: false,
|
||||
pageShow: false,
|
||||
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(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() {
|
||||
if (this.flag) return
|
||||
if (!this.content) {
|
||||
return this.$u.toast('请输入你的想法')
|
||||
}
|
||||
|
||||
this.$instance
|
||||
.post(`/app/appvillagercirclecomment/addOrUpdate`, {
|
||||
content: this.content,
|
||||
replyUserResidentId: this.user.id,
|
||||
replyUserName: this.user.name,
|
||||
areaId: this.$areaId,
|
||||
vcId: this.detail.id,
|
||||
})
|
||||
.then((res) => {
|
||||
if (res?.code == 0) {
|
||||
this.$u.toast('发送成功')
|
||||
this.flag = false
|
||||
this.content = ''
|
||||
this.poupShow = false
|
||||
this.getDetail()
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
like() {
|
||||
if (this.flagLike) return
|
||||
|
||||
this.flagLike = true
|
||||
this.$instance
|
||||
.post(`/app/appvillagercircleinfo/up?id=${this.detail.id}&userId=${this.user.id}`)
|
||||
.then((res) => {
|
||||
this.$hideLoading()
|
||||
if (res.code === 0) {
|
||||
this.$u.toast(this.detail.upFlag == 0 ? '点赞成功' : '取消点赞成功')
|
||||
this.getDetail()
|
||||
setTimeout(() => {
|
||||
this.flagLike = false
|
||||
}, 600)
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
this.$u.toast(err)
|
||||
this.flagLike = false
|
||||
})
|
||||
},
|
||||
|
||||
confirmDelete() {
|
||||
this.$instance
|
||||
.post(`/app/appvillagercirclecomment/delete?ids=${this.deleId}`)
|
||||
.then((res) => {
|
||||
if (res.code == 0) {
|
||||
this.deleShow = false
|
||||
this.deleId = ''
|
||||
this.modalShow = false
|
||||
this.$u.toast('删除成功')
|
||||
this.getDetail()
|
||||
}
|
||||
})
|
||||
.catch((e) => {
|
||||
this.$hideLoading()
|
||||
this.$u.toast(e)
|
||||
})
|
||||
},
|
||||
|
||||
deleShowBtn(item) {
|
||||
this.deleId = item.id
|
||||
this.deleShow = true
|
||||
},
|
||||
|
||||
previewImage(images, img) {
|
||||
uni.previewImage({
|
||||
urls: images.map((v) => v.url),
|
||||
current: img,
|
||||
})
|
||||
},
|
||||
},
|
||||
onShareAppMessage() {
|
||||
return {
|
||||
// title: this.info.title,
|
||||
// path: `/mods/AppActivityList/AppActivityList?id=${this.id}`,
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.Page {
|
||||
background: #fff;
|
||||
padding: 0 32px;
|
||||
.top {
|
||||
padding-top: 32px;
|
||||
.tops {
|
||||
padding: 24px;
|
||||
font-size: 26px;
|
||||
color: #ff4466;
|
||||
background: #fff5f7;
|
||||
border-radius: 16px;
|
||||
}
|
||||
}
|
||||
|
||||
.middle {
|
||||
padding: 32px 0 48px 0;
|
||||
.cardTop {
|
||||
display: flex;
|
||||
img {
|
||||
width: 96px;
|
||||
height: 96px;
|
||||
border-radius: 50%;
|
||||
}
|
||||
.rightTop {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
.leftStaus {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
margin-left: 16px;
|
||||
.names {
|
||||
font-size: 32px;
|
||||
font-weight: 500;
|
||||
}
|
||||
.titless {
|
||||
font-size: 26px;
|
||||
color: #6e727a;
|
||||
margin-top: 6px;
|
||||
.topics {
|
||||
margin-right: 8px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.statusDele {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
.status {
|
||||
font-size: 28px;
|
||||
}
|
||||
.status0 {
|
||||
color: #42d784;
|
||||
}
|
||||
.status1 {
|
||||
color: #ff4466;
|
||||
}
|
||||
.status2 {
|
||||
color: #ff883c;
|
||||
}
|
||||
.dels {
|
||||
margin-left: 20px;
|
||||
width: 68px;
|
||||
// height: 68px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.cardConts {
|
||||
margin-top: 24px;
|
||||
font-size: 32px;
|
||||
}
|
||||
|
||||
.cardImg {
|
||||
margin-top: 24px;
|
||||
img {
|
||||
width: 226px;
|
||||
height: 226px;
|
||||
margin-right: 4px;
|
||||
}
|
||||
img:nth-child(3n + 0) {
|
||||
margin-right: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.cardBot {
|
||||
margin-top: 24px;
|
||||
.icons {
|
||||
padding: 8px 32px 8px 16px;
|
||||
background: #eff1f3;
|
||||
border-radius: 28px;
|
||||
}
|
||||
.icones {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
margin-top: 24px;
|
||||
.img1 {
|
||||
width: 60%;
|
||||
.img11 {
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
}
|
||||
}
|
||||
.rightFlex {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
width: 27%;
|
||||
.img2,
|
||||
.img3 {
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.reply {
|
||||
margin-top: 32px;
|
||||
padding: 0 24px 24px 24px;
|
||||
background: #f7f8f9;
|
||||
border-radius: 16px;
|
||||
.replyTop {
|
||||
padding: 20px 0;
|
||||
margin-bottom: 18px;
|
||||
img {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
vertical-align: bottom;
|
||||
}
|
||||
.people {
|
||||
font-size: 28px;
|
||||
font-weight: 500;
|
||||
color: #485d87;
|
||||
margin-left: 8px;
|
||||
}
|
||||
}
|
||||
|
||||
.replyCont {
|
||||
margin-top: 8px;
|
||||
font-size: 28px;
|
||||
font-weight: 500;
|
||||
.nameLeft {
|
||||
color: #485d87;
|
||||
margin-right: 12px;
|
||||
}
|
||||
.contRight {
|
||||
color: #485d87;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.comments-wrapper {
|
||||
padding: 20px 0;
|
||||
background: #f7f7f7;
|
||||
.u-input {
|
||||
background: #fff;
|
||||
border-radius: 8px 8px 0 0;
|
||||
padding: 10px !important;
|
||||
margin: 0 30px 0 30px;
|
||||
|
||||
.uni-textarea-placeholder {
|
||||
padding: 16px 0 0 16px;
|
||||
}
|
||||
.uni-textarea-textarea {
|
||||
padding: 16px 0 0 16px;
|
||||
}
|
||||
}
|
||||
.words {
|
||||
background: #f7f7f7;
|
||||
border-radius: 0 0 8px 8px;
|
||||
margin: 0 30px;
|
||||
padding: 10px;
|
||||
text-align: right;
|
||||
font-size: 26px;
|
||||
color: #999999;
|
||||
}
|
||||
.bottombtn {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin: 0 30px;
|
||||
padding: 20px 0 0;
|
||||
.emptys {
|
||||
font-size: 26px;
|
||||
color: #666666;
|
||||
}
|
||||
.publishs {
|
||||
width: 144px;
|
||||
height: 64px;
|
||||
line-height: 64px;
|
||||
text-align: center;
|
||||
background: #1365dd;
|
||||
border-radius: 32px;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.popupdele {
|
||||
::v-deep .u-drawer-content {
|
||||
border-radius: 24px 24px 0px 0px;
|
||||
text-align: center;
|
||||
.hint {
|
||||
padding: 40px 0 44px 0;
|
||||
border-bottom: 1px solid #e7e8e9;
|
||||
font-size: 24px;
|
||||
color: #666666;
|
||||
font-size: 24px;
|
||||
color: #666666;
|
||||
}
|
||||
.dele {
|
||||
padding: 24px 0 28px 0;
|
||||
font-size: 32px;
|
||||
color: #c25450;
|
||||
}
|
||||
.liness {
|
||||
height: 12px;
|
||||
background: #f6f7f8;
|
||||
}
|
||||
.cancel {
|
||||
padding: 24px 0 62px 0;
|
||||
font-size: 32px;
|
||||
color: #333333;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user