|
@@ -1,6 +1,6 @@
|
|
<!-- 装修用户组件:用户卡券 -->
|
|
<!-- 装修用户组件:用户卡券 -->
|
|
<template>
|
|
<template>
|
|
- <view class="ss-coupon-menu-wrap ss-flex ss-col-center">
|
|
|
|
|
|
+ <view class="ss-coupon-menu-wrap ss-flex ss-col-center" :style="[style, { marginLeft: `${data.space}px` }]">
|
|
<view class="menu-item ss-flex-col ss-row-center ss-col-center" v-for="item in props.list" :key="item.title"
|
|
<view class="menu-item ss-flex-col ss-row-center ss-col-center" v-for="item in props.list" :key="item.title"
|
|
@tap="sheep.$router.go(item.path, { type: item.type })"
|
|
@tap="sheep.$router.go(item.path, { type: item.type })"
|
|
:class="item.type === 'all' ? 'menu-wallet' : 'ss-flex-1'">
|
|
:class="item.type === 'all' ? 'menu-wallet' : 'ss-flex-1'">
|
|
@@ -15,6 +15,7 @@
|
|
* 装修组件 - 优惠券菜单
|
|
* 装修组件 - 优惠券菜单
|
|
*/
|
|
*/
|
|
import sheep from '@/sheep';
|
|
import sheep from '@/sheep';
|
|
|
|
+ import { computed } from 'vue';
|
|
|
|
|
|
// 接收参数
|
|
// 接收参数
|
|
const props = defineProps({
|
|
const props = defineProps({
|
|
@@ -52,6 +53,28 @@
|
|
];
|
|
];
|
|
},
|
|
},
|
|
},
|
|
},
|
|
|
|
+ // 装修数据
|
|
|
|
+ data: {
|
|
|
|
+ type: Object,
|
|
|
|
+ default: () => ({}),
|
|
|
|
+ },
|
|
|
|
+ // 装修样式
|
|
|
|
+ styles: {
|
|
|
|
+ type: Object,
|
|
|
|
+ default: () => ({}),
|
|
|
|
+ },
|
|
|
|
+ });
|
|
|
|
+ // 设置背景样式
|
|
|
|
+ const style = computed(() => {
|
|
|
|
+ // 直接从 props.styles 解构
|
|
|
|
+ const { bgType, bgImg, bgColor } = props.styles;
|
|
|
|
+
|
|
|
|
+ // 根据 bgType 返回相应的样式
|
|
|
|
+ return {
|
|
|
|
+ background: bgType === 'img'
|
|
|
|
+ ? `url(${bgImg}) no-repeat top center / 100% 100%`
|
|
|
|
+ : bgColor
|
|
|
|
+ };
|
|
});
|
|
});
|
|
</script>
|
|
</script>
|
|
|
|
|