企业内部前端APIH5微应用JSAPI开放接口分享
【摘要】 HWH5.share使用H5微应用JSAPI需要引用资源,查看详细文档页面内发起分享请求参数参数类型必填说明typeString是IMtitleString是标题h5UriString是h5的URLfromString是string 分享来源 有默认值descString否描述pcUriString否pc的URL;isPCDisplya 值为 1 的时候必传isPCDisplayNumber...
HWH5.share
使用H5微应用JSAPI需要引用资源,查看详细文档
页面内发起分享
请求参数
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| type | String | 是 | IM |
| title | String | 是 | 标题 |
| h5Uri | String | 是 | h5的URL |
| from | String | 是 | string 分享来源 有默认值 |
| desc | String | 否 | 描述 |
| pcUri | String | 否 | pc的URL;isPCDisplya 值为 1 的时候必传 |
| isPCDisplay | Number | 否 | 是否在pc显示分享消息 1:显示 0:不显示 |
| iconURL | String | 否 | string 分享图标 |
返回说明
调起IM分享的页面
请求示例
ES6版本
const _shareParams = {
title: 'title share',
desc: 'desc share-01',
h5Uri: 'h5://link.h5demo/html/index.html',
pcUri: 'http://xxx.xxx.com/km/m/hi/bloglist/cn',
isPCDisplay: 1,
iconURL: 'https://xxx.xxx.com/xxx/xxx.jpg', from: 'link'
};
HWH5.share({
type: 'IM',
data: _shareParams
}).catch(error => { console.log('分享发生异常', error);
});ES5版本
var _shareParams = {
title: 'title share',
desc: 'desc share-01',
h5Uri: 'h5://link.h5demo/html/index.html',
pcUri: 'http://xxx.xxx.com/km/m/hi/bloglist/cn',
isPCDisplay: 1,
iconURL: 'https://xxx.xxx.com/xxx/xxx.jpg', from: 'link'
};
HWH5.share({
type: 'IM',
data: _shareParams
}).catch(function (error) { console.log('分享发生异常', error);
});
【版权声明】本文为华为云社区用户原创内容,未经允许不得转载,如需转载请自行联系原作者进行授权。如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱:
cloudbbs@huaweicloud.com
- 点赞
- 收藏
- 关注作者
评论(0)