wx.config(config);
wx.error(function (res) {
let errmsg = ‘’;
try {
errmsg = JSON.stringify(res);
} catch (e) { }
//接口超时打点
window.alarm && window.alarm({
errmsg: ‘config error:’ + errmsg,
errno: ‘WECHATAPI_ERROR’
});
})
wx.ready(function () {
var shareData = {
title: document.title,
desc: …,
link: location.href,
imgUrl: img,
success: function () {
…
},
fail: function (res) {
let errmsg = ‘’;
try {
errmsg = JSON.stringify(res);
} catch (e) { }
window.alarm && window.alarm({
errmsg: ‘share fail:’ + errmsg,
errno: ‘WECHATAPI_ERROR’
});
}
};
wx.onMenuShareAppMessage(shareData);
wx.onMenuShareTimeline(shareData);
wx.onMenuShareQQ(shareData);
wx.onMenuShareWeibo(shareData);
wx.onMenuShareQZone(shareData);
});
wx.error放在ready前 ready后都无效
安卓版本:10