【功能修复】修复用户卡券装修背景图片问题

pull/76/head
卢越 2024-08-12 10:15:51 +08:00
parent 58af434a90
commit 438897b9d3
2 changed files with 25 additions and 2 deletions

View File

@ -53,7 +53,7 @@
<!-- 用户组件用户资产 -->
<s-wallet-card v-if="type === 'UserWallet'" :data="data" :styles="styles" />
<!-- 用户组件用户卡券 -->
<s-coupon-card v-if="type === 'UserCoupon'" />
<s-coupon-card v-if="type === 'UserCoupon'" :data="data" :styles="styles" />
</view>
</template>

View File

@ -1,6 +1,6 @@
<!-- 装修用户组件用户卡券 -->
<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"
@tap="sheep.$router.go(item.path, { type: item.type })"
:class="item.type === 'all' ? 'menu-wallet' : 'ss-flex-1'">
@ -15,6 +15,7 @@
* 装修组件 - 优惠券菜单
*/
import sheep from '@/sheep';
import { computed } from 'vue';
//
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>