feat: 添加图片热区组件、轮播图组件添加控制轮播组件
This commit is contained in:
@@ -27,6 +27,8 @@
|
||||
<s-seckill-block v-if="type === 'seckill'" :data="data" :styles="styles"></s-seckill-block>
|
||||
<s-groupon-block v-if="type === 'groupon'" :data="data" :styles="styles"></s-groupon-block>
|
||||
<s-richtext-block v-if="type === 'richtext'" :data="data" :styles="styles"></s-richtext-block>
|
||||
<s-hotzone-block v-if="type === 'hotzone'" :data="data" :styles="styles"></s-hotzone-block>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
<template>
|
||||
<view class="hotzone-wrap">
|
||||
<image :src="sheep.$url.cdn(data.src)" style="width: 100%" mode="widthFix"></image>
|
||||
<view
|
||||
class="hotzone-box"
|
||||
v-for="item in data.list"
|
||||
:key="item.width"
|
||||
:style="[
|
||||
{
|
||||
top: item.top + 'rpx',
|
||||
left: item.left + 'rpx',
|
||||
width: item.width + 'rpx',
|
||||
height: item.height + 'rpx',
|
||||
},
|
||||
]"
|
||||
@tap.stop="sheep.$router.go(item.url)"
|
||||
>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import sheep from '@/sheep';
|
||||
|
||||
// 接收参数
|
||||
const props = defineProps({
|
||||
data: {
|
||||
type: Object,
|
||||
default: () => ({}),
|
||||
},
|
||||
styles: {
|
||||
type: Object,
|
||||
default: () => ({}),
|
||||
},
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.hotzone-wrap {
|
||||
position: relative;
|
||||
}
|
||||
.hotzone-box {
|
||||
position: absolute;
|
||||
}
|
||||
</style>
|
||||
@@ -5,6 +5,8 @@
|
||||
imageMode="widthFix"
|
||||
dotCur="bg-mask-40"
|
||||
:seizeHeight="300"
|
||||
:autoplay="data.autoplay"
|
||||
:interval="Number(data.interval)"
|
||||
/>
|
||||
</template>
|
||||
|
||||
|
||||
@@ -116,7 +116,7 @@
|
||||
},
|
||||
interval: {
|
||||
type: Number,
|
||||
default: 5000,
|
||||
default: 3000,
|
||||
},
|
||||
duration: {
|
||||
type: Number,
|
||||
|
||||
Reference in New Issue
Block a user