This commit is contained in:
daihh
2022-10-25 19:37:41 +08:00
2 changed files with 12 additions and 4 deletions

View File

@@ -84,10 +84,10 @@
this.$emit('hideIndex',id) this.$emit('hideIndex',id)
}, },
jumpDetail(data) { jumpDetail(data) {
if(!data.id){ if(!data.courseId){
return; return;
} }
this.$router.push({ path: '/course/detail?id=', query: { id: data.id } }); this.$router.push({ path: '/course/detail?id=', query: { id: data.courseId } });
} }
} }
} }

View File

@@ -4,12 +4,12 @@
<portal-header current="index" textColor="#000000" style="z-index:999; position: relative;"></portal-header> <portal-header current="index" textColor="#000000" style="z-index:999; position: relative;"></portal-header>
<div id="container" style="z-index:99;"> <div id="container" style="z-index:99;">
<swiper :options="swiperOption" ref="mySwiper" v-if="resonimg.length"> <swiper :options="swiperOption" ref="mySwiper" v-if="resonimg.length">
<swiper-slide style="margin: 0 auto;" v-for="(item , idx ) in resonimg" :key="idx" class="swiper-slide games"> <swiper-slide style="margin: 0 auto;" v-for="(item , idx ) in resonimg" :key="idx" class="swiper-slide games" :class="{'swiper-no-swiping':resonimg.length < 1}">
<div class="bannbox" :style="{ 'background': `url(${fileBaseUrl + item.image}) no-repeat 100% / 100%`}"> <div class="bannbox" :style="{ 'background': `url(${fileBaseUrl + item.image}) no-repeat 100% / 100%`}">
</div> </div>
<img class="banner-img" style=" margin: 0 auto;" :src=" fileBaseUrl + item.image" alt=""> <img class="banner-img" style=" margin: 0 auto;" :src=" fileBaseUrl + item.image" alt="">
</swiper-slide> </swiper-slide>
<div class="swiper-pagination" slot="pagination"></div> <div class="swiper-pagination" v-if="resonimg.length > 1" slot="pagination"></div>
<!-- <div class="swiper-button-prev" slot="button-prev"></div> --> <!-- <div class="swiper-button-prev" slot="button-prev"></div> -->
</swiper> </swiper>
</div> </div>
@@ -478,6 +478,7 @@
disableOnInteraction: false, disableOnInteraction: false,
delay: 2000, delay: 2000,
}, },
noSwiping: true,
speed: 3000, //切换速度即slider自动滑动开始到结束的时间单位ms speed: 3000, //切换速度即slider自动滑动开始到结束的时间单位ms
loop: true, //循环切换 loop: true, //循环切换
peed: 300, //循环速度 peed: 300, //循环速度
@@ -679,6 +680,13 @@
let key = 'index'; let key = 'index';
apiPlace.detail(key).then(res => { apiPlace.detail(key).then(res => {
let lmj = JSON.parse(res.result.content) let lmj = JSON.parse(res.result.content)
if(this.resonimg.length < 1) {
this.swiperOption.autoplay = false;
this.swiperOption.loop = false;
this.swiperOption.speed = 0;
this.swiperOption.peed = 0;
this.swiperOption.freeMode = false;
}
this.resonimg = lmj this.resonimg = lmj
// console.log(this.resonimg) // console.log(this.resonimg)
}) })