function nowUrl(){
var a = window.location.href;
var b = a.split('//')[1].split('/');
var c = b.length-1;
var d = b[c];
return a.replace(d,'');
}
function wx_init_refresh(){
if(!isWx()) return;
var _preUrl=nowUrl();
var shareLink=_preUrl+'index.html';
var _imgUrl=_preUrl+'images/share-logo.jpg';//分享logo
var shareUrl_p=window.location.href;
var obj = sign(localStorage.getItem("ticket"), shareUrl_p);
wx.config({
debug: false,
appId: 'wxd7fc6660f09f82c9',
timestamp: obj.timestamp,
nonceStr: obj.nonceStr,
signature: obj.signature,
jsApiList: [
'onMenuShareTimeline',
'onMenuShareAppMessage'
]
});
wx.ready(function () {
//runajax();
var imgUrl = _imgUrl;
var shareTitle = "居然擦身而过,不服再战!";
var descContent = "哎呀,一定是姿势不对。换个手指试试!";
var lineLink = shareLink;
runfun(function () {
wx.onMenuShareAppMessage({
title: shareTitle,
desc: descContent,
link: lineLink,
imgUrl: imgUrl,
success: function () {
//location.href=nowUrl()+'success.html';
},
cancel: function () { }
});
})
runfun(function () {
wx.onMenuShareTimeline({
title: shareTitle,
link: lineLink,
imgUrl: imgUrl,
success: function () {
//location.href=nowUrl()+'success.html';
},
cancel: function () { }
});
});
});
wx.error(function (res) {
init_runwx();
});
}
上一篇>>微信网页调试办法
下一篇>>使用谷歌chrome浏览器伪装微信浏览器
Copyright © 2016 Allister All Rights Reserved