UNPKG

orcrist-wechat

Version:

for Orcrist Wechat sdk

28 lines (23 loc) 495 B
/** * ready 中执行 但为了方便动态修改 开放share api * @param opt * @param success */ export const share = (opt, success = () => {}) => { const w: any = window; const friendsOpt = { title: opt.title, link: opt.link, imgUrl: opt.imgUrl, success, }; const cfg = { ...opt, type: "link", dataUrl: "", success, }; w.wx.onMenuShareTimeline(friendsOpt); // 朋友圈 w.wx.onMenuShareAppMessage(cfg); // 朋友 }; export default share;