shareforjiyun

1.0.3 • Public • Published

shareforjiyun

使用方法概览

  • 添加shareforjiyun npm 依赖:cnpm install shareforjiyun --save
  • 项目中引入:import shareHandle from 'shareforjiyun' (shareHandle自定义)
    • shareHandle对象下有两个方法
      • shareHandle.wxShare(obj)方法用于微信分享
      • shareHandle.leadeonShare(obj)方法用于一级手厅分享
        //obj参数示例
        const obj = {
          title: '分享标题',
          desc: '分享描述',
          link: '分享链接',
          imgUrl: '分享图标',
          content: '分享内容'  
        }
        //必传键值对请参考代码案例
      

使用依赖

  • shareHandle.wxShare(obj)方法依赖axios请求
  • shareHandle.leadeonShare(obj)方法依赖leadeon(一级手厅jdk)

代码案例

import axios from "axios";
if (getIsWeixin()) {  //微信对应环境
  //微信二次分享 
  shareHandle.wxShare({
    title: shareTitle,
    desc: shareDescription,
    imgUrl: sharePictureUrl,
    link: shareRedirectUrl_para,
  });
}
if (getIsApp()) {  //手厅对应环境
  //一级手厅分享
  shareHandle.leadeonShare({
    title: shareTitle,
    link: shareRedirectUrl_para,
    imgUrl: sharePictureUrl,
    content: shareDescription,
  });
}

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.0.31latest

Version History

VersionDownloads (Last 7 Days)Published
1.0.31
1.0.20
1.0.10
1.0.00

Package Sidebar

Install

npm i shareforjiyun

Weekly Downloads

1

Version

1.0.3

License

ISC

Unpacked Size

7.15 kB

Total Files

4

Last publish

Collaborators

  • zhengxueqi