提交修改
This commit is contained in:
@@ -70,7 +70,6 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
...mapActions(['injectJWeixin', 'agentSign']),
|
...mapActions(['injectJWeixin', 'agentSign']),
|
||||||
|
|
||||||
submit() {
|
submit() {
|
||||||
if (this.flag) return
|
if (this.flag) return
|
||||||
if (!this.forms.content) {
|
if (!this.forms.content) {
|
||||||
@@ -80,7 +79,6 @@ export default {
|
|||||||
if (this.forms.typeName === '') {
|
if (this.forms.typeName === '') {
|
||||||
return this.$u.toast('请选择类型')
|
return this.$u.toast('请选择类型')
|
||||||
}
|
}
|
||||||
|
|
||||||
this.$http.post(`/app/appgirdnews/addOrUpdate`, {...this.forms}).then((res) => {
|
this.$http.post(`/app/appgirdnews/addOrUpdate`, {...this.forms}).then((res) => {
|
||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
uni.$emit('update')
|
uni.$emit('update')
|
||||||
@@ -92,26 +90,25 @@ export default {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
selectType(e) {
|
selectType(e) {
|
||||||
this.forms.type = e[0].value
|
this.forms.type = e[0].value
|
||||||
this.forms.typeName = e[0].label
|
this.forms.typeName = e[0].label
|
||||||
},
|
},
|
||||||
|
getLocation() {
|
||||||
getLocation () {
|
this.injectJWeixin('getLocation').then(() => {
|
||||||
this.injectJWeixin(['getLocation']).then(() => {
|
uni.getLocation({
|
||||||
wx.getLocation({
|
|
||||||
type: 'wgs84',
|
type: 'wgs84',
|
||||||
success: res2 => {
|
success: res2 => {
|
||||||
alert(res2)
|
|
||||||
this.forms.lng = res2.longitude
|
this.forms.lng = res2.longitude
|
||||||
this.forms.lat = res2.latitude
|
this.forms.lat = res2.latitude
|
||||||
this.$http.post('/api/appdvcpconfig/apiForward', `https://apis.map.qq.com/ws/geocoder/v1/?location=${this.forms.lat},${this.forms.lng}&key=3RZBZ-LZUCF-CT6J5-NWKZH-FCWOQ-UUFKY&get_poi=1`).then(res => {
|
this.$http.post('/api/appdvcpconfig/apiForward', null, {
|
||||||
if (res.code == 0) {
|
params: {
|
||||||
alert(res)
|
url: `https://apis.map.qq.com/ws/geocoder/v1/?location=${this.forms.lat},${this.forms.lng}&key=3RZBZ-LZUCF-CT6J5-NWKZH-FCWOQ-UUFKY&get_poi=1`
|
||||||
|
}
|
||||||
|
}).then(res => {
|
||||||
|
console.log("获取详细地址信息:", res)
|
||||||
|
if (res?.code == 0) {
|
||||||
this.forms.address = res.data.result.address
|
this.forms.address = res.data.result.address
|
||||||
}else {
|
|
||||||
alert(res)
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user