【功能修复】修复装修用户卡片使用图片无效的问题

pull/75/head
卢越 2024-08-11 14:03:20 +08:00
parent 5feab41b3d
commit 19d3cb33e2
2 changed files with 24 additions and 6 deletions

View File

@ -47,7 +47,7 @@
<s-richtext-block v-if="type === 'PromotionArticle'" :data="data" :styles="styles" />
<!-- 用户组件用户卡片 -->
<s-user-card v-if="type === 'UserCard'" />
<s-user-card v-if="type === 'UserCard'" :data="data" :styles="styles" />
<!-- 用户组件用户订单 -->
<s-order-card v-if="type === 'UserOrder'" :data="data" />
<!-- 用户组件用户资产 -->

View File

@ -1,6 +1,6 @@
<!-- 装修用户组件用户卡片 -->
<template>
<view class="ss-user-info-wrap ss-p-t-50">
<view class="ss-user-info-wrap ss-p-t-50" :style="[style, { marginLeft: `${data.space}px` }]">
<view class="ss-flex ss-col-center ss-row-between ss-m-b-20">
<view class="left-box ss-flex ss-col-center ss-m-l-36">
<view class="avatar-box ss-m-r-24">
@ -70,9 +70,15 @@
const isLogin = computed(() => sheep.$store('user').isLogin);
//
const props = defineProps({
background: {
type: String,
default: '',
//
data: {
type: Object,
default: () => ({}),
},
//
styles: {
type: Object,
default: () => ({}),
},
//
avatar: {
@ -96,7 +102,19 @@
default: '1',
},
});
//
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
};
});
//
function onBind() {
showAuthModal('changeMobile');
}