分享部分代码如下:
var shareMsg = {
title: taskName,
content: userName+"同学的作业情况",
href: shareHref,
extra:{
scene:""
},
thumbs:["images/icon.png"],
pictures:["images/icon.png"]
}
if(tag === "WXSceneTimeline"){
var value = shareMsg.title+" "+shareMsg.content;
shareMsg.title = value;
shareMsg.content = value;
}
shareMsg.extra.scene = tag;
console.log("shareMsg = " + JSON.stringify(shareMsg));
shareAction(share, shareMsg);
})
function shareAction(share, shareMsg) {
if(!share) {
toastMsg("无效的分享服务!");
return;
}
if(share.authenticated) {
// toastMsg("---已授权---");
shareMessage(share, shareMsg);
} else {
toastMsg("未授权");
share.authorize(function() {
shareMessage(share, shareMsg);
}, function(e) {
toastMsg("认证授权失败!");
});
}
}
function shareMessage(share, shareMsg) {
share.send(shareMsg, function() {
toastMsg("分享到" + share.description + "成功! ");
}, function(e) {
toastMsg("分享到" + share.description + "失败! ");
});
}
iOS离线配置文件根据5+离线插件配置,进行配置。
之前都可以分享,突然出现这个情况
0 个回复