From a07b6d011a9f20eca16b02aa54242978f41b65d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E6=98=8A=E5=A4=A9?= <442384644@qq.com> Date: Mon, 26 Oct 2026 14:09:26 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E9=A6=96=E9=A1=B5=E7=94=A8=E6=88=B7):=20?= =?UTF-8?q?=E7=AD=89=E7=BA=A7=E8=A7=92=E6=A0=87=E4=B8=8E=E4=BB=98=E8=B4=B9?= =?UTF-8?q?=E4=BC=9A=E5=91=98=E8=A7=92=E6=A0=87=E5=88=86=E5=BC=80=E5=B1=95?= =?UTF-8?q?=E7=A4=BA=EF=BC=8C=E9=81=BF=E5=85=8D=E4=BA=92=E7=9B=B8=E8=A6=86?= =?UTF-8?q?=E7=9B=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Cursor --- .../diyComponents/homeUserInfor.vue | 88 +++++++++++++------ 1 file changed, 62 insertions(+), 26 deletions(-) diff --git a/frontend/uni-app/src/subpackage/diyComponents/homeUserInfor.vue b/frontend/uni-app/src/subpackage/diyComponents/homeUserInfor.vue index e8eb80d6f..f5f3b86d3 100644 --- a/frontend/uni-app/src/subpackage/diyComponents/homeUserInfor.vue +++ b/frontend/uni-app/src/subpackage/diyComponents/homeUserInfor.vue @@ -19,14 +19,19 @@ {{ userName }} - + - {{ - vipBadge.text + {{ + badge.text }} @@ -74,14 +79,19 @@ {{ userName }} - + - {{ - vipBadge.text + {{ + badge.text }} @@ -116,14 +126,19 @@ {{ userName }} - + - {{ - vipBadge.text + {{ + badge.text }} @@ -175,14 +190,19 @@ {{ userName }} - + - {{ - vipBadge.text + {{ + badge.text }} @@ -319,14 +339,19 @@ {{ userName }} - + - {{ - vipBadge.text + {{ + badge.text }} @@ -996,13 +1021,24 @@ const userName = computed(() => { if (!isLogin.value) return "请点击登录"; return (userInfo.value && userInfo.value.nickname) || ""; }); -// 付费会员标识:等级图标+等级名优先,纯付费会员展示皇冠+「付费会员」 -const vipBadge = computed(() => { +// 等级角标与付费会员角标分开展示,避免有等级时盖掉「付费会员」 +const vipBadges = computed(() => { + if (!isLogin.value) return []; const info = userInfo.value || {}; - const visible = Boolean(isLogin.value && (info.pay_vip_status || info.vip)); - const icon = info.vip_icon || ""; - const text = info.vip_name || (info.pay_vip_status ? "付费会员" : ""); - return { visible: visible && Boolean(icon || text), icon, text }; + const list = []; + if (info.vip && (info.vip_icon || info.vip_name)) { + list.push({ + icon: info.vip_icon || "", + text: info.vip_name || "", + }); + } + if (info.pay_vip_status) { + list.push({ + icon: "/static/images/king.png", + text: "付费会员", + }); + } + return list.filter((item) => item.icon || item.text); }); const userSubText = computed(() => { if (!isLogin.value) return "";