shaogen1995 1 年之前
父節點
當前提交
8342b8b897
共有 1 個文件被更改,包括 9 次插入19 次删除
  1. 9 19
      hot_online1/src/views/Home.vue

+ 9 - 19
hot_online1/src/views/Home.vue

@@ -1,7 +1,7 @@
 <template>
   <!-- @click="autoplay" @touchstart="autoplay" -->
   <div class="home">
-    <audio v-if="audio" class="audio" id="audio1" :src="audio" preload ref="musicBg" @ended="overAudio"></audio>
+    <audio v-if="audio" class="audio" id="audio1" :src="fixUrl(audio)" preload ref="musicBg" @ended="overAudio"></audio>
     <div class="content" v-if="(!audio && fixIcon.length > 0) || (audio && fixIcon.length > 1)"
       :class="{ isMobileCon: isMobile }">
       <div v-if="!isMobile && lengthShow" @click="slideto('slidePrev')" class="swiper-button-prev"></div>
@@ -220,7 +220,7 @@ export default {
       this.active = id;
     },
     async getData() {
-      let url = `data/${this.id
+      let url = `/data/${this.id
         }/hot/js/data.js?time=${Math.random()}`;
       let result = (await this.$http.get(url)).data;
       this.data = result[this.m];
@@ -251,23 +251,13 @@ export default {
         }
       }
     },
-    fixUrl(item) {
-      let condition =
-        item.indexOf("http://") > -1 || item.indexOf("https://") > -1;
-      if (this.isMobile) {
-        if (
-          item.indexOf("mp.weixin.qq.com/mp/") > -1 &&
-          this.active === "iframe"
-        ) {
-          return `https://www.4dmodel.com/SuperTwo/hot_online1/linktoWC.html?url=${encodeURIComponent(
-            item
-          )}`;
-        }
-      }
-      if (!condition) {
-        return "https://" + item;
-      }
-      return item;
+    fixUrl(url) {
+      const resUrl = url;
+      if (url.includes("https://super.4dage.com")) {
+        return url.replace("https://super.4dage.com", "");
+      } else if (url.includes("http://super.4dage.com")) {
+        return url.replace("http://super.4dage.com", "");
+      } else return resUrl;
     },
     slideto(action) {
       this.swiper[action]();