营销:适配商城装修组件【菜单导航】

pull/14/head
owen 2023-11-09 09:18:45 +08:00
parent a40aa1218d
commit e4af437545
2 changed files with 11 additions and 17 deletions

View File

@ -5,7 +5,7 @@
<!-- 基础组件公告栏 -->
<s-notice-block v-if="type === 'NoticeBar'" :data="data" />
<!-- 基础组件菜单导航 -->
<s-menu-button v-if="type === 'menuButton'" :data="data" :styles="styles" />
<s-menu-button v-if="type === 'MenuSwiper'" :data="data" :styles="styles" />
<!-- 基础组件列表导航 -->
<s-menu-list v-if="type === 'MenuList'" :data="data" />
<!-- 基础组件宫格导航 -->

View File

@ -21,12 +21,12 @@
:class="{ cur: state.cur == index }"
>
<!-- 宫格 -->
<view class="grid-wrap" :col="data.rowNum">
<view class="grid-wrap">
<view
v-for="(item, index) in arr"
:key="index"
class="grid-item ss-flex ss-flex-col ss-col-center ss-row-center"
:style="[{ width: clWidth + 'px', height: '200rpx' }]"
:style="[{ width: `${100 * (1 / data.column)}%`, height: '200rpx' }]"
hover-class="ss-hover-btn"
@tap="sheep.$router.go(item.url)"
>
@ -34,12 +34,12 @@
<view
v-if="item.badge.show"
class="tag-box"
:style="[{ background: item.badge.bgColor, color: item.badge.color }]"
:style="[{ background: item.badge.bgColor, color: item.badge.textColor }]"
>
{{ item.badge.text }}
</view>
<image
v-if="item.src"
v-if="item.iconUrl"
class="menu-icon"
:style="[
{
@ -47,15 +47,15 @@
height: props.iconSize + 'rpx',
},
]"
:src="sheep.$url.cdn(item.src)"
:src="sheep.$url.cdn(item.iconUrl)"
mode="aspectFill"
></image>
<view
v-if="data.layout == 1"
v-if="data.layout === 'iconText'"
class="menu-title"
:style="[{ color: item.title.color }]"
:style="[{ color: item.titleColor }]"
>
{{ item.title.text }}
{{ item.title }}
</view>
</view>
</view>
@ -206,15 +206,9 @@
});
//
const menuList = computed(() => splitData(props.data.list, props.data.row * props.data.col));
const swiperHeight = computed(() => props.data.row * (props.data.layout == 1 ? 200 : 180));
const menuList = computed(() => splitData(props.data.list, props.data.row * props.data.column));
const swiperHeight = computed(() => props.data.row * (props.data.layout === 'iconText' ? 200 : 180));
const windowWidth = sheep.$platform.device.windowWidth;
const clWidth = computed(
() =>
(windowWidth -
(props.styles.marginLeft + props.styles.marginRight + props.styles.padding * 2)) /
props.data.col,
);
// current change
const swiperChange = (e) => {