59 lines
1.0 KiB
Vue
59 lines
1.0 KiB
Vue
<template>
|
|
<view class="container">
|
|
<swiper class="swiper" circular
|
|
:indicator-dots="activityList.length > 1"
|
|
indicator-color="#FFFFFF"
|
|
indicator-active-color="#00A6FF"
|
|
:autoplay="autoplay"
|
|
:interval="interval"
|
|
:duration="duration">
|
|
<swiper-item v-for="item in activityList" :key="item.id">
|
|
<view class="swiper-item">
|
|
<image :src="item.activityCover" mode="aspectFill"></image>
|
|
</view>
|
|
</swiper-item>
|
|
</swiper>
|
|
|
|
</view>
|
|
</template>
|
|
|
|
<script setup>
|
|
import { ref } from 'vue'
|
|
|
|
const autoplay = ref(true)
|
|
const interval = ref(3000)
|
|
const duration = ref(500)
|
|
|
|
const props = defineProps({
|
|
activityList: {
|
|
type: Array,
|
|
default: []
|
|
}
|
|
})
|
|
|
|
</script>
|
|
|
|
<style scoped lang="scss">
|
|
.container {
|
|
margin-bottom: 6px;
|
|
|
|
.uni-margin-wrap {
|
|
width: 100%;
|
|
}
|
|
.swiper {
|
|
height: 120px;
|
|
border-radius: 8px;
|
|
}
|
|
.swiper-item {
|
|
display: block;
|
|
height: 120px;
|
|
line-height: 120px;
|
|
text-align: center;
|
|
}
|
|
.swiper-item image {
|
|
width: 100%;
|
|
height: 100%;
|
|
border-radius: 8px;
|
|
}
|
|
}
|
|
</style> |