liuyg
2022-01-26 22b526a7ab81da32a97d866831b9177a42e34a90
+定位点击后显示等待图标,
4 files modified
44 ■■■■■ changed files
src/components/mobileWindow/index.vue 12 ●●●●● patch | view | raw | blame | history
src/router/axios.js 8 ●●●● patch | view | raw | blame | history
src/store/modules/mobile.js 1 ●●●● patch | view | raw | blame | history
src/store/modules/mobilePosition.js 23 ●●●●● patch | view | raw | blame | history
src/components/mobileWindow/index.vue
@@ -67,7 +67,9 @@
                : item.name == '图集'
                ? 'el-icon-data-board'
                : item.name == '去这'
                ? 'el-icon-finished'
                ? quzheD
                  ? 'el-icon-loading'
                  : 'el-icon-finished'
                : item.name == '视频' || item.name == '返回'
                ? 'el-icon-video-camera-solid'
                : ''
@@ -103,6 +105,7 @@
  watch: {
    MobileWindowChangeData() {
      this.$store.dispatch("MSET_GETAUDIOBEGIN", "notOpen");
      this.quzheD = false;
      //数据更改
      //   this.fullscreenLoading = true;
      if (!this.MobileWindowsHide) {
@@ -243,6 +246,7 @@
      seebut: [],
      center: [],
      panoramaurl: "",
      quzheD: false, //是否点击了去这,并不能再按,以及不应用路线导航
    };
  },
  methods: {
@@ -253,6 +257,11 @@
      let query = this.query.query;
      // console.log(query);
      if (val == "去这") {
        if (that.quzheD) {
          console.log("不可点击");
          return;
        }
        that.quzheD = true;
        // return;
        //定位
        // console.log(this.query.query);
@@ -267,6 +276,7 @@
            fn: function (datas) {
              //获取回调路径
              that.routerS.push(datas);
              that.quzheD = false;
              if (once) {
                once = false;
                //加载第一条线路
src/router/axios.js
@@ -8,10 +8,10 @@
import axios from "axios";
let httpName = window.location.protocol + "//" + window.location.hostname;
let url = httpName + "/apis";
setTimeout(() => {
  console.log(window.location);
  console.log(url);
}, 3000);
// setTimeout(() => {
//   console.log(window.location);
//   console.log(url);
// }, 3000);
const service = axios.create({
  //   baseURL: 'http://192.168.0.107:83',
  // baseURL: "http://192.168.0.107:80",
src/store/modules/mobile.js
@@ -468,6 +468,7 @@
      commit("MSET_POPUPDOM", popupsDom);
    },
    closeMobileWindowsDom({ state, commit, dispatch }) {
      commit("CLOSE_NOWPOSITION");//中断定位获取
      if (!state.MobileWindowsHide && state.popupsDom) {
        state.popupsDom.closeOur();
        commit("MSET_MOBILEWINDOWSHIDE", true);
src/store/modules/mobilePosition.js
@@ -1,5 +1,5 @@
const mobilePosition = {
  state: {},
  state: { getSPosition: null },
  mutations: {
    GET_NOWPOSITION(state, val) {
      let outData =
@@ -10,14 +10,16 @@
      if (navigator.geolocation) {
        console.log("支持navigator.geolocation-111111111111111");
        try {
          navigator.geolocation.getCurrentPosition(function (position) {
            console.log(position);
            var lat = position.coords.latitude;
            var lon = position.coords.longitude;
            console.log("成功返回经纬度信息");
            console.log(lon, lat);
            outData([lon, lat]);
          });
          state.getSPosition = navigator.geolocation.getCurrentPosition(
            function (position) {
              console.log(position);
              var lat = position.coords.latitude;
              var lon = position.coords.longitude;
              console.log("成功返回经纬度信息");
              console.log(lon, lat);
              outData([lon, lat]);
            }
          );
        } catch {
          console.log("支持navigator.geolocation-需要HTTPS");
        }
@@ -26,6 +28,9 @@
        return "不支持navigator.geolocation";
      }
    },
    CLOSE_NOWPOSITION(state) {
      state.getSPosition = null;
    },
  },
  actions: {},
};