diff --git a/sheep/components/s-block-item/s-block-item.vue b/sheep/components/s-block-item/s-block-item.vue
index 9cd6007..ee1ff8d 100644
--- a/sheep/components/s-block-item/s-block-item.vue
+++ b/sheep/components/s-block-item/s-block-item.vue
@@ -47,7 +47,7 @@
-
+
diff --git a/sheep/components/s-user-card/s-user-card.vue b/sheep/components/s-user-card/s-user-card.vue
index d234098..2d32745 100644
--- a/sheep/components/s-user-card/s-user-card.vue
+++ b/sheep/components/s-user-card/s-user-card.vue
@@ -1,6 +1,6 @@
-
+
@@ -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');
}