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:
@@ -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>;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user