aweme-user-card 一键关注抖音号

更新时间 2024-07-24 02:58:49
收藏
我的收藏
基础库 2.87.0 开始支持本组件,低版本需做兼容处理。​
一键关注抖音号组件,可关注用户、取关用户、跳转个人页。仅抖音 \ 抖音 Lite \ 抖音火山版支持。​
使用该功能前开发者需要绑定想要关注的抖音号,具体信息请参考关注抖音号能力接入指南。​
一键关注抖音号组件是原生组件,层级最高,无法被其他组件覆盖,不支持通过 css 调整组件的样式。​
组件不支持局部滚动,也不支持嵌套在 swiper、scroll-view 组件中使用。​

属性说明​

属性名​
类型​
默认值​
必填​
说明​
最低支持版本​
aweme-id​
string​
是​
引导关注的抖音号,只支持小程序绑定的品牌号、员工号。​
2.92.0​
width​
number​
504​
否​
组件宽度(单位:rpx),最小值 544,最大值750​
2.87.0​
height​
number​
144​
否​
组件高度(单位:rpx),最小值 96,最大值288​
2.87.0​
left-right-padding​
number​
32​
否​
组件左右 padding(单位:rpx),最大值 96,最小值 0
2.87.0​
fixed​
boolean​
false​
否​
组件是否为fixed布局​
2.87.0​
binderror​
EventHandle​
否​
组件出现错误,event.detail = { errMsg: string } ,具体说明可参考错误说明
2.87.0​

错误说明​

errMsg
说明
awemeId not exist​
抖音号不存在​
awemeId not support​
只支持小程序绑定的品牌号、员工号​
context has been destoryed​
小程序上下文已销毁​
Can't find web view render with web view id xx;​
找不到webview容器​
current miniapp does not bind aweme account​
小程序未绑定抖音用户​
login failed when logging in (code = %s, msg = %s)​
关注时尝试登录, 但登录失败​
login canceled when logging in​
关注时尝试登录, 但登录取消​
cannot get aweme account data,%s​
通过uid获取抖音账号(头像、昵称等)信息失败​
follow aweme user failed,%s​
用户点击关注,请求执行失败​
unfollow aweme user failed,%s​
用户点击取消关注,请求执行失败​
open user profile failed, %s​
跳转个人页失败​
There can only be one fixed component​
页面已经存在fix模式组件时,新增fix组件或者将现有组件改为fix模式​
The horizontal position of the component must not exceed the bounds of the screen​
组件水平位置不得超出屏幕范围​
component position overlaps​
组件不能被遮挡覆盖​

扫码体验​

代码示例​

Bug & Tip​

Tip:使用该功能前,开发者需要去开发者后台-设置-关联设置-抖音号管理为对应的抖音号申请关注抖音号组件能力。​