From 5f1834a6e44610dbc40809050b615c637604fbbc Mon Sep 17 00:00:00 2001 From: erweixin <2991552132@qq.com> Date: Mon, 9 Dec 2024 20:38:53 +0800 Subject: [PATCH] feat(weapp): button openType add liveActivity --- packages/shared/src/components.ts | 1 + packages/taro-components/types/Button.d.ts | 17 +++++++++++++++++ packages/taro-platform-weapp/src/components.ts | 4 +++- 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/packages/shared/src/components.ts b/packages/shared/src/components.ts index 9082a4e1ff54..08c7a10fd8c2 100644 --- a/packages/shared/src/components.ts +++ b/packages/shared/src/components.ts @@ -93,6 +93,7 @@ const Button = { 'hover-stay-time': '70', name: NO_DEFAULT_VALUE, bindagreeprivacyauthorization: NO_DEFAULT_VALUE, + bindcreateliveactivity: NO_DEFAULT_VALUE, ...touchEvents } diff --git a/packages/taro-components/types/Button.d.ts b/packages/taro-components/types/Button.d.ts index eda7e182ac28..b65b8712a795 100644 --- a/packages/taro-components/types/Button.d.ts +++ b/packages/taro-components/types/Button.d.ts @@ -73,6 +73,12 @@ interface ButtonProps extends StandardProps { * @supported weapp, swan */ sessionFrom?: string + /** 一次性订阅消息的模板 notify_type + * 可参考: https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/subscribe-message-2.html + * 生效时机:`open-type="liveActivity"` + * @supported weapp + */ + activityType?: string /** 会话内消息卡片标题 * * 生效时机:`open-type="contact"` @@ -283,6 +289,13 @@ interface ButtonProps extends StandardProps { * @supported tt */ onJoinGroup?: CommonEventFunction<{ errMsg: string; errNo: number }> + /** + * 监听用户一次性订阅消息事件 + * + * 生效时机:`open-type="liveActivity"` + * @supported weapp + */ + onCreateLiveActivity?: CommonEventFunction } declare namespace ButtonProps { /** size 的合法值 */ @@ -350,6 +363,10 @@ declare namespace ButtonProps { * 用户同意隐私协议按钮。可通过 bindagreeprivacyauthorization 监听用户同意隐私协议事件 */ agreePrivacyAuthorization + /** + * 新版一次性订阅消息按钮。可通过 bindcreateliveactivity 监听用户一次性订阅消息事件 + */ + liveActivity /** * 从基础库 2.32.3 版本起,隐私同意按钮支持与手机号快速验证组件耦合使用,调用方式为: *