Quellcode durchsuchen

设计师招募

zhujindu vor 5 Monaten
Ursprung
Commit
21f5f5292d
1 geänderte Dateien mit 20 neuen und 15 gelöschten Zeilen
  1. 20 15
      src/views/storeManagement/addDesignerPage.vue

+ 20 - 15
src/views/storeManagement/addDesignerPage.vue

@@ -402,11 +402,10 @@ export default {
     };
   },
   activated() {
+    this.toastLoading(0, '加载中...', true);
     // 授权
     getTicketFun(['getLocation', 'chooseImage', 'uploadImage']).then(() => {
-      this.$nextTick(() => {
-        this.getLocation();
-      });
+      this.getLocation();
     });
     // 获取会员属性
     this.getStoreCategoryList();
@@ -435,19 +434,25 @@ export default {
         });
     },
     initData() {
-      getGeocoder({ latitude: this.location.lat1, longitude: this.location.lon1 }).then((res) => {
-        if (res.status == 0 && res.result) {
-          let result = res.result;
-          this.fromData.cityNameOld = result.ad_info.city;
-          this.fromData.districtNameOld = result.ad_info.district;
-          let addresses = result.formatted_addresses; // 描述性地址
-          if (addresses) {
-            this.fromData.addressLine = addresses.recommend;
-            localStorage.setItem('locationRemark', addresses.recommend);
+      getGeocoder({ latitude: this.location.lat1, longitude: this.location.lon1 })
+        .then((res) => {
+          if (res.status == 0 && res.result) {
+            let result = res.result;
+            this.fromData.cityNameOld = result.ad_info.city;
+            this.fromData.districtNameOld = result.ad_info.district;
+            let addresses = result.formatted_addresses; // 描述性地址
+            if (addresses) {
+              this.fromData.addressLine = addresses.recommend;
+              localStorage.setItem('locationRemark', addresses.recommend);
+            }
+            //   this.beforeAddFn();
+          } else {
+            this.toastLoading().clear();
           }
-          //   this.beforeAddFn();
-        }
-      });
+        })
+        .catch(() => {
+          this.toastLoading().clear();
+        });
     },
     moreTypeShowfn() {
       this.chainsData = [];