瀏覽代碼

计划内跳转高销额门店取消定位

zhujindu 1 年之前
父節點
當前提交
c53fd05661
共有 1 個文件被更改,包括 73 次插入70 次删除
  1. 73 70
      src/views/deviceWithin/index.vue

+ 73 - 70
src/views/deviceWithin/index.vue

@@ -1508,77 +1508,80 @@ export default {
       });
     },
     goFn() {
-      let loading1 = this.$toast.loading({
-        duration: 0,
-        message: '加载中...',
-        forbidClick: true,
+      this.$router.push({
+        path: '/topStore',
       });
-      let url = window.location.href;
-      let wx = this.wx;
-      var 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 = 5;
-            var flat = true;
-            var times = setInterval(() => {
-              this.cont--;
-              if (this.cont == '0') {
-                if (flat) {
-                  loading1.clear();
-                  clearInterval(times);
-                  that.$dialog.alert({
-                    message: '定位失败,请开启企微定位权限',
-                  });
-                } else {
-                  clearInterval(times);
-                }
-              }
-            }, 1000);
-            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', 'getLocation'], // 必填,需要使用的JS接口列表,凡是要调用的接口都需要传进来
-            });
-            wx.ready(function () {
-              wx.getLocation({
-                type: 'gcj02',
-                success: function (res) {
-                  flat = false;
-                  loading1.clear();
-                  that.$router.push({
-                    path: '/topStore',
-                  });
-                },
-                fail: function () {
-                  loading1.clear();
-                  that.$dialog.alert({
-                    message: 'GPS未开启',
-                  });
-                },
-              });
-            });
-            wx.error(function (res) {
-              loading1.clear();
-              that.$dialog.alert({
-                message: '定位失败,请开启企微定位权限',
-              });
-            });
-          }
-        });
+      // let loading1 = this.$toast.loading({
+      //   duration: 0,
+      //   message: '加载中...',
+      //   forbidClick: true,
+      // });
+      // let url = window.location.href;
+      // let wx = this.wx;
+      // var 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 = 5;
+      //       var flat = true;
+      //       var times = setInterval(() => {
+      //         this.cont--;
+      //         if (this.cont == '0') {
+      //           if (flat) {
+      //             loading1.clear();
+      //             clearInterval(times);
+      //             that.$dialog.alert({
+      //               message: '定位失败,请开启企微定位权限',
+      //             });
+      //           } else {
+      //             clearInterval(times);
+      //           }
+      //         }
+      //       }, 1000);
+      //       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', 'getLocation'], // 必填,需要使用的JS接口列表,凡是要调用的接口都需要传进来
+      //       });
+      //       wx.ready(function () {
+      //         wx.getLocation({
+      //           type: 'gcj02',
+      //           success: function (res) {
+      //             flat = false;
+      //             loading1.clear();
+      //             that.$router.push({
+      //               path: '/topStore',
+      //             });
+      //           },
+      //           fail: function () {
+      //             loading1.clear();
+      //             that.$dialog.alert({
+      //               message: 'GPS未开启',
+      //             });
+      //           },
+      //         });
+      //       });
+      //       wx.error(function (res) {
+      //         loading1.clear();
+      //         that.$dialog.alert({
+      //           message: '定位失败,请开启企微定位权限',
+      //         });
+      //       });
+      //     }
+      //   });
     },
     formLink() {
       this.$router.push('/storeVisit/questions');