From 02f57c1827fbd5afc0519f0b4cf45595bef801f6 Mon Sep 17 00:00:00 2001 From: dengj <209192278@qq.com> Date: Wed, 8 Nov 2023 14:19:13 +0800 Subject: [PATCH] =?UTF-8?q?=E9=82=93=E6=B4=81:=E9=A6=96=E9=A1=B5=E5=AE=9A?= =?UTF-8?q?=E4=BD=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/InputAndSwiper/InputAndSwiper.vue | 27 ++++++-------------- 1 file changed, 8 insertions(+), 19 deletions(-) diff --git a/components/InputAndSwiper/InputAndSwiper.vue b/components/InputAndSwiper/InputAndSwiper.vue index 4c7c95c..77316e2 100644 --- a/components/InputAndSwiper/InputAndSwiper.vue +++ b/components/InputAndSwiper/InputAndSwiper.vue @@ -35,8 +35,7 @@ }, data() { return { - position: '定位12', - location: '' + position: '' }; }, options: { @@ -45,21 +44,10 @@ created() { console.log('createsd'); this.open() - console.log('location', this.location); - }, - watch: { - location(val) { - console.log('foo变化了,变化后的值是', val) - // 具体操作=>doSomething - } - }, - onShow() { - console.log('onshow'); - // const location = this.open() - // console.log('location', this.location); }, methods: { getLocation1() { + var that = this let qqmapsdk = new QQMapWX({ key: 'ZRKBZ-Q7FWL-GVZPK-MCRBU-4XFB5-ATBDB' }); @@ -74,11 +62,12 @@ longitude: res.longitude }, success: (re) => { - console.log("解析地址成功", res); - console.log(re.result.ad_info.city, '成都市=='); - console.log(re.result.ad_info.district, '武侯区=='); - this.location = re.result.ad_info - console.log('success', this.location); + console.log("解析地址成功", re); + console.log(re.result.ad_info.city,); + console.log(re.result.ad_info.district, ); + let city=re.result.ad_info.city + let district=re.result.ad_info.district + that.position = city.slice(0,2) + district.slice(0,2) }, fail: (re) => { console.log(re, '失败信息');