fix(subscription): preselect pay channel before navigation
This commit is contained in:
@@ -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;
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user