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, '失败信息');