1.0.3 • Published 4 years ago
shareforjiyun v1.0.3
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,
});
}