重新修改首页banner一张不轮播

This commit is contained in:
lmj
2022-10-26 18:01:28 +08:00
parent 4ae06928f0
commit 1032af2ea5

View File

@@ -2,19 +2,17 @@
<div>
<div class="course-banner">
<portal-header current="index" textColor="#000000" style="z-index:999; position: relative;"></portal-header>
<div id="container" style="z-index:99;" v-if="resonimg.length == 0">
<!-- 当轮播图等于一张时 -->
<swiper :options="swiperOptiontwo" ref="mySwiper" >
<div id="container" style="z-index:99;" v-if="resonimg.length == 1">
当轮播图等于一张时
<swiper :options="swiperOptiontwo" >
<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>
<img class="banner-img" style=" margin: 0 auto;" :src=" fileBaseUrl + item.image" alt="">
</swiper-slide>
<!-- <div class="swiper-pagination" slot="pagination"></div> -->
<!-- <div class="swiper-button-prev" slot="button-prev"></div> -->
</swiper>
</div>
<div id="container" style="z-index:99;" v-if="resonimg.length > 0">
<div id="container" style="z-index:99;" v-else>
<swiper :options="swiperOption" ref="mySwiper" >
<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%`}">
@@ -24,8 +22,8 @@
<div class="swiper-pagination" slot="pagination"></div>
<!-- <div class="swiper-button-prev" slot="button-prev"></div> -->
</swiper>
</div>
<div class="personal-panel">
<div class="personal-img">
<author-img width="68px" height="68px" :avatar="userInfo.avatar" :aid="userInfo.aid" :noJump="false" :sex="userInfo.sex"></author-img>
@@ -491,31 +489,17 @@
swiperOptiontwo: {
autoplay: false,
noSwiping: true,
speed: 3000, //切换速度即slider自动滑动开始到结束的时间单位ms
peed: 300, //循环速度
scrollbar: '.swiper-scrollbar',
pagination: {
el: '.swiper-pagination',
// type : 'progressbar', //分页器形状
clickable: true, //点击分页器的指示点分页器会控制Swiper切换
},
navigation: {
nextEl: '.swiper-button-next',
prevEl: '.swiper-button-prev',
},
},
swiperOption: {
autoplay:{
delay:2000,
disableOnInteraction:false, //解决滑动后不能轮播的问题
delay:2000,
disableOnInteraction:false, //解决滑动后不能轮播的问题
},
noSwiping: true,
speed: 3000, //切换速度即slider自动滑动开始到结束的时间单位ms
loop: true, //循环切换
peed: 300, //循环速度
scrollbar: '.swiper-scrollbar',
pagination: {
el: '.swiper-pagination',
// type : 'progressbar', //分页器形状
@@ -712,7 +696,13 @@
let key = 'index';
apiPlace.detail(key).then(res => {
let lmj = JSON.parse(res.result.content)
console.log(lmj.length,'测试')
// if(lmj.length > 1){
this.resonimg = lmj;
// }
})
},
jumUX() {