|
@@ -70,7 +70,7 @@ Page({ |
|
@@ -70,7 +70,7 @@ Page({ |
|
70
|
* 生命周期函数--监听页面显示
|
70
|
* 生命周期函数--监听页面显示
|
|
71
|
*/
|
71
|
*/
|
|
72
|
onShow: function () {
|
72
|
onShow: function () {
|
|
73
|
- this.getPos()
|
73
|
+ this.selectComponent('#getpos').getPos();
|
|
74
|
},
|
74
|
},
|
|
75
|
|
75
|
|
|
76
|
/**
|
76
|
/**
|
|
@@ -149,42 +149,6 @@ Page({ |
|
@@ -149,42 +149,6 @@ Page({ |
|
149
|
}
|
149
|
}
|
|
150
|
)
|
150
|
)
|
|
151
|
},
|
151
|
},
|
|
152
|
- getPos(){
|
|
|
|
153
|
- this._getPos().then(res => {
|
|
|
|
154
|
- console.log('wx.getLocation.then', res);
|
|
|
|
155
|
- this.location=res
|
|
|
|
156
|
- this.GetSellerDetail();
|
|
|
|
157
|
- }).catch((e) => {
|
|
|
|
158
|
- console.log('wx.getLocation.catch', e);
|
|
|
|
159
|
- if ('getLocation:fail auth deny' == e.errMsg || 'getLocation:fail:auth denied' == e.errMsg) {
|
|
|
|
160
|
- this.selectComponent('#showModal').options({
|
|
|
|
161
|
- header: '定位失败',
|
|
|
|
162
|
- body: '需要地理位置授权'
|
|
|
|
163
|
- }).show();
|
|
|
|
164
|
- } else {
|
|
|
|
165
|
- setTimeout(() => {
|
|
|
|
166
|
- this.getPos()
|
|
|
|
167
|
- }, 500)
|
|
|
|
168
|
- }
|
|
|
|
169
|
-
|
|
|
|
170
|
- })
|
|
|
|
171
|
- },
|
|
|
|
172
|
- _getPos(){
|
|
|
|
173
|
- return new Promise((success, fail) => {
|
|
|
|
174
|
- wx.getLocation({
|
|
|
|
175
|
- type: 'gcj02',
|
|
|
|
176
|
- success: (res) => {
|
|
|
|
177
|
- success(res)
|
|
|
|
178
|
- },
|
|
|
|
179
|
- fail: (res) => {
|
|
|
|
180
|
- fail(res)
|
|
|
|
181
|
- },
|
|
|
|
182
|
- complete: (res) => {
|
|
|
|
183
|
- console.log('wx.getLocation', res)
|
|
|
|
184
|
- }
|
|
|
|
185
|
- });
|
|
|
|
186
|
- })
|
|
|
|
187
|
- },
|
|
|
|
188
|
lookLocation:function(){
|
152
|
lookLocation:function(){
|
|
189
|
//console.log(this.data.seller.lat,this.data.seller.long,this.data.detail.map_address)
|
153
|
//console.log(this.data.seller.lat,this.data.seller.long,this.data.detail.map_address)
|
|
190
|
wx.openLocation({
|
154
|
wx.openLocation({
|
|
@@ -197,4 +161,9 @@ Page({ |
|
@@ -197,4 +161,9 @@ Page({ |
|
197
|
}
|
161
|
}
|
|
198
|
})
|
162
|
})
|
|
199
|
},
|
163
|
},
|
|
|
|
164
|
+ onpos(e){
|
|
|
|
165
|
+ console.log(e);
|
|
|
|
166
|
+ this.location=e.detail
|
|
|
|
167
|
+ this.GetSellerDetail();
|
|
|
|
168
|
+ },
|
|
200
|
}) |
169
|
}) |