胡博君简单总结JS中的分享到代码

页面导航:首页 > 网络编程 > JavaScript > 胡博君简单总结JS中的分享到代码

胡博君简单总结JS中的分享到代码

来源: 作者: 时间:2016-02-04 09:15 【

var shareData = {sTitle: Let 39;s go! ,sDesc: 我的牙都酸倒啦,sContent: 你还等什么!!!,sImgurl: ,sLink: ,sCallback: http: mp weixin qq com s?__biz=MjM5NDE0MTEyNg==mid=20148806
var shareData = {
sTitle: Let's go! ,
sDesc: 我的牙都酸倒啦,
sContent: 你还等什么!!!,
sImgurl: ,
sLink: ,
sCallback: http://mp.weixin.qq.com/s?__biz=MjM5NDE0MTEyNg==&mid=201488063&idx=1&sn=1ad91eb4dc1627fc0c8027e6472d646d#rd
};
document.addEventListener(WeixinJSBridgeReady,

function() {

//分享给朋友

WeixinJSBridge.on(menu:share:appmessage,
function(a) {
var b = shareData.sDesc.replace(/(s)+/g, );
if (userScore > 0) {
b += ,求超越!
}
WeixinJSBridge.invoke(sendAppMessage, {
img_url: shareData.sImgurl,
link: shareData.sLink,
desc: b,
title: shareData.sTitle
},
function(c) {
document.location.href = shareData.sCallback
})

});

//分享到朋友圈

WeixinJSBridge.on(menu:share:timeline,
function(a) {
var b = shareData.sContent.replace(/(s)+/g, );
if (userScore > 0) {
b = shareData.sDesc.replace(/(s)+/g, );
b += ,求超越!
}
WeixinJSBridge.invoke(shareTimeline, {
img_url: shareData.sImgurl,
img_width: 100,
img_height: 100,
link: shareData.sLink,
desc: b,
content: b,
title: b
},
function(c) {
document.location.href = shareData.sCallback
})

});

//分享到微博

WeixinJSBridge.on(menu:share:weibo,
function(a) {
WeixinJSBridge.invoke(shareWeibo, {
content: shareData.sDesc,
url: shareData.sLink
},
function(b) {
document.location.href = shareData.sCallback
})
})
},

false);

 

 

 

 

Tags:

文章评论

最 近 更 新
热 点 排 行
Js与CSS工具
代码转换工具

<