Browse Source

新增门店等级错误问题修改

zhujindu 7 months ago
parent
commit
c9fc2fbe92
1 changed files with 17 additions and 14 deletions
  1. 17 14
      src/views/storeManagement/storeAdd.vue

+ 17 - 14
src/views/storeManagement/storeAdd.vue

@@ -943,7 +943,7 @@ export default {
   },
   activated() {
     this.tabVal = 'insidePlan';
-    this.beforeAddFn();
+    // this.beforeAddFn();
     // 授权
     getTicketFun(['getLocation', 'chooseImage', 'uploadImage']).then(() => {
       this.$nextTick(() => {
@@ -1360,10 +1360,10 @@ export default {
           loading1.clear();
           this.$toast.fail('请求超时');
         }
-        // this.getStreetQuery();
-        // this.getStreetQuery('1');
-        // this.getStreetQuery('2');
-        // this.getStreetQuery('3');
+        this.getStreetQuery();
+        this.getStreetQuery('1');
+        this.getStreetQuery('2');
+        this.getStreetQuery('3');
       });
     },
     getChainsByDeptCodesearch(chainName) {
@@ -1396,14 +1396,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') {
@@ -1576,7 +1579,7 @@ export default {
       this.fromValue.townName = '';
       this.fromValue.townCode = '';
       this.countyCode = value.countyCode;
-      // this.fromValue.cityLevel = value.countyLevel;
+      this.fromValue.cityLevel = value.countyLevel;
       this.getStreetQuery('3');
       this.showDistrictPicker = false;
     },