增加自动切换功能
This commit is contained in:
@@ -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切换,让用户看到已读状态
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user