HWH5.share

使用H5轻应用JSAPI需要引用资源,查看详细文档

页面内发起分享

请求参数

参数 类型 必填 说明
type String 是 IM
title String 是 标题
h5Uri String 是 h5的URL
from String 是 string 分享来源 有默认值
desc String 否 描述
pcUri String 否 pc的URL
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',
    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',
    iconURL: 'https://xxx.xxx.com/xxx/xxx.jpg',
    from: 'link'
  };

  HWH5.share({
    type: 'IM',
    data: _shareParams
  }).catch(function (error) {
    console.log('分享发生异常', error);
  });

结果。 ""

    无结果。 ""