dcc
2024-06-07 d5381ec06ab5f549fade867c3a874de613bdd5d4
src/App.vue
@@ -1,6 +1,5 @@
<template>
  <div id="app">
    <!-- <div id="status-bar" style="position: relative;"></div> -->
    <div class="w-full h-full">
      <keep-alive>
        <router-view
@@ -15,12 +14,10 @@
      <Footer v-if="$route.meta.footer"></Footer>
    </div>
  </div>
  <!-- <loading v-else /> -->
</template>
<script>
import { mapState } from "vuex";
// import Loading from '@/components/loading'
import Footer from "@/components/footer";
import { mapActions, mapMutations, mapGetters } from "vuex";
import { SET_CURRENCY, SET_KEFU, SET_CONFIG } from "@/store/const.store";
@@ -30,13 +27,11 @@
  getStorage,
  setSessionStorage,
  getSessionStorage,
  fetchData,
} from "@/utils/utis";
import { encryptDes, decryptDes } from "@/utils/des";
import axios from "axios";
import { BASE_URL } from "@/config";
import { signatureGenerate } from "@/utils/signatureUtil";
import store from "./store";
export default {
  name: "App",
  data() {
@@ -53,7 +48,6 @@
        }
      });
      var lastTouchEnd = 0;
      document.addEventListener(
        "touchend",
        function (event) {
@@ -77,57 +71,20 @@
    await this.init();
    //document.addEventListener('touchmove', function (e) { e.cancelable && e.preventDefault(); }, false);
  },
  async mounted() {
    const res = await fetchData();
    let arr = [];
    res.url.map(async (item, index) => {
      const data = (await this.pingServer(item)) || 0;
      const url = new URL(item);
      const domain = url.hostname;
      arr.push({
        title: "线路",
        type: domain,
        value: data,
        id: index,
      });
      if (res.url.length === arr.length) {
        this.setBaic(arr);
      }
    });
    // window.localStorage.setItem("phones", userInfo.adminPhone);
  mounted() {
    window.document.documentElement.setAttribute("data-theme", this.theme);
    changeTheme(this.theme);
    this.GET_UERS_KYC();
  },
  components: {
    // loading: Loading,
    Footer,
  },
  methods: {
    ...mapActions("home", [SET_KEFU, "setBaic"]),
    ...mapActions("user", [SET_CONFIG]),
    ...mapActions("home", [SET_KEFU]),
    ...mapActions("user", [SET_CONFIG, "GET_UERS_KYC"]),
    ...mapMutations("language", ["setLanguage"]),
    ...mapMutations("home", [SET_CURRENCY]),
    async pingServer(url) {
      try {
        const startTime = performance.now();
        const response = await fetch(url, {
          method: "POST",
        });
        const endTime = performance.now();
        const latency = endTime - startTime;
        if (response.ok) {
          return latency;
        } else {
          console.log(`Server ${url} is unreachable.${latency}`);
        }
      } catch (error) {
        console.error("Error occurred:", error);
      }
    },
    async init() {
      await this.verifyLink();
      this.setLanguage(this.$i18n.locale);
@@ -310,7 +267,7 @@
// tab标签短横线颜色
.van-tabs__line {
  @include themify() {
    background: themed("active_line");
    background: transparent;
  }
}
@@ -420,15 +377,23 @@
.list-quatation {
  .van-cell {
    padding: 30px 32px !important;
    margin-bottom: 25px;
    padding: 10px 32px 10px 0px !important ;
    box-shadow: 0px 0px 10px 5px rgba(0, 0, 0, 0.05);
    line-height: 35px !important;
    .anniu {
      width: 10px;
      height: 50px;
      background-color: #2ebd85;
      margin-right: 60px;
    }
    @include themify() {
      background: themed("cont_round") !important;
    }
    &::after {
      @include themify() {
        border-bottom: 1px solid themed("line_color") !important;
        border-bottom: 0 !important;
      }
    }
  }
@@ -563,7 +528,7 @@
.van-popup {
  @include themify() {
    background: themed("main_background");
    // background: themed("main_background");
  }
}
@@ -649,4 +614,7 @@
    color: themed("text_color");
  }
}
.box-show {
  box-shadow: 0px 0px 10px 5px rgba(0, 0, 0, 0.05);
}
</style>