Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(weapp): button openType add "liveActivity" #16998

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/shared/src/components.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ const Button = {
'hover-stay-time': '70',
name: NO_DEFAULT_VALUE,
bindagreeprivacyauthorization: NO_DEFAULT_VALUE,
bindcreateliveactivity: NO_DEFAULT_VALUE,
...touchEvents
}

Expand Down
17 changes: 17 additions & 0 deletions packages/taro-components/types/Button.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down Expand Up @@ -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 的合法值 */
Expand Down Expand Up @@ -350,6 +363,10 @@ declare namespace ButtonProps {
* 用户同意隐私协议按钮。可通过 bindagreeprivacyauthorization 监听用户同意隐私协议事件
*/
agreePrivacyAuthorization
/**
* 新版一次性订阅消息按钮。可通过 bindcreateliveactivity 监听用户一次性订阅消息事件
*/
liveActivity
/**
* 从基础库 2.32.3 版本起,隐私同意按钮支持与手机号快速验证组件耦合使用,调用方式为:
* <button open-type="getPhoneNumber|agreePrivacyAuthorization">
Expand Down
4 changes: 3 additions & 1 deletion packages/taro-platform-weapp/src/components.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ export const components = {
'app-parameter': _empty,
'show-message-card': _false,
'business-id': _empty,
'activity-type': _empty,
bindGetUserInfo: _empty,
bindContact: _empty,
bindGetPhoneNumber: _empty,
Expand All @@ -70,7 +71,8 @@ export const components = {
bindError: _empty,
bindOpenSetting: _empty,
bindLaunchApp: _empty,
bindAgreePrivacyAuthorization: _empty
bindAgreePrivacyAuthorization: _empty,
bindCreateLiveActivity: _empty,
},
Form: {
'report-submit-timeout': _zero
Expand Down