From 87768e36613ebea5a3858ea12d4e5c45fdd99409 Mon Sep 17 00:00:00 2001 From: liuye Date: Sat, 12 Oct 2024 11:55:00 +0800 Subject: [PATCH] test --- src/project/biaopin/AppGridReview/Add.vue | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/project/biaopin/AppGridReview/Add.vue b/src/project/biaopin/AppGridReview/Add.vue index b5ee921b..6098b1f4 100644 --- a/src/project/biaopin/AppGridReview/Add.vue +++ b/src/project/biaopin/AppGridReview/Add.vue @@ -57,8 +57,8 @@ export default { } }, computed: {...mapState(['user'])}, - onLoad() { - console.log(this.user) + onShow() { + document.title = '网格动态' this.forms.girdCode = this.user.gridInfo.girdCode this.forms.girdName = this.user.girdName this.forms.girdId = this.user.girdId @@ -68,9 +68,6 @@ export default { // this.forms.lat = '30.592800' this.getLocation() }, - onShow() { - document.title = '网格动态' - }, methods: { ...mapActions(['injectJWeixin']), @@ -102,15 +99,19 @@ export default { }, getLocation () { - this.injectJWeixin(['getLocation']).then(res1 => { + this.injectJWeixin(['getLocation']).then(() => { wx.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=${res2.latitude},${res2.longitude}&key=3RZBZ-LZUCF-CT6J5-NWKZH-FCWOQ-UUFKY&get_poi=1`).then(res => { - if (res.code === 0) { + if (res.code == 0) { + alert(res) this.forms.address = res.data.result.address + }else { + alert(err) } }) },