feat: 退出登录之后不展示注销按钮

This commit is contained in:
zoujing
2026-09-18 10:52:54 +08:00
parent 8f8ca96a82
commit e364a4b74f

View File

@@ -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(() => {