feat: batch update - gift card breakdown spec, backend APIs, miniprogram pages, ETL finance recharge, docs & migrations

This commit is contained in:
Neo
2026-03-20 01:43:48 +08:00
parent 075caf067f
commit 79f9a0e1da
437 changed files with 118603 additions and 976 deletions

View File

@@ -0,0 +1,45 @@
/**
* 路由辅助工具函数
* getMenuRoute 为纯函数navigateTo/switchTab/navigateBack 封装 wx.* API
*/
/** 菜单 key → 页面路径映射 */
const MENU_ROUTE_MAP: Record<string, string> = {
'chat-history': '/pages/chat-history/chat-history',
'performance': '/pages/performance/performance',
'notes': '/pages/notes/notes',
'settings': '',
}
/**
* 获取菜单项对应的页面路径
* @param menuKey 菜单 key
* @returns 页面路径,未知 key 返回空字符串
*/
export function getMenuRoute(menuKey: string): string {
return MENU_ROUTE_MAP[menuKey] ?? ''
}
/**
* 跳转到普通页面
* @param url 页面路径
*/
export function navigateTo(url: string): void {
wx.navigateTo({ url })
}
/**
* 切换 TabBar 页面
* @param url TabBar 页面路径
*/
export function switchTab(url: string): void {
wx.switchTab({ url })
}
/**
* 返回上一页
* @param delta 返回层数,默认 1
*/
export function navigateBack(delta: number = 1): void {
wx.navigateBack({ delta })
}