Browse Source

百度地图地址解析接口bug优化

zhujindu 8 tháng trước cách đây
mục cha
commit
a7530e23e3
1 tập tin đã thay đổi với 6 bổ sung4 xóa
  1. 6 4
      src/views/deviceOutside/suishenbangOutstoreVisit.vue

+ 6 - 4
src/views/deviceOutside/suishenbangOutstoreVisit.vue

@@ -449,8 +449,10 @@ export default {
           console.log('province=' + province);
           console.log('city=' + city);
           console.log('district=' + district);
-          console.log(addresses);
-          console.log(addresses.recommend);
+          let recommend = '';
+          if (addresses) {
+            recommend = addresses.recommend;
+          }
           var params = {
             storeId: that.storeId,
             storeCode: that.storeCode,
@@ -461,7 +463,7 @@ export default {
             routeDetailsId: that.rdId,
             visitSource: '1',
             locationCity: '',
-            locationRemark: addresses.recommend,
+            locationRemark: recommend,
             locationAccuracy: that.urlParameter.PointSum,
             province: address_component.province,
             city: address_component.city,
@@ -469,7 +471,7 @@ export default {
           };
           that.locationAccuracy = that.urlParameter.PointSum;
           that.city = '';
-          that.address = addresses.recommend;
+          that.address = recommend;
           localStorage.setItem('address', '');
           if (that.visitId != null) {
             params.id = that.visitId;