更新时间:2022-12-29 GMT+08:00
定制导航分享
HWH5.addEventListener
可以设置导航栏分享的内容,可将We码分享到群组或个人,若对分享内容不做任何设置则分享默认内容。
请求参数
参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
title | String | 否 | 标题,默认为We码名称 |
desc | String | 否 | 简介或副标题,默认为We码在开放平台的简介 |
h5Uri | String | 是 | 分享后移动端打开的链接,默认为plugin.json的indexURL |
pcUri | String | 是 | 分享后PC端打开的链接 |
isPCDisplay | Number | 是 | 是否需要在PC端espace显示分享消息,1:显示 0:不显示,默认为0 |
iconURL | String | 是 | 分享图标,默认为We码logo |
from | String | 否 | 内容来源;默认为“We码” |
返回说明
无。
请求示例
- ES6版本
HWH5.removeEventListenerByType('share'); HWH5.addEventListener({ type: 'share', func: () => ({ title: '公司公告', desc: 'xxx', h5Uri: 'h5://xxxxx/html/index.html', pcUri: 'www.baidu.com', isPCDisplay: 1, iconURL: 'xxx.jpg', from: 'welink' }) });
- ES5版本
HWH5.removeEventListenerByType('share'); HWH5.addEventListener({ type: 'share', func: function() { return { title: '公司公告', desc: 'xxx', h5Uri: 'h5://xxxxx/html/index.html', pcUri: 'www.baidu.com', isPCDisplay: 1, iconURL: 'xxx.jpg', from: 'welink' } } });
父主题:开放接口

