1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<template>
<view>
<uni-swiper-dot :info="slide_list" :dotsStyles="{'width': 4,'height':4, 'bottom':5, 'selectedBackgroundColor':'#fff', 'backgroundColor': '#ccc', 'border':'none','selectedBorder':'none'}" :mode="slide_setting.tipsStyle === 1 ? 'dot' : 'default'" :current="current" :showDots="slide_setting.dots">
<swiper :autoplay="autoplay" :style="{'background-color': slide_setting.bg_color, 'height': slide_setting.slideHeight*2+'rpx'}" circular="true" :interval="interval" @change="change">
<swiper-item v-for="(item, key) in slide_list" :key="key">
<view :style="{'height': slide_setting.slideHeight*2+'rpx'}">
<image class="slide_img" :src="item.img_url" @click="$jump(item.img_href)"></image>
</view>
</swiper-item>
</swiper>
</uni-swiper-dot>
</view>
</template>
<script>
import uniSwiperDot from "@/components/uni-swiper-dot/uni-swiper-dot.vue"
export default {
props: {
wrapper_props: {
type: Object
}
},
data() {
return {
slide_setting: this.wrapper_props.slide_setting,
slide_list: this.wrapper_props.slide_list,
current: 0,
interval: 3000,
autoplay: this.wrapper_props.slide_setting.autoplay
}
},
mounted() {
const { infinite } = this.slide_setting;
const list = [];
const goods_type = this.$getCache('goods_type');
this.slide_list.map((item, index) => {
if((item.goods_type > 0 && goods_type > 0) || item.goods_type == 0) {
list.push(item)
}
});
this.slide_list = list;
if(!infinite) {
const time = this.interval * this.slide_list.length;
setTimeout(() => {
this.autoplay = false;
}, time);
}
},
methods: {
change(e) {
this.current = e.detail.current;
}
},
components: {
uniSwiperDot
}
}
</script>
<style lang="less" scoped>
.slide_img {
width: 100%;
height: 100%;
}
</style>