Compare commits

...

2 Commits

Author SHA1 Message Date
dzl
baea20728e 增加自动切换功能 2025-09-23 16:28:24 +08:00
dzl
b1a91f3888 bug修改 2025-09-23 16:05:10 +08:00
2 changed files with 16 additions and 2 deletions

View File

@@ -292,8 +292,8 @@ export default {
{text: '账号安全', path: '/editpasswordpage'},
{text: '商户资料', path: '/editdetailspage'},
{text: '分享', path: '/distribution'},
{text: '用户协议', click: showUserText},
{text: '隐私政策', click: showPrivacyText},
{text: '用户协议', path: '', click: showUserText},
{text: '隐私政策', path: '', click: showPrivacyText},
]);
const functionItems = ref([
{image: "/imgs/mainpage/jiaoyijilu.png", text: "购物车", path: "/cart"},

View File

@@ -798,6 +798,20 @@ const addScrollListener = (tabName) => {
// 移除监听器,避免重复触发
contentRef.removeEventListener('scroll', handleScroll);
// 自动切换到下一个未读协议
setTimeout(() => {
const currentIndex = agreementTabs.value.findIndex(t => t.name === tabName);
const nextUnreadTab = agreementTabs.value.find((t, index) => index >= 0 && !t.viewed);
if (nextUnreadTab) {
// 切换到下一个未读协议
activeTab.value = nextUnreadTab.name;
nextTick(() => {
addScrollListener(nextUnreadTab.name);
});
}
}, 500); // 延迟500ms切换让用户看到已读状态
}
}
};