diff --git a/src/pages/mine/index.vue b/src/pages/mine/index.vue index f9a5d32..47500f2 100644 --- a/src/pages/mine/index.vue +++ b/src/pages/mine/index.vue @@ -92,15 +92,18 @@ const doLogout = async () => { uni.showToast({ title: "已退出登录", icon: "none" }); }; -/** 主功能列表:6 项 */ -const cells = computed(() => [ - { key: "benefit", icon: "ticket", label: "我的权益", badge: isLogin.value ? usableCount.value : 0, onTap: onMyBenefit }, - { key: "privacy", icon: "shield", label: "隐私政策", onTap: () => goAgreement("privacy") }, - { key: "terms", icon: "doc", label: "用户协议", onTap: () => goAgreement("terms") }, - { key: "about", icon: "info", label: "关于我们", onTap: goAbout }, - { key: "service", icon: "headset", label: "联系客服", text: servicePhone.value, onTap: onContactService }, - { key: "cancel", icon: "trash", label: "账户注销", onTap: goAccountCancel }, -]); +/** 主功能列表:5 项固定,「账户注销」仅登录后出现 */ +const cells = computed(() => { + const list = [ + { key: "benefit", icon: "ticket", label: "我的权益", badge: isLogin.value ? usableCount.value : 0, onTap: onMyBenefit }, + { key: "privacy", icon: "shield", label: "隐私政策", onTap: () => goAgreement("privacy") }, + { key: "terms", icon: "doc", label: "用户协议", onTap: () => goAgreement("terms") }, + { key: "about", icon: "info", label: "关于我们", onTap: goAbout }, + { key: "service", icon: "headset", label: "联系客服", text: servicePhone.value, onTap: onContactService }, + ]; + if (isLogin.value) list.push({ key: "cancel", icon: "trash", label: "账户注销", onTap: goAccountCancel }); + return list; +}); /** 分组渲染:主列表一组,退出登录单独成组(仅登录后出现) */ const groups = computed(() => {