zhujindu 7 ماه پیش
والد
کامیت
424223c530
1فایلهای تغییر یافته به همراه11 افزوده شده و 8 حذف شده
  1. 11 8
      src/views/storeManagement/storeAdd.vue

+ 11 - 8
src/views/storeManagement/storeAdd.vue

@@ -1395,14 +1395,17 @@ export default {
       var location = new TMap.LatLng(that.location.lat1, that.location.lon1);
       map.setCenter(location);
       markers.updateGeometries([{ id: 'marker', position: location }]);
-      geocoder.getAddress({ location: location }).then(function (result) {
-        var addresses = result.result.formatted_addresses;
-        that.fromValue.cityNameOld = result.result.ad_info.city;
-        that.fromValue.districtNameOld = result.result.ad_info.district;
-        that.fromValue.addressLine = addresses.recommend;
-        localStorage.setItem('locationRemark', addresses.recommend);
-        that.beforeAddFn();
-      });
+      geocoder
+        .getAddress({ location: location })
+        .then(function (result) {
+          var addresses = result.result.formatted_addresses;
+          that.fromValue.cityNameOld = result.result.ad_info.city;
+          that.fromValue.districtNameOld = result.result.ad_info.district;
+          that.fromValue.addressLine = addresses.recommend;
+          localStorage.setItem('locationRemark', addresses.recommend);
+          that.beforeAddFn();
+        })
+        .catch((error) => console.error('Geocoding error:', error));
     },
     getLocation() {
       if (localStorage.getItem('loginType') == 'cs') {