营销:适配商城装修组件【热区】

pull/28/head
owen 2023-12-14 20:22:51 +08:00
parent 2d6cfdf53b
commit 3d415b6ecb
3 changed files with 9 additions and 21 deletions

View File

@ -28,7 +28,7 @@
<!-- 基础组件分割线 -->
<s-line-block v-if="type === 'Divider'" :data="data" />
<!-- 图文组件热区 -->
<s-hotzone-block v-if="type === 'hotzone'" :data="data" :styles="styles" />
<s-hotzone-block v-if="type === 'HotZone'" :data="data" :styles="styles" />
<!-- 商品组件商品卡片 -->
<s-goods-card v-if="type === 'ProductCard'" :data="data" :styles="styles" />

View File

@ -25,19 +25,7 @@
const props = defineProps({
data: {
type: Object,
default() {
return {
// horizontal vertical
direction: 'vertical',
showText: true,
list: [{
imgUrl: 'http://localhost/logo.gif',
url: '',
text: '客服',
textColor: '',
}],
}
},
default() {},
}
})

View File

@ -1,16 +1,16 @@
<template>
<view class="hotzone-wrap">
<image :src="sheep.$url.cdn(data.src)" style="width: 100%" mode="widthFix"></image>
<image :src="sheep.$url.cdn(data.imgUrl)" style="width: 100%" mode="widthFix"></image>
<view
class="hotzone-box"
v-for="item in data.list"
:key="item.width"
v-for="(item, index) in data.list"
:key="index"
:style="[
{
top: item.top + 'rpx',
left: item.left + 'rpx',
width: item.width + 'rpx',
height: item.height + 'rpx',
top: `${item.top}px`,
left: `${item.left}px`,
width: `${item.width}px`,
height: `${item.height}px`,
},
]"
@tap.stop="sheep.$router.go(item.url)"