邓洁:首页定位

This commit is contained in:
dengj
2023-11-08 14:19:13 +08:00
parent b9a196a32d
commit 02f57c1827

View File

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