ok.setShareOptions(Object object)

基础库2.0.0开始支持

该方法仅适用于H5应用

设置分享选项内容

参数

Object object

属性 类型 默认值 必填 说明
title string 是 分享主题
desc string 是 分享描述
link string 是 分享链接
imgUrl string 是 分享图标
type string 'link' 否 分享类型
dataUrl string 否 当type值是music或video时,则要提供数据链接
shareType string 否 分享落地类型,默认为 timeline

object.type的合法值

属性 类型 说明
music string 音乐
video string 视频
link string 链接

object.shareType 的合法值

属性 类型 说明
timeline string 朋友圈
chatWindow string 聊天窗口

示例代码

ok.setShareOptions({
title: '邀你抢先体验天翼云盘免费会员!',
desc: '享4T个人云空间+2T家庭云空间,及高速传输等8大特权!',
link: 'https://m.cloud.189.cn/zhuanti/2018/limitfree/index.html',
imgUrl: 'https://m.cloud.189.cn/zhuanti/2018/limitfree/img/share_weixin.jpg', // 分享图标
type: '',
dataUrl: '',
shareType: 'chatWindow'
});
  1. 1. ok.setShareOptions(Object object)
    1. 1.1. 参数
      1. 1.1.1. object.type的合法值
      2. 1.1.2. object.shareType 的合法值
    2. 1.2. 示例代码