|
...
|
...
|
@@ -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
|
...
|
...
|
|