修改banner的过渡时间
This commit is contained in:
@ -3,7 +3,7 @@
|
|||||||
:style="'background-color:'+itemData.style.background+';'"> -->
|
:style="'background-color:'+itemData.style.background+';'"> -->
|
||||||
<view class="diy-banner-box mb20 pr" :class="itemData.style.imgShape">
|
<view class="diy-banner-box mb20 pr" :class="itemData.style.imgShape">
|
||||||
<swiper class="swiper" :autoplay="autoplay" :interval="interval" :duration="duration" @change="changeSwiper" :style="itemData.style.imgShape=='square'?'height:'+itemData.style.height+'rpx;':'height:'+(itemData.style.height*0.92)+'rpx;'">
|
<swiper class="swiper" :autoplay="autoplay" :interval="interval" :duration="duration" @change="changeSwiper" :style="itemData.style.imgShape=='square'?'height:'+itemData.style.height+'rpx;':'height:'+(itemData.style.height*0.92)+'rpx;'">
|
||||||
<swiper-item v-for="(item,index) in itemData.data" :key="index" @click="gotoPages(item)">
|
<swiper-item v-for="(item,index) in itemData.data" :key="index" @click="previewBannerImage(index)">
|
||||||
<image :style="itemData.style.imgShape=='square'?'height:'+itemData.style.height+'rpx;':'height:'+(itemData.style.height*0.92)+'rpx;'" :src="item.imgUrl"></image>
|
<image :style="itemData.style.imgShape=='square'?'height:'+itemData.style.height+'rpx;':'height:'+(itemData.style.height*0.92)+'rpx;'" :src="item.imgUrl"></image>
|
||||||
</swiper-item>
|
</swiper-item>
|
||||||
</swiper>
|
</swiper>
|
||||||
@ -21,7 +21,7 @@
|
|||||||
return {
|
return {
|
||||||
indicatorDots: true,
|
indicatorDots: true,
|
||||||
autoplay: true,
|
autoplay: true,
|
||||||
interval: 2000,
|
interval: 4000,
|
||||||
duration: 500,
|
duration: 500,
|
||||||
indicatorActiveColor: '#ffffff',
|
indicatorActiveColor: '#ffffff',
|
||||||
current: 0
|
current: 0
|
||||||
@ -37,6 +37,13 @@
|
|||||||
changeSwiper(e) {
|
changeSwiper(e) {
|
||||||
this.current = e.detail.current;
|
this.current = e.detail.current;
|
||||||
},
|
},
|
||||||
|
// 预览轮播图图片
|
||||||
|
previewBannerImage(index) {
|
||||||
|
// 获取所有图片url
|
||||||
|
const urls = this.itemData.data.map(item => item.imgUrl);
|
||||||
|
// 调用全局yulan方法
|
||||||
|
this.yulan(urls, index);
|
||||||
|
},
|
||||||
/*跳转页面*/
|
/*跳转页面*/
|
||||||
gotoPages(e) {
|
gotoPages(e) {
|
||||||
this.gotoPage(e.linkUrl);
|
this.gotoPage(e.linkUrl);
|
||||||
|
|||||||
Reference in New Issue
Block a user