fix(subscription): preselect pay channel before navigation

This commit is contained in:
2026-07-02 11:38:47 +08:00
parent 35c8de917d
commit cd25fa35f2
15 changed files with 121 additions and 56 deletions
+4 -1
View File
@@ -14,6 +14,8 @@
* error / not-found / page / sidebar-screen / splash-screen)使用 —— 不能整体注释。
*/
import type { PayChannel } from "@/data/dto/payment";
/** 静态路由字面量 */
export const ROUTES = {
root: "/",
@@ -35,9 +37,10 @@ export const ROUTE_BUILDERS = {
`/chat/image/${encodeURIComponent(messageId)}` as const,
subscription: (
type: "vip" | "topup",
options: { returnTo?: "chat" } = {},
options: { payChannel?: PayChannel; returnTo?: "chat" } = {},
): `/subscription?${string}` => {
const params = new URLSearchParams({ type });
if (options.payChannel) params.set("payChannel", options.payChannel);
if (options.returnTo) params.set("returnTo", options.returnTo);
return `${ROUTES.subscription}?${params.toString()}` as const;
},