feat(promo): generate WeChat mini-program codes on create

Use getwxacodeunlimit with activity id as scene, upload PNG to OSS qrcode/, and show in HQ admin.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-07-23 00:21:10 +08:00
parent 0418370c31
commit bca1d8afea
11 changed files with 162 additions and 34 deletions
@@ -28,6 +28,17 @@ export type WechatPayNotifyResult = {
amountFen: number;
};
export type WechatWxaCodeUnlimitedInput = {
/** 最大 32 可见字符,扫码后小程序 onLaunch.options.scene */
scene: string;
/** 小程序页面路径,如 pages/home/index(不要前导 / */
page?: string;
width?: number;
checkPath?: boolean;
envVersion?: 'release' | 'trial' | 'develop';
isHyaline?: boolean;
};
export interface IWechatProvider {
isEnabled(): boolean;
@@ -81,4 +92,7 @@ export interface IWechatProvider {
headers: Record<string, string | string[] | undefined>,
rawBody: string,
): Promise<WechatPayNotifyResult>;
/** 获取不限制的小程序码(PNG Buffer),须服务端调用 */
getWxaCodeUnlimited(input: WechatWxaCodeUnlimitedInput): Promise<Buffer>;
}