Commit a595ab0ac3ead77f10756cec66efae916bf47ea0

Authored by vking
1 parent d9071ae6

search

... ... @@ -55,12 +55,11 @@ Component({
})
},
tapButton(e) {
if(util.attr(e, 'type')=='confirm'){
this.triggerEvent('event', {type: util.attr(e, 'type')})
}
this.hide();
//this.triggerEvent('event', {type: util.attr(e, 'type')})
this.hide(util.attr(e, 'type'));
},
hide() {
hide(type='') {
this.triggerEvent('event', {type: type})
this.setData({
hasShow: false,
})
... ...
... ... @@ -33,6 +33,7 @@ Component({
async init(){
this.position={}
this.isAddr=false
this.useDefTS=false
this.citys=await DA.getCitys()
this.cacheCity=null
this.setData({
... ... @@ -46,7 +47,7 @@ Component({
},
rePos(e){
this.cacheCity=null
this.isAddr=util.attr(e,'isAddr')
this.isAddr=util.attr(e,'isAddr') && !this.useDefTS
this.selectComponent('#getpos').getPos();
},
hide(){
... ... @@ -75,6 +76,12 @@ Component({
onpos(e) {
let res = e.detail;
console.log('onpos.res', res);
let useDef=false
if(res.latitude==''){//默认使用唐山
this.useDefTS=true
res.latitude=39.684670
res.longitude=118.176300
}
this.position.latitude = res.latitude;
this.position.longitude = res.longitude;
qqmapsdk.reverseGeocoder({
... ... @@ -86,7 +93,7 @@ Component({
if(res.status!=0) return;
console.log('qqmapsdk.reverseGeocoder',res.result)
this.position.address_component= res.result.address_component
this.position.address=res.result.address
this.position.address=this.useDefTS?'':res.result.address
let activeCity={}
if(this.cacheCity){
activeCity=this.cacheCity
... ...
... ... @@ -97,12 +97,20 @@ Component({
})
},
confirmEvent(e){
wx.openSetting({
success:res=>{
console.log('getPos.openSetting',res)
this.getPos();
}
})
console.log('confirmEvent.type',e.detail.type)
if(e.detail.type=='confirm') {
wx.openSetting({
success: res => {
console.log('getPos.openSetting', res)
this.getPos();
}
})
}else{
this.triggerEvent("pos",{
latitude: '',
longitude: '',
});
}
},
}
})
... ...
... ... @@ -135,7 +135,10 @@ Component({
})
},
confirmEvent(e){
wx.openSetting()
console.log('confirmEvent.type',e.detail.type)
if(e.detail.type=='confirm') {
wx.openSetting()
}
},
}
})
... ...
... ... @@ -31,7 +31,9 @@
"projectname": "c%E7%AB%AF%E9%A2%84%E5%AE%9A",
"isGameTourist": false,
"simulatorType": "wechat",
"simulatorPluginLibVersion": {},
"simulatorPluginLibVersion": {
"qywx_simulator_plugin": "1.2.0"
},
"skeleton-config": {
"global": {
"loading": "chiaroscuro",
... ...