<script type="text/javascript">
$(function()
{
if ($('.aw-mod-body img').first().attr('src') == ''){
var weixin_img_url =location.protocol+'//'+location.host+'/static/common/weixin_default_logo.jpg';
}else{
var weixin_img_url = $('.aw-mod-body img').first().attr('src'),
weixin_img_first = $('.aw-mod-body img').first().attr('src').replace(/(.[i]\/){0,}([^\.]+.[/i])/ig, "$2");
var weixin_img_url = weixin_img_url.replace(weixin_img_first,'90x90_'+weixin_img_first);
}
// 判断是否微信打开
if (typeof G_IN_WEIXIN != 'undefined' && G_IN_WEIXIN == true)
{
$('header, nav, footer').hide();
var weixin_handler = setInterval(function()
{
if (typeof G_IN_WEIXIN != 'undefined' && G_IN_WEIXIN == true)
{
if (WEIXIN_APP_ID == ''){ //不支持开放平台
WeixinJSBridge.on('menu:share:appmessage', function(argv) {
WeixinJSBridge.invoke('sendAppMessage', {
"img_url":weixin_img_url,
"title" : document.title,
"link" : location.href,
"desc" : ($('#weixin-desc').text()=='')?document.description:$('#weixin-desc').text()
});
});
WeixinJSBridge.on('menu:share:timeline', function(argv) {
WeixinJSBridge.invoke('shareTimeline', {
"img_url":weixin_img_url,
"title" : document.title,
"link" :location.href,
"desc" :($('#weixin-desc').text()=='')?document.description:$('#weixin-desc').text()
});
});
}else{ //支持开放平台
WeixinJSBridge.on('menu:share:timeline', function(argv) {
WeixinJSBridge.invoke('shareTimeline', {
"title" : document.title,
"link" : 'https://open.weixin.qq.com/connect/oauth2/authorize?appid=' + WEIXIN_APP_ID + '&redirect_uri=' + encodeURIComponent(G_BASE_URL + '/m/weixin/redirect/?redirect=' + $.base64.encode(location.href)) + '&response_type=code&scope=snsapi_userinfo&state=OAUTH#wechat_redirect',
"description" : document.description
});
});
WeixinJSBridge.on('menu:share:appmessage', function(argv) {
WeixinJSBridge.invoke('sendAppMessage', {
"title" : document.title,
"link" : 'https://open.weixin.qq.com/connect/oauth2/authorize?appid=' + WEIXIN_APP_ID + '&redirect_uri=' + encodeURIComponent(G_BASE_URL + '/m/weixin/redirect/?redirect=' + $.base64.encode(location.href)) + '&response_type=code&scope=snsapi_userinfo&state=OAUTH#wechat_redirect',
"description" : document.description
});
});
}
clearInterval(weixin_handler);
}
}, 500);
}
});
</script>
这家伙很懒,还没有设置简介