http3a2f2fm.5888.tv2fqiyeku2fwljyl2fpro2f1219520.html var wx_title, wx_desc, wx_link, wx_img; $(document).ready(function(){ if(typeof(wx_title) == "undefined"){ wx_title = document.title; wx_title = wx_title.replace("_火爆食品饮料招商网【5888.TV】","").replace("-火爆食品饮料招商网【5888.TV】","");} if(wx_title == "" || typeof(wx_title) == "undefined"){ wx_title = "火爆食品饮料招商网【5888.TV】"; } //title和自定义都未设定时,默认 if(typeof(wx_desc) == "undefined"){ wx_desc = $('meta[name="description"]').attr("content"); } //未设定时,自动取description if(wx_desc == "" || typeof(wx_desc) == "undefined"){ wx_desc = wx_title } //description和自定义都未设定时,默认为title if(typeof(wx_link) == "undefined"){ wx_link = location.href.split('#')[0]; } //链接都未设定时,自动取本页地址 if(wx_link == "" || typeof(wx_link) == "undefined"){ wx_link = "http://m.5888.tv" } if(typeof(wx_img) == "undefined"){ wx_img = $(".content img").attr("src"); } //未设定时,取新闻第1张图 if(wx_img == "" || typeof(wx_img) == "undefined"){ wx_img = $("body img").attr("src"); } //没有新闻,取body第1张图 try{if(wx_img.substr(0,4) != "http"){ wx_img=""; }}catch(e){} //取消非全路径 if(wx_img == "" || typeof(wx_img) == "undefined"){ wx_img = "http://m.5888.tv/images/wxlogo.jpg" } //空时默认图 $.getScript("https://res.wx.qq.com/open/js/jweixin-1.6.0.js", function(){runwx();}); }); //document.write(''); function runwx(){ wx.config({ debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。 appId: 'wx58d0c7b1a3bd76f9', // 必填,公众号的唯一标识 timestamp: '1739887793', // 必填,生成签名的时间戳 nonceStr: '967688', // 必填,生成签名的随机串 signature: 'da7cdeb66ed3eae2765da6870bfcb4f6575ca78b', // 必填,签名,见附录1 jsApiList: ['onMenuShareTimeline', 'onMenuShareAppMessage', 'onMenuShareQQ', 'onMenuShareWeibo', 'onMenuShareQZone'] // 必填,需要使用的JS接口列表,所有JS接口列表见附录2 }); wx.ready(function () { wx.onMenuShareTimeline({ title: wx_title, // 分享标题 link: wx_link, // 分享链接 imgUrl: wx_img, // 分享图标 success: function () {}, cancel: function () {}, fail: function (res) { alert(1); } }); wx.onMenuShareAppMessage({ title: wx_title, // 分享标题 desc: wx_desc, // 分享描述 link: wx_link, // 分享链接 imgUrl: wx_img, // 分享图标 type: '', // 分享类型,music、video或link,不填默认为link dataUrl: '', // 如果type是music或video,则要提供数据链接,默认为空 success: function () {}, cancel: function () {}, fail: function (res) { alert(1); } }); wx.onMenuShareQQ({ title: wx_title, // 分享标题 desc: wx_desc, // 分享描述 link: wx_link, // 分享链接 imgUrl: wx_img, // 分享图标 success: function () {}, cancel: function () {} }); wx.onMenuShareWeibo({ title: wx_title, // 分享标题 desc: wx_desc, // 分享描述 link: wx_link, // 分享链接 imgUrl: wx_img, // 分享图标 success: function () {}, cancel: function () {} }); wx.onMenuShareQZone({ title: wx_title, // 分享标题 desc: wx_desc, // 分享描述 link: wx_link, // 分享链接 imgUrl: wx_img, // 分享图标 success: function () {}, cancel: function () {} }); }); }