diamond-balance钻石充值与余额组件收藏我的收藏
收藏
我的收藏使用说明
开发者可将此组件引入用于展示用户钻石余额信息和完成钻石充值流程。
效果示例
使用限制
- •支持设备:iOS。
- •支持宿主版本:抖音32.4.0及以上版本。
tt.canIUse('diamond-balance')
参数说明
属性名 | 类型 | 默认值 | 必填 | 说明 |
custom-style | object | 无 | 否 | 自定义样式,详见下文说明 |
bind:error | EventHandle | 无 | 否 | 组件传入属性异常、组件内部发生异常时触发 |
bind:success | EventHandle | 无 | 否 | 用户钻石余额充值成功回调 |
custom-style 说明
属性名 | 类型 | 默认值 | 必填 | 说明 |
fontSize | string | 无 | 否 | 组件文字大小 |
fontColor | string | 无 | 否 | 组件文字颜色 |
logoWidth | string | 无 | 否 | 抖音钻石图标宽度 |
logoHeight | string | 无 | 否 | 抖音钻石图标高度 |
arrowWidth | object | 无 | 否 | 箭头宽度 |
arrowHeight | object | 无 | 否 | 箭头高度 |
bind:error 错误说明
属性名 | 类型 | 说明 |
21550 | User is not login | 用户未登录 |
174701 | Fail to get user balance info | 获取用户余额信息失败 |
174703 | only support iOS | 仅支持ios客户端使用 |
扫码体验
无。
代码示例
- 1.页面 json 引入。
{ "usingComponents": { "diamond-balance": "ext://industry/diamond-balance" } }
- 2.ttml 引入组件,使用 tt.canIUse('diamond-balance') 判断是否支持组件。
<diamond-balance bind:error="handleError" bind:success="handleSuccess" />
- 3.实现 bind:success 回调。
// bind:success 使用示例 handleSuccess(event) { // 用户充值成功提示 }
- 4.实现 bind:error 回调。
// bind:error 使用示例 handleError(event){ // errNo(错误码,对应某种具体报错原因) // errMsg(报错信息) const { errNo, errMsg } = event.detail this.setData({ show: false }) }
Bug & Tip
无。