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