This commit is contained in:
花有清香月有阴
2022-02-18 18:34:57 +08:00
parent e0ddc13369
commit b0c57fbc6e
3 changed files with 21 additions and 5 deletions

View File

@@ -1,5 +1,5 @@
<template> <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> <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="top">
@@ -40,7 +40,7 @@
<div class="dels" @click.stop=";(delShow = true), (deleId = item.id)">删除</div> <div class="dels" @click.stop=";(delShow = true), (deleId = item.id)">删除</div>
</div> --> </div> -->
<img src="https://cdn.cunwuyun.cn/dvcp/AppVillager/4.png" alt="" @click.stop=";(delAndEdit = true), (editId = item.id), (deleId = item.id)" class="dels" /> <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>
</div> </div>
@@ -96,7 +96,7 @@
<u-modal v-model="delShow" content="确定删除该数据" :mask-close-able="true" @confirm="confirmDel"></u-modal> <u-modal v-model="delShow" content="确定删除该数据" :mask-close-able="true" @confirm="confirmDel"></u-modal>
<u-mask :show="delAndEdit" @click="delAndEdit = false"> <u-mask :show="delAndEdit" @click=";(delAndEdit = false), (statDisabled = '')">
<div class="warp"> <div class="warp">
<div class="rect" @tap.stop="toAdd(0)">编辑</div> <div class="rect" @tap.stop="toAdd(0)">编辑</div>
<div class="rect" @tap.stop=";(delAndEdit = false), (delShow = true)">删除</div> <div class="rect" @tap.stop=";(delAndEdit = false), (delShow = true)">删除</div>
@@ -115,6 +115,7 @@ export default {
props: {}, props: {},
data() { data() {
return { return {
showPage: false,
tabs: [ tabs: [
{ {
name: '本村', name: '本村',
@@ -167,6 +168,7 @@ export default {
flag: false, flag: false,
delAndEdit: false, delAndEdit: false,
editId: '', editId: '',
statDisabled: '',
} }
}, },
computed: { ...mapState(['user']) }, computed: { ...mapState(['user']) },
@@ -200,6 +202,9 @@ export default {
this.data = this.current > 1 ? [...this.data, ...res.data.records] : res.data.records this.data = this.current > 1 ? [...this.data, ...res.data.records] : res.data.records
} }
}) })
.finally(() => {
this.showPage = true
})
}, },
init() { init() {
@@ -233,6 +238,11 @@ export default {
}, },
toAdd(index) { toAdd(index) {
if (this.statDisabled == 0) {
this.delAndEdit = false
return this.$u.toast('该数据未审核')
}
this.delAndEdit = false this.delAndEdit = false
if (index == 0) { if (index == 0) {
this.$linkTo(`./add?id=${this.editId}`) this.$linkTo(`./add?id=${this.editId}`)
@@ -253,6 +263,8 @@ export default {
this.deleShow = false this.deleShow = false
this.modalShow = false this.modalShow = false
this.deleId = '' this.deleId = ''
this.statDisabled = ''
this.$u.toast('删除成功')
this.init() this.init()
} }
}) })
@@ -499,7 +511,7 @@ export default {
padding: 24px; padding: 24px;
background: #f3f6f9; background: #f3f6f9;
border-radius: 16px; border-radius: 16px;
margin: 24px; margin-top: 24px;
.toReply { .toReply {
font-size: 26px; font-size: 26px;
color: #999999; color: #999999;

View File

@@ -76,6 +76,9 @@ export default {
if (!this.forms.content) { if (!this.forms.content) {
return this.$u.toast('请输入内容') return this.$u.toast('请输入内容')
} }
if (!this.forms.gpsDesc) {
return this.$u.toast('请选择所在位置')
}
if (!this.forms.lat && !this.forms.lng) { if (!this.forms.lat && !this.forms.lng) {
return this.$u.toast('请选择所在位置') return this.$u.toast('请选择所在位置')
} }

View File

@@ -174,7 +174,7 @@ export default {
}) })
.then((res) => { .then((res) => {
if (res?.code == 0) { if (res?.code == 0) {
this.$u.toast('留言成功') this.$u.toast('发送成功')
this.flag = false this.flag = false
this.content = '' this.content = ''
this.poupShow = false this.poupShow = false
@@ -213,6 +213,7 @@ export default {
this.deleShow = false this.deleShow = false
this.deleId = '' this.deleId = ''
this.modalShow = false this.modalShow = false
this.$u.toast('删除成功')
this.getDetail() this.getDetail()
} }
}) })