|
...
|
...
|
@@ -70,7 +70,7 @@ Page({ |
|
|
|
* 生命周期函数--监听页面显示
|
|
|
|
*/
|
|
|
|
onShow: function () {
|
|
|
|
this.getPos()
|
|
|
|
this.selectComponent('#getpos').getPos();
|
|
|
|
},
|
|
|
|
|
|
|
|
/**
|
|
...
|
...
|
@@ -149,42 +149,6 @@ Page({ |
|
|
|
}
|
|
|
|
)
|
|
|
|
},
|
|
|
|
getPos(){
|
|
|
|
this._getPos().then(res => {
|
|
|
|
console.log('wx.getLocation.then', res);
|
|
|
|
this.location=res
|
|
|
|
this.GetSellerDetail();
|
|
|
|
}).catch((e) => {
|
|
|
|
console.log('wx.getLocation.catch', e);
|
|
|
|
if ('getLocation:fail auth deny' == e.errMsg || 'getLocation:fail:auth denied' == e.errMsg) {
|
|
|
|
this.selectComponent('#showModal').options({
|
|
|
|
header: '定位失败',
|
|
|
|
body: '需要地理位置授权'
|
|
|
|
}).show();
|
|
|
|
} else {
|
|
|
|
setTimeout(() => {
|
|
|
|
this.getPos()
|
|
|
|
}, 500)
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
},
|
|
|
|
_getPos(){
|
|
|
|
return new Promise((success, fail) => {
|
|
|
|
wx.getLocation({
|
|
|
|
type: 'gcj02',
|
|
|
|
success: (res) => {
|
|
|
|
success(res)
|
|
|
|
},
|
|
|
|
fail: (res) => {
|
|
|
|
fail(res)
|
|
|
|
},
|
|
|
|
complete: (res) => {
|
|
|
|
console.log('wx.getLocation', res)
|
|
|
|
}
|
|
|
|
});
|
|
|
|
})
|
|
|
|
},
|
|
|
|
lookLocation:function(){
|
|
|
|
//console.log(this.data.seller.lat,this.data.seller.long,this.data.detail.map_address)
|
|
|
|
wx.openLocation({
|
|
...
|
...
|
@@ -197,4 +161,9 @@ Page({ |
|
|
|
}
|
|
|
|
})
|
|
|
|
},
|
|
|
|
onpos(e){
|
|
|
|
console.log(e);
|
|
|
|
this.location=e.detail
|
|
|
|
this.GetSellerDetail();
|
|
|
|
},
|
|
|
|
}) |
|
|
\ No newline at end of file |
...
|
...
|
|