|
@@ -217,10 +217,11 @@ Page({
|
|
html: store.content,
|
|
html: store.content,
|
|
id: store.objectId,
|
|
id: store.objectId,
|
|
licenseList: licenseList,
|
|
licenseList: licenseList,
|
|
- locations: store.location
|
|
+ locations: store.location,
|
|
|
|
+ address:store.storeAddress
|
|
})
|
|
})
|
|
console.log('首页', this.data.locations);
|
|
console.log('首页', this.data.locations);
|
|
- this.Getlocation()
|
|
+
|
|
|
|
|
|
this.getQiniuOption()
|
|
this.getQiniuOption()
|
|
},
|
|
},
|
|
@@ -322,41 +323,41 @@ Page({
|
|
|
|
|
|
Getlocation() {
|
|
Getlocation() {
|
|
|
|
|
|
- if (this.data.locations) {
|
|
+
|
|
- const storeLocation = this.data.locations;
|
|
+
|
|
|
|
|
|
-
|
|
+
|
|
- const latitude = storeLocation.latitude;
|
|
+
|
|
- const longitude = storeLocation.longitude;
|
|
+
|
|
|
|
|
|
- console.log('获取到的经纬度:', latitude, longitude);
|
|
+
|
|
|
|
|
|
-
|
|
+
|
|
- wx.request({
|
|
+
|
|
- url: 'https://api.map.baidu.com/reverse_geocoding/v3/?ak=sHZTomd7grslfP7sPKB8tRgT49FK9TEu&output=json&coordtype=gcj02&location=' + latitude + ',' + longitude,
|
|
+
|
|
- data: {},
|
|
+
|
|
- header: {
|
|
+
|
|
- 'Content-Type': 'application/json'
|
|
+
|
|
- },
|
|
+
|
|
- success: (ops) => {
|
|
+
|
|
- console.log(ops);
|
|
+
|
|
- const address = ops.data.result.formatted_address;
|
|
+
|
|
- this.setData({
|
|
+
|
|
- address: address,
|
|
+
|
|
- });
|
|
+
|
|
- console.log(this.data.address);
|
|
+
|
|
- },
|
|
+
|
|
- fail: function (resq) {
|
|
+
|
|
- wx.showModal({
|
|
+
|
|
- title: '信息提示',
|
|
+
|
|
- content: '请求失败',
|
|
+
|
|
- showCancel: false,
|
|
+
|
|
- confirmColor: '#f37938'
|
|
+
|
|
- });
|
|
+
|
|
- },
|
|
+
|
|
- complete: function () {}
|
|
+
|
|
- });
|
|
+
|
|
- }
|
|
+
|
|
|
|
|
|
},
|
|
},
|
|
})
|
|
})
|