|
@@ -29,14 +29,16 @@
|
|
|
@slideChange="handleChange"
|
|
|
>
|
|
|
<SwiperSlide v-for="(item, index) in curList" :key="item.url">
|
|
|
- <template v-if="myType === 'model'">
|
|
|
- <iframe v-if="index === myInd" :src="item" frameborder="0" />
|
|
|
- </template>
|
|
|
- <template v-else-if="myType === 'video'">
|
|
|
- <video ref="videos" controls :src="item.url" />
|
|
|
- </template>
|
|
|
- <template v-else-if="myType === 'img'">
|
|
|
- <el-image :src="item" fit="contain" @click="handlePreview(index)" />
|
|
|
+ <template v-if="swiperInited">
|
|
|
+ <template v-if="myType === 'model'">
|
|
|
+ <iframe v-if="index === myInd" :src="item" frameborder="0" />
|
|
|
+ </template>
|
|
|
+ <template v-else-if="myType === 'video'">
|
|
|
+ <video ref="videos" controls :src="item.url" />
|
|
|
+ </template>
|
|
|
+ <template v-else-if="myType === 'img'">
|
|
|
+ <el-image :src="item" fit="contain" @click="handlePreview(index)" />
|
|
|
+ </template>
|
|
|
</template>
|
|
|
</SwiperSlide>
|
|
|
</Swiper>
|
|
@@ -80,7 +82,7 @@
|
|
|
:class="{ isTop: !flooTab.length && !isMobile }"
|
|
|
>
|
|
|
<h3>{{ myTitle }}</h3>
|
|
|
- <p>{{ myTxt }}</p>
|
|
|
+ <div v-html="myTxt" />
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -121,6 +123,7 @@
|
|
|
isOneAduio: false,
|
|
|
// 音频状态
|
|
|
audioSta: false,
|
|
|
+ swiperInited: false,
|
|
|
|
|
|
data: {
|
|
|
// 模型数组
|
|
@@ -178,7 +181,9 @@
|
|
|
methods: {
|
|
|
async getData() {
|
|
|
// https://www.4dmodel.com/
|
|
|
- let url = `https://super.4dage.com/data/${this.id}/hot/js/data.js?time=${Math.random()}`;
|
|
|
+ let url = `${
|
|
|
+ Boolean(Number(import.meta.env.VITE_APP_OFFLINE)) ? '.' : 'https://super.4dage.com'
|
|
|
+ }/data/${this.id}/hot/js/data.js?time=${Math.random()}`;
|
|
|
let result = await fetch(url).then((response) => response.json());
|
|
|
const resData = result[this.m];
|
|
|
console.log('----', resData);
|
|
@@ -259,6 +264,7 @@
|
|
|
|
|
|
initSwiper(swiper) {
|
|
|
this.swiper = swiper;
|
|
|
+ this.swiperInited = true;
|
|
|
},
|
|
|
handleChange({ activeIndex }) {
|
|
|
this.myInd = activeIndex;
|