Browse Source

Merge branch 'feature_20240911_客户信息编辑页面定位问题' into uat

zhujindu 1 year ago
parent
commit
8e4c8cccda
1 changed files with 18 additions and 13 deletions
  1. 18 13
      src/views/storeManagement/storeEdit.vue

+ 18 - 13
src/views/storeManagement/storeEdit.vue

@@ -657,8 +657,8 @@ export default {
       },
       img: "https://svs-test.oss-cn-shanghai.aliyuncs.com/1647398239620微信截图_20220315112921.png",
       location: {
-        lat: "34.616712",
-        lon: "112.440816",
+        lat: "",
+        lon: "",
       },
       checkboxGroup: [],
       radio: "",
@@ -709,7 +709,7 @@ export default {
       pLot: "",
     };
   },
-  created() {
+  activated() {
     this.getTCFXList();
     this.getSJSList();
     this.getQGJZist();
@@ -726,7 +726,8 @@ export default {
   watch: {
     $route(to, from) {
       if (to.path == "/storeEdit" && from.path == "/storeDetail") {
-        this.getDetail();
+        console.log("storeEditstoreEditstoreEdit");
+        // this.getDetail();
         this.showmap = false;
       }
     },
@@ -1426,7 +1427,6 @@ export default {
               this.cont--;
               if (this.cont == "0") {
                 if (flat) {
-                  loading1.clear();
                   clearInterval(times);
                   that.$dialog
                     .alert({
@@ -1454,6 +1454,7 @@ export default {
               that.wx.getLocation({
                 type: "gcj02",
                 success: function (res) {
+                  console.log("定位成功");
                   flat = false;
                   var location = that.CJ02BD(res.latitude, res.longitude);
                   that.location = location;
@@ -1461,27 +1462,27 @@ export default {
                   that.fromValue.lon = that.location.lon;
                 },
                 fail: function () {
+                  flat = false;
                   that.$dialog
                     .confirm({
-                      confirmButtonText: "取消",
-                      cancelButtonText: "重新定位",
+                      confirmButtonText: "重新定位",
+                      showCancelButton: false,
+                      // cancelButtonText: "重新定位",
                       title: "系统提示",
                       message: "GPS未开启",
                     })
                     .then(() => {
-                      console.log("取消");
-                    })
-                    .catch(() => {
+                      console.log("重新定位");
                       that.getLocation();
                     });
                 },
               });
             });
             that.wx.error(function (res) {
-              this.$toast.fail("定位失败");
+              that.$toast.fail("定位失败");
             });
           } else {
-            this.$toast.fail("接口异常");
+            that.$toast.fail("接口异常");
           }
         });
     },
@@ -1839,7 +1840,11 @@ export default {
       });
     },
     onClickLeft() {
-      this.$router.go(-1);
+      this.$router.replace({
+        path: "/storeDetail",
+        query: { id: this.$route.query.id },
+      });
+      // this.$router.go(-1);
     },
     phoneCheck() {
       if (this.fromValue.ifJzStoreType != 1) {