Merge pull request '邓洁:首页定位' (#31) from dengjie into master
Reviewed-on: http://git.feashow.cn/odjbin/city-store-transfer/pulls/31
This commit is contained in:
@@ -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, '失败信息');
|
||||
|
||||
Reference in New Issue
Block a user