first commit

This commit is contained in:
douboer
2026-03-21 18:57:10 +08:00
commit c49aa1a5e9
570 changed files with 107167 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
/**
* 小程序页面导航策略:
* 1. 底部导航在“页面之间横跳”时优先使用 redirectTo避免长期堆积页面实例
* 2. 同一路径返回 noop避免重复触发无意义导航
* 3. 仅当目标不是标准页面路由时,才退回 navigateTo。
*/
function resolvePageNavigationMethod(currentPath, targetPath) {
const current = String(currentPath || "").trim();
const target = String(targetPath || "").trim();
if (!target) return "noop";
if (current && current === target) return "noop";
if (/^\/pages\/.+\/index$/.test(target)) {
return "redirectTo";
}
return "navigateTo";
}
module.exports = {
resolvePageNavigationMethod
};