
# 分享
**HWH5.share**
[支持版本\>=10.0.2](https://open.welink.huaweicloud.com/docs/#/990hh0/whokyc/fa5obu)
We码小程序可以调用IM分享功能，进行分享。
扫码体验：
![](https://support.huaweicloud.com/devg-welink/figure/zh-cn_image_0000001347274124.png "点击放大")
#### 请求参数
| **参数**      | **类型** | **必填** | **说明**                          |
|:---|:---|:---|:---|
| type        | String | 是      | 类型                              |
| title       | String | 是      | 标题                              |
| h5Uri       | String | 是      | h5的Uri                          |
| from        | String | 是      | 分享来源                            |
| desc        | String | 否      | 描述                              |
| pcUri       | String | 否      | PC的Uri。isPCDisplya值为1时，该参数为必传参数 |
| isPCDisplay | Number | 否      | 是否在PC显示分享消息。1：显示，0：不显示          |
| iconURL     | 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);
  });
```
