创新互联百度小程序教程:swan.updateBookshelfReadTime
- swan.updateBookshelfReadTime
- 方法参数
- object 参数说明
- success 返回参数说明
- 代码示例
- 方法参数
swan.updateBookshelfReadTime
基础库 3.190.1 开始支持,低版本需做兼容处理。
解释:更新已加入宿主书架的内容的阅读时间(需宿主支持书架入口)。
Web 态说明:Web 态不支持更新已加入宿主书架的内容的阅读时间,调用会执行失败回调。
方法参数
Object object
object 参数说明
| 参数名 | 类型 | 是否必填 | 默认值 | 说明 |
|---|---|---|---|---|
| category | String | 是 | - | 添加的内容分类:article(专栏模板)、doc(文档模板)、cartoon(动漫模板)、av(影音模板)。详细模板说明请参见书架同步功能介绍 |
| contentId | String | 是 | - | 要更新内容的 id;注释:contentId 为内容 id,内容的唯一标识,自定义,最长 22 字符(不能含有空格、中文字符) |
| success | Function | 否 | - | 接口调用成功的回调函数 |
| fail | Function | 否 | - | 接口调用失败的回调函数 |
| complete | Function | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |
success 返回参数说明
| 参数名 | 类型 | 说明 |
|---|---|---|
| status | Number | 更新状态:值为 0 时是失败,为 1 时是成功 |
| msg | String | 更新的结果信息 |
代码示例
- JS
swan.updateBookshelfReadTime({category: 'doc',contentIds: 'test1',success(res) {swan.showModal({title: 'success',content: JSON.stringify(res)});},fail(err) {swan.showModal({title: 'fail',content: JSON.stringify(err)});}})
分享文章:创新互联百度小程序教程:swan.updateBookshelfReadTime
标题网址:http://www.jxjierui.cn/article/dphjegh.html


咨询
建站咨询

