enableWx = function () {
let options = {
title:"库存分享",
desc:"查看剩余库存",
shareLink:"http://wx.lvmeng-inc.com/#/kucun",
imgUrl:"http://wx.lvmeng-inc.com/favicon.ico"
};
// console.log("options",options)
let opt = U.obj.copy(options);
opt.debug = App.env === 'sandbox' || App.env === 'dev';
opt.link = options.shareLink;
opt.appId = "wx3e67e1a729917a7a"; //GDATA.wxInfo && GDATA.wxInfo.appId;
// 拼接分享链接(异步)
// 将route,shareLink传入
// options.toggleShare && options.toggleShare();
opt.success = function (channel) {
console.log('[======Share======] callback: ', channel, opt);
// 分享成功
// 1. 上报分享
report(opt.link, options.contentType, options.contentId, channel);
// 分享成功,回调业务模块
options.success && options.success(channel);
success()
};
// 微信分享
WechatTools.enableShare(opt);
};
report方法,和success回调方法都不会实现