This commit is contained in:
shijingjing
2022-08-25 17:24:33 +08:00
parent 9894cecb74
commit aaf2b8b475

View File

@@ -66,12 +66,7 @@ export default {
...mapState(['user']),
},
onLoad() {
this.$dict.load('villagerCircleTopic').then(() => {
// var value = wx.getStorageSync('lat_lng')
// this.forms.lat = value.latitude
// this.forms.lng = value.longitude
// this.forms.gpsDesc = value.name
})
this.$dict.load('villagerCircleTopic')
},
onShow() {
uni.setNavigationBarTitle({
@@ -84,6 +79,7 @@ export default {
this.$refs.uForm.validate((valid) => {
if (valid) {
if (!this.forms.topicValue) {
return this.$u.toast('请选择话题类型')
}
@@ -104,8 +100,8 @@ export default {
})
}
this.$instance
.post(`/app/appvillagercircleinfo/addOrUpdate`, {
this.flag = true
this.$instance.post(`/app/appvillagercircleinfo/addOrUpdate`, {
topic: this.forms.topic,
content: this.forms.content,
pictures: imgs || [],
@@ -115,22 +111,17 @@ export default {
lat: this.forms.lat,
lng: this.forms.lng,
id: this.id,
})
.then((res) => {
if (res.code == 0) {
}).then((res) => {
if (res?.code == 0) {
this.flag = false
this.$u.toast('提交成功')
// uni.clearStorageSync()
uni.$emit('updateList')
this.flag = true
setTimeout(() => {
uni.navigateBack()
}, 600)
}
})
.catch(() => {
this.flag = false
this.$u.toast('提交失败')
})
}
})
},