mama-box: 我的页 — 去掉右上角商城图标; 退出登录改资料卡右上角图标按钮; 商城卡去掉甄选好物角标 (v26090706)

This commit is contained in:
2026-09-07 23:31:22 +08:00
parent ecfa4d054b
commit 3b52b1c222
3 changed files with 31 additions and 24 deletions

View File

@@ -4156,13 +4156,17 @@
var meAuth = $('#meAuthCard');
if (meAuth) meAuth.addEventListener('click', goAuth);
/* 「退出登录」:清除本机身份(openid/unionid/资料展示) → 重新加载页面回到未登录态。
入口跳到授权页,便于直接测试授权流程。 */
var meLogout = $('#meLogoutCard');
if (meLogout) meLogout.addEventListener('click', function () {
/* 「退出登录」(个人资料卡右上角图标按钮):清除本机身份(openid/unionid/资料展示)
→ 重新加载页面回到未登录态,便于直接测试授权流程。
⚠️ stopPropagation:me-card 整卡是 data-modal="modalProfile",不阻止冒泡
会顺带打开资料弹窗。 */
var meLogout = $('#meLogoutBtn');
if (meLogout) meLogout.addEventListener('click', function (e) {
e.preventDefault();
e.stopPropagation();
haptic();
if (!(window.wx && window.wx.miniProgram)) { toast('请在微信小程序中打开'); return; }
try { if (location.hash) location.hash = ''; } catch (e) {}
try { if (location.hash) location.hash = ''; } catch (e2) {}
// 清除本地读取到的 openid/unionid,回到未登录态
try {
var base = location.href.split('#')[0];
@@ -4172,7 +4176,7 @@
var url = base + (q && q !== '?' ? q : '') ;
// 重新加载当前 H5(去掉身份)→ applyRemoteProfile 因无 openid 跳过,页面回到未登录占位
location.replace(url + '?t=' + Date.now());
} catch (e) {
} catch (e3) {
toast('已清除身份');
}
});