follow 关注公众号公共组件
使用指南
一般用法
通过跳转到公众号文章,引导用户扫码关注公众号;提供查询关注公众号状态能力(接口)。
支持通过useScene、当前页面配置不同的关注公众号文章链接;支持通过组件属性指定使用的关注公众号文章链接。
| 属性 | 类型 | 默认值 | 必填 | 说明 |
| show | Boolean | false | 是 | 是否展示UI |
| customUI | Boolean | false | 否 | 是否自定义UI;自定义UI时,需使用follow slot来指定关注按钮 |
| publicSrc | String | | 否 | 关注公众号链接;方便使用方传入链接,也可以通过运营平台来配置 |
| useScene | String | | 否 | 使用场景;支持区分不同使用场景配置不同的公众号文章链接 |
| logo | String | https://static.img.tai.qq.com/mp/components/follow/logo-default.png | 否 | logo |
| title | String | 关注微信公众号 | 否 | 标题 |
| desc | String | 公众号搜索\n“腾讯出行服务”\n关注后就可以随时接收限行消息 | 否 | 描述 |
| btnText | String | 去关注公众号 | 否 | 按钮文字 |
| bind:error | eventhandle | | 否 | 出错 |
| bind:follow | eventhandle | | 否 | 关注动作完成,不确定关注结果 |
组件还提供以下方法:
fetchFollowStatus:查询公众号关注状态 followOA:发起公众号关注动作
Promise<{followStatus: Boolean}>: fetchFollowStatus(useCache: Boolean)
Promise<{followStatus: Boolean}>: followOA(publicSrc: String)
bind:follow 事件数据结构
| 属性 | 类型 | 说明 |
| followStatus | Boolean | 用户最新关注状态 |
bind:error 事件数据结构
| 属性 | 类型 | 说明 |
| error | Object | 错误对象 |