...
|
...
|
@@ -6,6 +6,20 @@ |
|
|
*/
|
|
|
|
|
|
const $ = require('yoho-jquery');
|
|
|
const jsApiList = [
|
|
|
'checkJsApi',
|
|
|
'onMenuShareTimeline',
|
|
|
'onMenuShareAppMessage',
|
|
|
'onMenuShareQQ',
|
|
|
'onMenuShareWeibo',
|
|
|
'onMenuShareQZone'
|
|
|
];
|
|
|
let shareData = {
|
|
|
title: document.title,
|
|
|
link: location.href,
|
|
|
desc: '我在BLK发现了一个不错的品牌,赶快来看看吧!',
|
|
|
imgUrl: 'http://7xwj52.com1.z0.glb.clouddn.com/brandbg.jpg'
|
|
|
};
|
|
|
|
|
|
if (/MicroMessenger/i.test(navigator.userAgent)) {
|
|
|
$.ajax({
|
...
|
...
|
@@ -26,42 +40,14 @@ if (/MicroMessenger/i.test(navigator.userAgent)) { |
|
|
timestamp: res.timestamp,
|
|
|
nonceStr: res.nonceStr,
|
|
|
signature: res.signature,
|
|
|
jsApiList: [
|
|
|
'checkJsApi',
|
|
|
'onMenuShareTimeline',
|
|
|
'onMenuShareAppMessage',
|
|
|
'onMenuShareQQ',
|
|
|
'onMenuShareWeibo',
|
|
|
'hideMenuItems',
|
|
|
'showMenuItems',
|
|
|
'hideAllNonBaseMenuItem',
|
|
|
'showAllNonBaseMenuItem',
|
|
|
'translateVoice',
|
|
|
'startRecord',
|
|
|
'stopRecord',
|
|
|
'onRecordEnd',
|
|
|
'playVoice',
|
|
|
'pauseVoice',
|
|
|
'stopVoice',
|
|
|
'uploadVoice',
|
|
|
'downloadVoice',
|
|
|
'chooseImage',
|
|
|
'previewImage',
|
|
|
'uploadImage',
|
|
|
'downloadImage',
|
|
|
'getNetworkType',
|
|
|
'openLocation',
|
|
|
'getLocation',
|
|
|
'hideOptionMenu',
|
|
|
'showOptionMenu',
|
|
|
'closeWindow',
|
|
|
'scanQRCode',
|
|
|
'chooseWXPay',
|
|
|
'openProductSpecificView',
|
|
|
'addCard',
|
|
|
'chooseCard',
|
|
|
'openCard'
|
|
|
]
|
|
|
jsApiList: jsApiList
|
|
|
});
|
|
|
window.wx.ready(function() {
|
|
|
window.wx.onMenuShareAppMessage(shareData);
|
|
|
window.wx.onMenuShareTimeline(shareData);
|
|
|
window.wx.onMenuShareQQ(shareData);
|
|
|
window.wx.onMenuShareWeibo(shareData);
|
|
|
window.wx.onMenuShareQZone(shareData);
|
|
|
});
|
|
|
}
|
|
|
}
|
...
|
...
|
@@ -69,13 +55,14 @@ if (/MicroMessenger/i.test(navigator.userAgent)) { |
|
|
}
|
|
|
});
|
|
|
}
|
|
|
module.exports = (shareData) => {
|
|
|
module.exports = (data) => {
|
|
|
shareData = data;
|
|
|
|
|
|
if (window.wx) {
|
|
|
window.wx.ready(function() {
|
|
|
window.wx.onMenuShareAppMessage(shareData);
|
|
|
window.wx.onMenuShareTimeline(shareData);
|
|
|
window.wx.onMenuShareQQ(shareData);
|
|
|
window.wx.onMenuShareWeibo(shareData);
|
|
|
});
|
|
|
window.wx.onMenuShareAppMessage(shareData);
|
|
|
window.wx.onMenuShareTimeline(shareData);
|
|
|
window.wx.onMenuShareQQ(shareData);
|
|
|
window.wx.onMenuShareWeibo(shareData);
|
|
|
window.wx.onMenuShareQZone(shareData);
|
|
|
}
|
|
|
}; |
...
|
...
|
|