diff --git a/src/project/biaopin/AppGridReview/Add.vue b/src/project/biaopin/AppGridReview/Add.vue index dabbfda4..c5b2d747 100644 --- a/src/project/biaopin/AppGridReview/Add.vue +++ b/src/project/biaopin/AppGridReview/Add.vue @@ -4,7 +4,7 @@ + height="100" maxlength="300"/>
@@ -13,7 +13,7 @@
+ @confirm="selectType">
@@ -22,7 +22,7 @@ + action="/admin/file/add2">
@@ -70,7 +70,6 @@ export default { }, methods: { ...mapActions(['injectJWeixin', 'agentSign']), - submit() { if (this.flag) return if (!this.forms.content) { @@ -80,7 +79,6 @@ export default { if (this.forms.typeName === '') { return this.$u.toast('请选择类型') } - this.$http.post(`/app/appgirdnews/addOrUpdate`, {...this.forms}).then((res) => { if (res.code == 0) { uni.$emit('update') @@ -92,26 +90,25 @@ export default { } }) }, - selectType(e) { this.forms.type = e[0].value this.forms.typeName = e[0].label }, - - getLocation () { - this.injectJWeixin(['getLocation']).then(() => { - wx.getLocation({ + getLocation() { + this.injectJWeixin('getLocation').then(() => { + uni.getLocation({ type: 'wgs84', success: res2 => { - alert(res2) this.forms.lng = res2.longitude 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 => { - if (res.code == 0) { - alert(res) + this.$http.post('/api/appdvcpconfig/apiForward', null, { + params: { + 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 - }else { - alert(res) } }) },