소스 검색

优化店铺详情页和店铺编辑也定位功能和图片批量上传

zhujindu 1 년 전
부모
커밋
befb57d84f
3개의 변경된 파일410개의 추가작업 그리고 290개의 파일을 삭제
  1. 129 82
      src/components/uploadImgVStore.vue
  2. 6 2
      src/views/storeManagement/storeDetail.vue
  3. 275 206
      src/views/storeManagement/storeEdit.vue

+ 129 - 82
src/components/uploadImgVStore.vue

@@ -2,145 +2,192 @@
   <div>
     <div class="cameraDiv1">
       <div class="imgPre">
-        <van-icon class="photobrowsing" name="expand-o" size="22px" color="#969696" v-if="imgArr!=''" @click="deleteImgs(imgArr)"/>
-        <img :src="imgArr" alt="" v-if="imgArr!=''">
+        <van-icon
+          class="photobrowsing"
+          name="expand-o"
+          size="22px"
+          color="#969696"
+          v-if="imgArr != ''"
+          @click="deleteImgs(imgArr)" />
+        <img :src="imgArr" alt="" v-if="imgArr != ''" />
       </div>
       <p class="coverImg" @click="uploadImg">
-        <van-icon class="photo ico" name="photograph" size="16px" color="#969696">{{ imgText }}</van-icon>
+        <van-icon class="photo ico" name="photograph" size="16px" color="#969696">{{
+          imgText
+        }}</van-icon>
       </p>
     </div>
-    <p style="text-align: center;">{{ imgText }}</p>
+    <p style="text-align: center">{{ imgText }}</p>
   </div>
 </template>
 
 <script>
-import {ImagePreview} from "vant";
+import { ImagePreview } from 'vant';
 import axios from 'axios';
-import {uploadImagev} from "@/api/index";
+import { uploadImagev } from '@/api/index';
+import { getPosition } from '@/utils/TXApiFun';
 
 export default {
   name: 'uploadImg',
   props: {
     uploadid: {
       type: String,
-      default: ''
+      default: '',
     },
     imgText: {
       type: String,
-      default: ''
+      default: '',
     },
     visitsId: {
       type: String,
-      default: ''
+      default: '',
     },
     taskId: {
       type: String,
-      default: ''
+      default: '',
     },
     collectionId: {
       type: String,
-      default: ''
+      default: '',
     },
     type: {
       type: Number,
-      default: 1
+      default: 1,
     },
     imgArr: {
       type: String,
-      default: ''
+      default: '',
+    },
+    count: {
+      type: Number,
+      default: 1,
     },
   },
   data() {
     return {
       shows: false,
-      url: ""
-    }
+      url: '',
+    };
   },
   methods: {
     deleteImgs(val) {
       ImagePreview([val]);
     },
-    uploadImg(){
+    uploadImg() {
       if (localStorage.getItem('chainName') == null) {
-        this.$toast("请输入名称!")
-        return
+        this.$toast('请输入名称!');
+        return;
       }
-      let url = window.location.href;
-      let that = this;
-      let wx = this.wx
-      let qiyeData
-      const instance = axios.create();
-      instance.defaults.headers.common['userId'] = localStorage.getItem("loginName");
-      instance.get(process.env.VUE_APP_BASE_API + 'mobile/wx/ticket',
-          {
-            params: {
-              url: url
-            }
-          }).then(response => {
-        if (response.status == 200) {
-          qiyeData = response.data.data;
-          wx.config({
-            beta: true, // 必须这么写,否则wx.invoke调用形式的jsapi会有问题
-            debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
-            appId: qiyeData.appId, // 必填,企业微信的corpID
-            timestamp: qiyeData.timestamp, // 必填,生成签名的时间戳
-            nonceStr: qiyeData.nonceStr, // 必填,生成签名的随机串
-            signature: qiyeData.signature, // 必填,签名,见 附录-JS-SDK使用权限签名算法
-            jsApiList: ["ready", "chooseImage","uploadImage"] // 必填,需要使用的JS接口列表,凡是要调用的接口都需要传进来
+      getPosition()
+        .then((res) => {
+          // let { TXisBD, resData } = res;
+          this.wx.chooseImage({
+            count: this.count,
+            sizeType: ['compressed'], // 可以指定是原图还是压缩图,默认二者都有
+            sourceType: ['camera'], // 可以指定来源是相册还是相机,默认二者都有
+            defaultCameraMode: 'normal', //表示进入拍照界面的默认模式,目前有normal与batch两种选择,normal表示普通单拍模式,batch表示连拍模式,不传该参数则为normal模式。从3.0.26版本开始支持front和batch_front两种值,其中front表示默认为前置摄像头单拍模式,batch_front表示默认为前置摄像头连拍模式。(注:用户进入拍照界面仍然可自由切换两种模式)
+            isSaveToAlbum: 0,
+            success: (chooseRes) => {
+              let localIds = this.count == 1 ? chooseRes.localIds[0] : chooseRes.localIds;
+              console.log('localIds=' + localIds);
+              // if (chooseRes.localIds != undefined) {
+              //   localIds = chooseRes.localIds[0];
+              // } else {
+              //   localIds = chooseRes.localId;
+              // }
+              this.wx.uploadImage({
+                localId: localIds,
+                isShowProgressTips: 1,
+                success: (uploadRes) => {
+                  console.log('serverId=' + uploadRes.serverId);
+                  this.uploadImagev(uploadRes.serverId);
+                },
+              });
+            },
           });
-          wx.ready(function () {
-            wx.chooseImage({
-              count: 1,
-              sizeType: ['compressed'], // 可以指定是原图还是压缩图,默认二者都有
-              sourceType: ['camera'], // 可以指定来源是相册还是相机,默认二者都有
-              defaultCameraMode: "normal", //表示进入拍照界面的默认模式,目前有normal与batch两种选择,normal表示普通单拍模式,batch表示连拍模式,不传该参数则为normal模式。从3.0.26版本开始支持front和batch_front两种值,其中front表示默认为前置摄像头单拍模式,batch_front表示默认为前置摄像头连拍模式。(注:用户进入拍照界面仍然可自由切换两种模式)
-              isSaveToAlbum:0,
-              success: function (res) {
-                var localIds=""
-                if(res.localIds!=undefined){
-                  localIds= res.localIds[0]
-                }else{
-                  localIds=res.localId
-                }
-                wx.uploadImage({
-                  localId: localIds,
-                  isShowProgressTips: 1,
-                  success: function (res) {
-                    that.uploadImagev(res.serverId)
-                  }
-                });
-              }
-            });
-          })
-        }
-      });
+        })
+        .catch((error) => {
+          this.$dialog.alert({
+            message: error,
+          });
+        });
+      // let url = window.location.href;
+      // let that = this;
+      // let wx = this.wx;
+      // let qiyeData;
+      // const instance = axios.create();
+      // instance.defaults.headers.common['userId'] = localStorage.getItem('loginName');
+      // instance
+      //   .get(process.env.VUE_APP_BASE_API + 'mobile/wx/ticket', {
+      //     params: {
+      //       url: url,
+      //     },
+      //   })
+      //   .then((response) => {
+      //     if (response.status == 200) {
+      //       qiyeData = response.data.data;
+      //       wx.config({
+      //         beta: true, // 必须这么写,否则wx.invoke调用形式的jsapi会有问题
+      //         debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
+      //         appId: qiyeData.appId, // 必填,企业微信的corpID
+      //         timestamp: qiyeData.timestamp, // 必填,生成签名的时间戳
+      //         nonceStr: qiyeData.nonceStr, // 必填,生成签名的随机串
+      //         signature: qiyeData.signature, // 必填,签名,见 附录-JS-SDK使用权限签名算法
+      //         jsApiList: ['ready', 'chooseImage', 'uploadImage'], // 必填,需要使用的JS接口列表,凡是要调用的接口都需要传进来
+      //       });
+      //       wx.ready(function () {
+      //         wx.chooseImage({
+      //           count: this.count,
+      //           sizeType: ['compressed'], // 可以指定是原图还是压缩图,默认二者都有
+      //           sourceType: ['camera'], // 可以指定来源是相册还是相机,默认二者都有
+      //           defaultCameraMode: 'normal', //表示进入拍照界面的默认模式,目前有normal与batch两种选择,normal表示普通单拍模式,batch表示连拍模式,不传该参数则为normal模式。从3.0.26版本开始支持front和batch_front两种值,其中front表示默认为前置摄像头单拍模式,batch_front表示默认为前置摄像头连拍模式。(注:用户进入拍照界面仍然可自由切换两种模式)
+      //           isSaveToAlbum: 0,
+      //           success: function (res) {
+      //             var localIds = '';
+      //             if (res.localIds != undefined) {
+      //               localIds = res.localIds[0];
+      //             } else {
+      //               localIds = res.localId;
+      //             }
+      //             wx.uploadImage({
+      //               localId: localIds,
+      //               isShowProgressTips: 1,
+      //               success: function (res) {
+      //                 that.uploadImagev(res.serverId);
+      //               },
+      //             });
+      //           },
+      //         });
+      //       });
+      //     }
+      //   });
     },
-    uploadImagev(meidaId){
+    uploadImagev(meidaId) {
       var that = this;
-      var form={
-        mediaId:meidaId,
-        storeName:localStorage.getItem('chainName'),
-        locationRemark:localStorage.getItem('locationRemark'),
-        deptName:localStorage.getItem('deptName'),
-      }
+      var form = {
+        mediaId: meidaId,
+        storeName: localStorage.getItem('chainName'),
+        locationRemark: localStorage.getItem('locationRemark'),
+        deptName: localStorage.getItem('deptName'),
+      };
       var loind1 = that.$toast.loading({
         duration: 0,
         message: '上传中...',
         forbidClick: true,
       });
-      uploadImagev(form).then(res=>{
+      uploadImagev(form).then((res) => {
         if (res.code == 200) {
-          that.imgArr = res.data.url
+          that.imgArr = res.data.url;
           loind1.clear();
-          that.$toast("上传成功!")
-          that.$emit('newimgarr', {fileUrl: res.data.url, type: that.type});
+          that.$toast('上传成功!');
+          that.$emit('newimgarr', { fileUrl: res.data.url, type: that.type });
         } else {
-          that.$toast("上传失败!")
+          that.$toast('上传失败!');
         }
-      })
-    }
+      });
+    },
   },
-}
+};
 </script>
 
 <style scoped>
@@ -180,7 +227,7 @@ export default {
   z-index: 99;
   background-color: rgba(255, 255, 255, 0.8);
   border-bottom-left-radius: 3px;
-  border-top-left-radius: 3px
+  border-top-left-radius: 3px;
 }
 
 .coverImg {

+ 6 - 2
src/views/storeManagement/storeDetail.vue

@@ -420,8 +420,8 @@
     <div class="helpPageMask" v-if="helpPageFlag">
       <helpPage @btnClick="btnClick"></helpPage>
     </div>
-    <!-- 提交审核 退回原因 -->
-    <van-popup v-model="rejectMsgShow" class="rejectMsgBox" round position="bottom">
+    <!-- 提交审核 退回原因 只有同城分销店显示 -->
+    <van-popup v-model="rejectMsgShow" class="rejectMsgBox" closeable round position="bottom">
       <!-- <div class="rejectMsgBox"> -->
       <div class="title">退回详情</div>
       <div class="content">
@@ -1789,12 +1789,16 @@ export default {
       font-size: 16px;
       font-weight: 600;
       color: #000;
+      display: flex;
+      align-items: center;
       &::before {
         content: '';
         width: 8px;
         height: 8px;
         background: red;
         border-radius: 50%;
+        display: inline-block;
+        margin-right: 5px;
       }
     }
   }

+ 275 - 206
src/views/storeManagement/storeEdit.vue

@@ -317,7 +317,8 @@
                         :imgArr="fromValue.imgSed"
                         @newimgarr="newimgarr1"
                         :imgText="fromValue.ifJzStoreType != 1 ? '陈列照' : '立邦展厅照片'"
-                        :type="2"></upload-img>
+                        :type="2"
+                        :count="fromValue.ifJzStoreType != 1 ? 9 : 1"></upload-img>
                     </div>
                   </van-col>
                 </van-row>
@@ -581,6 +582,7 @@ import txmapimg1 from '@/assets/txmap1.svg';
 import txmapimg2 from '@/assets/txmap2.svg';
 import txmapimg3 from '@/assets/marker_blue.png';
 import { valid } from '@/api/visitstore';
+import { getPosition, getTicketFun, getMapPoi, getkeywordPoi } from '@/utils/TXApiFun';
 
 export default {
   name: 'storeAdd',
@@ -709,28 +711,34 @@ export default {
       pLot: '',
     };
   },
-  created() {
-    this.getTCFXList();
-    this.getSJSList();
-    this.getQGJZist();
-    this.getDetail();
-    this.getbrands();
-    this.getStreetQuery();
-    this.getCustomerInfoList();
-    this.getManagementModelList();
-    this.getMainRelationList();
-    this.getMainProjectList();
-    this.getCustomerNatureList();
-    this.getpotentialCustomerTypeList();
-  },
-  watch: {
-    $route(to, from) {
-      if (to.path == '/storeEdit' && from.path == '/storeDetail') {
-        this.getDetail();
-        this.showmap = false;
-      }
-    },
+  activated() {
+    // 授权
+    getTicketFun(['getLocation', 'chooseImage', 'uploadImage']).then(() => {
+      this.getTCFXList();
+      this.getSJSList();
+      this.getQGJZist();
+      this.getDetail();
+      this.getbrands();
+      this.getStreetQuery();
+      this.getCustomerInfoList();
+      this.getManagementModelList();
+      this.getMainRelationList();
+      this.getMainProjectList();
+      this.getCustomerNatureList();
+      this.getpotentialCustomerTypeList();
+      this.showmap = false;
+    });
   },
+  // created() {
+  // },
+  // watch: {
+  //   $route(to, from) {
+  //     if (to.path == '/storeEdit' && from.path == '/storeDetail') {
+  //       this.getDetail();
+  //       this.showmap = false;
+  //     }
+  //   },
+  // },
   methods: {
     addressFns(val) {
       var that = this;
@@ -745,13 +753,9 @@ export default {
           },
         ]);
         that.maplist = [];
-        jsonp(
-          'https://apis.map.qq.com/ws/place/v1/search?boundary=nearby(' +
-            val.location.lat +
-            ',' +
-            val.location.lng +
-            ',1000,0)&page_size=20&page_index=1&orderby=_distance&output=jsonp&key=WLCBZ-HRM6L-YOMPV-ME62B-AQOG6-JUBW6'
-        ).then((res) => {
+        // 地点搜索 获取500米范围poi点
+        getMapPoi({ latitude: val.location.lat, longitude: val.location.lng }).then((res) => {
+          console.log(res);
           that.maplist = res.data;
           that.marker.setGeometries([]);
           setTimeout(() => {
@@ -765,24 +769,53 @@ export default {
             }
           });
         });
+        // jsonp(
+        //   'https://apis.map.qq.com/ws/place/v1/search?boundary=nearby(' +
+        //     val.location.lat +
+        //     ',' +
+        //     val.location.lng +
+        //     ',1000,0)&page_size=20&page_index=1&orderby=_distance&output=jsonp&key=WLCBZ-HRM6L-YOMPV-ME62B-AQOG6-JUBW6'
+        // ).then((res) => {
+        //   that.maplist = res.data;
+        //   that.marker.setGeometries([]);
+        //   setTimeout(() => {
+        //     for (let p = 0; p < res.data.length; p++) {
+        //       that.marker.updateGeometries([
+        //         {
+        //           id: res.data[p].id,
+        //           position: new TMap.LatLng(res.data[p].location.lat, res.data[p].location.lng),
+        //         },
+        //       ]);
+        //     }
+        //   });
+        // });
         that.addresssb = -1;
       });
     },
     searchFn(val) {
       this.searchSHow = false;
-      var that = this;
-      jsonp(
-        'https://apis.map.qq.com/ws/place/v1/suggestion?keyword=' +
-          val +
-          '&location=' +
-          this.pLat +
-          ',' +
-          this.pLot +
-          '&output=jsonp&key=WLCBZ-HRM6L-YOMPV-ME62B-AQOG6-JUBW6&page_size=20&region_fix=1'
-      ).then((res) => {
-        this.searchSHow = true;
-        that.mapsearchlist = res.data;
+      getkeywordPoi({ latitude: this.pLat, longitude: this.pLot }, val).then((res) => {
+        // 不显示下拉选择
+        if (!res.data.length && !val) {
+          this.searchSHow = false;
+        } else {
+          this.searchSHow = true;
+        }
+        // 联想下拉选
+        this.mapsearchlist = res.data;
       });
+      // jsonp(
+      //   'https://apis.map.qq.com/ws/place/v1/suggestion?keyword=' +
+      //     val +
+      //     '&location=' +
+      //     this.pLat +
+      //     ',' +
+      //     this.pLot +
+      //     '&output=jsonp&key=WLCBZ-HRM6L-YOMPV-ME62B-AQOG6-JUBW6&page_size=20&region_fix=1'
+      // ).then((res) => {
+      //   this.searchSHow = true;
+      //   that.mapsearchlist = res.data;
+      // });
     },
     mapselect(val) {
       this.searchSHow = false;
@@ -818,97 +851,121 @@ export default {
     },
     fns() {
       this.search = '';
-      let loading1 = this.$toast.loading({
-        duration: 0,
-        message: '定位中...',
-        forbidClick: true,
-      });
-      let url = window.location.href;
-      let that = this;
-      let qiyeData;
-      const instance = axios.create();
-      instance.defaults.headers.common['userId'] = localStorage.getItem('loginName');
-      instance
-        .get(process.env.VUE_APP_BASE_API + 'mobile/wx/ticket', {
-          params: {
-            url: url,
-          },
-        })
-        .then((response) => {
-          if (response.status == 200) {
-            this.cont = 6;
-            var flat = true;
-            var times = setInterval(() => {
-              this.cont--;
-              if (this.cont == '0') {
-                if (flat) {
-                  loading1.clear();
-                  clearInterval(times);
-                  that.$dialog
-                    .alert({
-                      message: '定位失败,请开启企微定位权限',
-                    })
-                    .then(() => {
-                      this.$router.go(-1);
-                    });
-                } else {
-                  clearInterval(times);
-                }
-              }
-            }, 1000);
-            qiyeData = response.data.data;
-            that.wx.config({
-              beta: true,
-              debug: false,
-              appId: qiyeData.appId,
-              timestamp: qiyeData.timestamp,
-              nonceStr: qiyeData.nonceStr,
-              signature: qiyeData.signature,
-              jsApiList: ['ready', 'getLocation'],
-            });
-            that.wx.ready(function () {
-              that.wx.getLocation({
-                type: 'gcj02',
-                success: function (res) {
-                  flat = false;
-                  loading1.clear();
-                  that.pLat = res.latitude;
-                  that.pLot = res.longitude;
-                  var location = that.CJ02BD(res.latitude, res.longitude);
-                  if (that.fromValue.lon == '') {
-                    that.fromValue.lon = location.lon;
-                    that.fromValue.lat = location.lat;
-                  }
-                  that.showmap = true;
-                  jsonp(
-                    'https://apis.map.qq.com/ws/place/v1/search?boundary=nearby(' +
-                      res.latitude +
-                      ',' +
-                      res.longitude +
-                      ',1000,0)&page_size=10&page_index=1&orderby=_distance&output=jsonp&key=WLCBZ-HRM6L-YOMPV-ME62B-AQOG6-JUBW6'
-                  ).then((res) => {
-                    that.maplist = res.data;
-                    setTimeout(() => {
-                      that.addVisits1('1');
-                    });
-                  });
-                },
-                fail: function () {
-                  loading1.clear();
-                  that.$dialog.alert({
-                    title: '系统提示',
-                    message: 'GPS未开启',
-                  });
-                },
-              });
-            });
-            that.wx.error(function (res) {
-              this.$toast.fail('定位失败');
-            });
-          } else {
-            this.$toast.fail('接口异常');
+      getPosition()
+        .then((res) => {
+          let { TXisBD, resData } = res;
+          this.pLat = resData.latitude;
+          this.pLot = resData.longitude;
+          if (this.fromValue.lon == '') {
+            this.fromValue.lon = TXisBD.lon;
+            this.fromValue.lat = TXisBD.lat;
           }
+          this.showmap = true;
+          // 地点搜索 获取500米范围poi点
+          getMapPoi({ latitude: this.pLat, longitude: this.pLot }).then((res) => {
+            console.log(res);
+            this.maplist = res.data;
+            setTimeout(() => {
+              this.addVisits1('1');
+            });
+          });
+        })
+        .catch((error) => {
+          this.$dialog.alert({
+            message: error,
+          });
         });
+      // let loading1 = this.$toast.loading({
+      //   duration: 0,
+      //   message: '定位中...',
+      //   forbidClick: true,
+      // });
+      // let url = window.location.href;
+      // let that = this;
+      // let qiyeData;
+      // const instance = axios.create();
+      // instance.defaults.headers.common['userId'] = localStorage.getItem('loginName');
+      // instance
+      //   .get(process.env.VUE_APP_BASE_API + 'mobile/wx/ticket', {
+      //     params: {
+      //       url: url,
+      //     },
+      //   })
+      //   .then((response) => {
+      //     if (response.status == 200) {
+      //       this.cont = 6;
+      //       var flat = true;
+      //       var times = setInterval(() => {
+      //         this.cont--;
+      //         if (this.cont == '0') {
+      //           if (flat) {
+      //             loading1.clear();
+      //             clearInterval(times);
+      //             that.$dialog
+      //               .alert({
+      //                 message: '定位失败,请开启企微定位权限',
+      //               })
+      //               .then(() => {
+      //                 this.$router.go(-1);
+      //               });
+      //           } else {
+      //             clearInterval(times);
+      //           }
+      //         }
+      //       }, 1000);
+      //       qiyeData = response.data.data;
+      //       that.wx.config({
+      //         beta: true,
+      //         debug: false,
+      //         appId: qiyeData.appId,
+      //         timestamp: qiyeData.timestamp,
+      //         nonceStr: qiyeData.nonceStr,
+      //         signature: qiyeData.signature,
+      //         jsApiList: ['ready', 'getLocation'],
+      //       });
+      //       that.wx.ready(function () {
+      //         that.wx.getLocation({
+      //           type: 'gcj02',
+      //           success: function (res) {
+      //             flat = false;
+      //             loading1.clear();
+      //             that.pLat = res.latitude;
+      //             that.pLot = res.longitude;
+      //             var location = that.CJ02BD(res.latitude, res.longitude);
+      //             if (that.fromValue.lon == '') {
+      //               that.fromValue.lon = location.lon;
+      //               that.fromValue.lat = location.lat;
+      //             }
+      //             that.showmap = true;
+      //             jsonp(
+      //               'https://apis.map.qq.com/ws/place/v1/search?boundary=nearby(' +
+      //                 res.latitude +
+      //                 ',' +
+      //                 res.longitude +
+      //                 ',1000,0)&page_size=10&page_index=1&orderby=_distance&output=jsonp&key=WLCBZ-HRM6L-YOMPV-ME62B-AQOG6-JUBW6'
+      //             ).then((res) => {
+      //               that.maplist = res.data;
+      //               setTimeout(() => {
+      //                 that.addVisits1('1');
+      //               });
+      //             });
+      //           },
+      //           fail: function () {
+      //             loading1.clear();
+      //             that.$dialog.alert({
+      //               title: '系统提示',
+      //               message: 'GPS未开启',
+      //             });
+      //           },
+      //         });
+      //       });
+      //       that.wx.error(function (res) {
+      //         this.$toast.fail('定位失败');
+      //       });
+      //     } else {
+      //       this.$toast.fail('接口异常');
+      //     }
+      //   });
       this.addresssb = -1;
     },
     addVisits1(val) {
@@ -1406,84 +1463,96 @@ export default {
       });
     },
     getLocation() {
-      let url = window.location.href;
-      this.list = [];
-      let that = this;
-      let qiyeData;
-      const instance = axios.create();
-      instance.defaults.headers.common['userId'] = localStorage.getItem('loginName');
-      instance
-        .get(process.env.VUE_APP_BASE_API + 'mobile/wx/ticket', {
-          params: {
-            url: url,
-          },
+      getPosition()
+        .then((res) => {
+          let { TXisBD } = res;
+          this.location = TXisBD;
+          this.fromValue.lat = TXisBD.lat;
+          this.fromValue.lon = TXisBD.lon;
         })
-        .then((response) => {
-          if (response.status == 200) {
-            this.cont = 3;
-            var flat = true;
-            var times = setInterval(() => {
-              this.cont--;
-              if (this.cont == '0') {
-                if (flat) {
-                  loading1.clear();
-                  clearInterval(times);
-                  that.$dialog
-                    .alert({
-                      message: '定位失败,请开启企微定位权限',
-                    })
-                    .then(() => {
-                      this.$router.go(-1);
-                    });
-                } else {
-                  clearInterval(times);
-                }
-              }
-            }, 1000);
-            qiyeData = response.data.data;
-            that.wx.config({
-              beta: true,
-              debug: false,
-              appId: qiyeData.appId,
-              timestamp: qiyeData.timestamp,
-              nonceStr: qiyeData.nonceStr,
-              signature: qiyeData.signature,
-              jsApiList: ['ready', 'getLocation'],
-            });
-            that.wx.ready(function () {
-              that.wx.getLocation({
-                type: 'gcj02',
-                success: function (res) {
-                  flat = false;
-                  var location = that.CJ02BD(res.latitude, res.longitude);
-                  that.location = location;
-                  that.fromValue.lat = that.location.lat;
-                  that.fromValue.lon = that.location.lon;
-                },
-                fail: function () {
-                  that.$dialog
-                    .confirm({
-                      confirmButtonText: '取消',
-                      cancelButtonText: '重新定位',
-                      title: '系统提示',
-                      message: 'GPS未开启',
-                    })
-                    .then(() => {
-                      console.log('取消');
-                    })
-                    .catch(() => {
-                      that.getLocation();
-                    });
-                },
-              });
-            });
-            that.wx.error(function (res) {
-              this.$toast.fail('定位失败');
-            });
-          } else {
-            this.$toast.fail('接口异常');
-          }
+        .catch((error) => {
+          this.$dialog.alert({
+            message: error,
+          });
         });
+      // let url = window.location.href;
+      // this.list = [];
+      // let that = this;
+      // let qiyeData;
+      // const instance = axios.create();
+      // instance.defaults.headers.common['userId'] = localStorage.getItem('loginName');
+      // instance
+      //   .get(process.env.VUE_APP_BASE_API + 'mobile/wx/ticket', {
+      //     params: {
+      //       url: url,
+      //     },
+      //   })
+      //   .then((response) => {
+      //     if (response.status == 200) {
+      //       this.cont = 3;
+      //       var flat = true;
+      //       var times = setInterval(() => {
+      //         this.cont--;
+      //         if (this.cont == '0') {
+      //           if (flat) {
+      //             loading1.clear();
+      //             clearInterval(times);
+      //             that.$dialog
+      //               .alert({
+      //                 message: '定位失败,请开启企微定位权限',
+      //               })
+      //               .then(() => {
+      //                 this.$router.go(-1);
+      //               });
+      //           } else {
+      //             clearInterval(times);
+      //           }
+      //         }
+      //       }, 1000);
+      //       qiyeData = response.data.data;
+      //       that.wx.config({
+      //         beta: true,
+      //         debug: false,
+      //         appId: qiyeData.appId,
+      //         timestamp: qiyeData.timestamp,
+      //         nonceStr: qiyeData.nonceStr,
+      //         signature: qiyeData.signature,
+      //         jsApiList: ['ready', 'getLocation'],
+      //       });
+      //       that.wx.ready(function () {
+      //         that.wx.getLocation({
+      //           type: 'gcj02',
+      //           success: function (res) {
+      //             flat = false;
+      //             var location = that.CJ02BD(res.latitude, res.longitude);
+      //             that.location = location;
+      //             that.fromValue.lat = that.location.lat;
+      //             that.fromValue.lon = that.location.lon;
+      //           },
+      //           fail: function () {
+      //             that.$dialog
+      //               .confirm({
+      //                 confirmButtonText: '取消',
+      //                 cancelButtonText: '重新定位',
+      //                 title: '系统提示',
+      //                 message: 'GPS未开启',
+      //               })
+      //               .then(() => {
+      //                 console.log('取消');
+      //               })
+      //               .catch(() => {
+      //                 that.getLocation();
+      //               });
+      //           },
+      //         });
+      //       });
+      //       that.wx.error(function (res) {
+      //         this.$toast.fail('定位失败');
+      //       });
+      //     } else {
+      //       this.$toast.fail('接口异常');
+      //     }
+      //   });
     },
     showPickerChainsListFn() {
       if (this.fromValue.storeCategoryName == '') {