Quellcode durchsuchen

fix defaltcity.lng without judge bug

git vor 5 Jahren
Ursprung
Commit
588973b16c
3 geänderte Dateien mit 3 neuen und 3 gelöschten Zeilen
  1. 1 1
      pages/amap/amap.js
  2. 1 1
      pages/amap/fence/fence.js
  3. 1 1
      pages/amap/route/route.js

+ 1 - 1
pages/amap/amap.js

@@ -198,7 +198,7 @@
             //地图初始化
             var defaultCity = renlian.storage.get('userinfo').baseinfo.defaultCity;
             console.log(defaultCity);
-            if(!defaultCity){
+            if(!defaultCity || !defaultCity.lng || !defaultCity.lat){
                 defaultCity = [109.84040,40.658168];
             }else{
                 defaultCity = [defaultCity.lng, defaultCity.lat];

+ 1 - 1
pages/amap/fence/fence.js

@@ -5,7 +5,7 @@
             $page.find('#fence-switch').rlswitch();
             var userinfo = renlian.storage.get('userinfo');
             var defaultCity = renlian.storage.get('userinfo').baseinfo.defaultCity;
-            if(!defaultCity){
+            if(!defaultCity || !defaultCity.lng || !defaultCity.lat){
                 defaultCity = [109.84040,40.658168];
             }else{
                 defaultCity = [defaultCity.lng, defaultCity.lat];

+ 1 - 1
pages/amap/route/route.js

@@ -6,7 +6,7 @@
            renlian.layer.loading(true, "加载数据中");
            var userinfo = renlian.storage.get('userinfo');
            var defaultCity = renlian.storage.get('userinfo').baseinfo.defaultCity;
-            if(!defaultCity){
+            if(!defaultCity || !defaultCity.lng || !defaultCity.lat){
                 defaultCity = [109.84040,40.658168];
             }else{
                 defaultCity = [defaultCity.lng, defaultCity.lat];