<template>
|
|
<view class="swiper">
|
|
<uv-swiper
|
|
:list="bannerList" keyName="image"
|
|
indicator
|
|
indicatorMode="dot"
|
|
indicatorInactiveColor="rgba(255, 255, 255, 0.7)"
|
|
height="382rpx"
|
|
></uv-swiper>
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
export default {
|
|
data() {
|
|
return {
|
|
bannerList: [],
|
|
}
|
|
},
|
|
created() {
|
|
this.getData()
|
|
},
|
|
methods: {
|
|
async getData() {
|
|
try {
|
|
this.bannerList = (await this.$fetch('queryBannerList', { type: 0 })).records // type:0-首页顶部 1-首页中部
|
|
} catch (err) {
|
|
|
|
}
|
|
},
|
|
},
|
|
}
|
|
</script>
|
|
|
|
<style scoped lang="scss">
|
|
.swiper {
|
|
border-radius: 40rpx;
|
|
overflow: hidden;
|
|
}
|
|
</style>
|