Commit 0bc2d31b54f34d1346a03ef72bf99a131194dc74

Authored by wangfan
1 parent 491c9d48

C端调整

@@ -38,6 +38,7 @@ Component({ @@ -38,6 +38,7 @@ Component({
38 latitude: '', 38 latitude: '',
39 longitude: '', 39 longitude: '',
40 }); 40 });
  41 + wx.hideLoading()
41 return; 42 return;
42 } 43 }
43 if(failCount>2){//定位失败 44 if(failCount>2){//定位失败
@@ -54,6 +55,7 @@ Component({ @@ -54,6 +55,7 @@ Component({
54 latitude:'', 55 latitude:'',
55 longitude:'', 56 longitude:'',
56 }); 57 });
  58 + wx.hideLoading()
57 }, 59 },
58 }) 60 })
59 return; 61 return;
@@ -67,6 +69,7 @@ Component({ @@ -67,6 +69,7 @@ Component({
67 latitude: '', 69 latitude: '',
68 longitude: '', 70 longitude: '',
69 }); 71 });
  72 + wx.hideLoading()
70 return; 73 return;
71 } 74 }
72 this.selectComponent('#showModal').options({ 75 this.selectComponent('#showModal').options({
@@ -99,7 +102,6 @@ Component({ @@ -99,7 +102,6 @@ Component({
99 fail(res) 102 fail(res)
100 }, 103 },
101 complete: (res) => { 104 complete: (res) => {
102 - wx.hideLoading()  
103 console.log('wx.getLocation', res) 105 console.log('wx.getLocation', res)
104 } 106 }
105 }); 107 });
@@ -43,6 +43,7 @@ Page({ @@ -43,6 +43,7 @@ Page({
43 hasGetSellersEnd:false, 43 hasGetSellersEnd:false,
44 hasSetActivity:false, 44 hasSetActivity:false,
45 }, 45 },
  46 + hasClickMoveToLocation:false,//点击回到我的位置
46 hasSellerConcat:hasSellerConcat, 47 hasSellerConcat:hasSellerConcat,
47 transverseViewHeight:transverseViewHeight,//横向滚动高度,苹果要比安卓多20 48 transverseViewHeight:transverseViewHeight,//横向滚动高度,苹果要比安卓多20
48 //qqmapsdk:null, 49 //qqmapsdk:null,
@@ -224,8 +225,12 @@ Page({ @@ -224,8 +225,12 @@ Page({
224 }); 225 });
225 this.mapCtx.getRegion({ 226 this.mapCtx.getRegion({
226 success:(res)=>{ 227 success:(res)=>{
227 - console.log('regionchange.getRegion',res)  
228 - if((res.southwest.latitude!=this.mapData.region.southwest.latitude) || this.data.hasSuggestion) { 228 + console.log('regionchange.getRegion',res.southwest.latitude,this.mapData.region.southwest.latitude,res)
  229 + if((res.southwest.latitude!=this.mapData.region.southwest.latitude)
  230 + || this.data.hasSuggestion
  231 + || this.hasClickMoveToLocation
  232 + ) {
  233 + this.hasClickMoveToLocation=false
229 this.mapData.region = res 234 this.mapData.region = res
230 this.timeoutGetMarkers(); 235 this.timeoutGetMarkers();
231 } 236 }
@@ -485,13 +490,8 @@ Page({ @@ -485,13 +490,8 @@ Page({
485 wx.showTabBar(); 490 wx.showTabBar();
486 }, 491 },
487 moveToLocation(){ 492 moveToLocation(){
488 - if(this.user.latitude==def_latitude){  
489 - this.selectComponent('#getpos').getPos(true);  
490 - return;  
491 - } 493 + this.hasClickMoveToLocation=true
492 let map=this.data.map; 494 let map=this.data.map;
493 - console.log(this.user.latitude,this.mapData.latitude,def_latitude);  
494 - if(this.user.latitude==this.mapData.latitude && this.user.longitude==this.mapData.longitude) return;  
495 map.latitude=this.user.latitude 495 map.latitude=this.user.latitude
496 map.longitude=this.user.longitude 496 map.longitude=this.user.longitude
497 map.scale=mapScale; 497 map.scale=mapScale;
@@ -502,6 +502,13 @@ Page({ @@ -502,6 +502,13 @@ Page({
502 map:map, 502 map:map,
503 hasSuggestion:false, 503 hasSuggestion:false,
504 }) 504 })
  505 + if(this.user.latitude==def_latitude && this.user.longitude==def_longitude){
  506 + this.selectComponent('#getpos').getPos(true);
  507 + return;
  508 + }
  509 + //console.log(this.user.latitude,this.mapData.latitude,def_latitude);
  510 + //if(this.user.latitude==this.mapData.latitude && this.user.longitude==this.mapData.longitude) return;
  511 + //if(this.user.latitude==def_latitude && this.user.longitude==def_longitude) return;
505 this.mapCtx.moveToLocation({ 512 this.mapCtx.moveToLocation({
506 success:(res)=>{ 513 success:(res)=>{
507 console.log('moveToLocation',res) 514 console.log('moveToLocation',res)