import UniShare from './uni-share/js_sdk/uni-share.js' const uniShare = new UniShare() const fenxiang = async (title, url, descript, imgUrl, type = 0) => { //#ifdef APP uniShare.show({ content: { //公共的分享类型(type)、链接(herf)、标题(title)、summary(描述)、imageUrl(缩略图) type: type, href: url, title: title, summary: descript, imageUrl: imgUrl + '?x-oss-process=image/resize,m_fill,h_100,w_100' //压缩图片解决,在ios端分享图过大导致的图片失效问题 }, menus: [{ "img": "static/ddk/app-plus/sharemenu/wechatfriend.png", "text": "微信朋友", "share": { "provider": "weixin", "scene": "WXSceneSession" } }, { "img": "static/ddk/app-plus/sharemenu/wechatmoments.png", "text": "微信朋友圈", "share": { "provider": "weixin", "scene": "WXSceneTimeline" } }, { "img": "static/ddk/app-plus/sharemenu/weibo.png", "text": "微博", "share": { "provider": "sinaweibo" } }, { "img": "static/ddk/app-plus/sharemenu/qq.png", "text": "QQ", "share": { "provider": "qq" } }, { "img": "static/ddk/app-plus/sharemenu/copyurl.png", "text": "复制", "share": "copyurl" }, { "img": "static/ddk/app-plus/sharemenu/more.png", "text": "系统分享", "share": "shareSystem" } ], cancelText: "取消", }, e => { //callback console.log(e); }) //#endif } export { fenxiang }