Authored by 邱骏

增加小程序对应分享

... ... @@ -446,8 +446,6 @@ class featureModel extends global.yoho.BaseModel {
}
}
console.log(f.component);
if (componentType === 'share') { // 分享模板
f.component[0].webShare = data.webShare;
if (f.component[0].share_template_id) {
... ...
/* global wx */
const $ = require('yoho-jquery');
const lazyLoad = require('js/plugin/lazyload');
const Swiper = require('yoho-swiper');
... ... @@ -213,19 +214,31 @@ function initWxShare(data) {
}
};
if (window.wx) {
if (wx) {
setTimeout(function() {
window.wx.ready(function() {
window.wx.onMenuShareAppMessage(shareData);
wx.onMenuShareAppMessage(shareData);
window.wx.onMenuShareTimeline(shareData);
wx.onMenuShareTimeline(shareData);
window.wx.onMenuShareQQ(shareData);
wx.onMenuShareQQ(shareData);
window.wx.onMenuShareWeibo(shareData);
wx.onMenuShareWeibo(shareData);
});
}, 500);
if (isWechatMiniProgram) {
wx.miniProgram.postMessage({
data: {
title: data.title,
imgUrl: data.imgUrl,
link: data.link
}
});
}
}
// yo_sdk.wxShare(shareData);
}
... ...