锘?/*** onpageshow鏃惰皟鐢紝閬垮厤iphone浠庣紦瀛樺彇椤甸潰涓嶆墽琛岃剼鏈殑闂****************** function doWxInit() { ; if (_json_base.IsInited == false) { _json_base.IsInited = true; if (_json_base.IsWxNews) { wx.config({ debug: false, appId: _json_base.appId, timestamp: _json_base.timestamp, nonceStr: _json_base.nonceStr, signature: _json_base.signature, jsApiList: [ 'updateAppMessageShareData', 'updateTimelineShareData' ] }); wx.error(function (res) { _json_base.msg += '|' + res.errMsg; }); wx.ready(function () { //鍒嗕韩缁欐湅鍙嬪拰QQ濂藉弸 wx.updateAppMessageShareData({ title: _json_base.shareTitle, desc: _json_base.shareDesc, link: _json_base.shareUrl, imgUrl: _json_base.shareImg, success: function () { _json_base.msg += '|ok1'; } }); //鍒嗕韩缁欐湅鍙嬪湀鍜孮Q绌洪棿 wx.updateTimelineShareData({ title: _json_base.shareTitle, link: _json_base.shareUrl, imgUrl: _json_base.shareImg, success: function () { _json_base.msg += '|ok2'; } }); }); } // myp2c_FormatItemHtml(); myp2c_ViewCount(); } } //************************************* $(function () { doWxInit(); }); function myp2c_FormatItemHtml() { $("iframe,div").each(function () { $(this).css('max-width', '100%'); }); $("img").each(function () { var img = $(this); img.css({ 'max-width': '100%', 'height': 'auto' }); if (img.parents('a').length < 1) { img.wrap(function () { return ""; }); } }); } //鎵撳紑鍥剧墖 function openImg(imgUrl) { myp2c_bs_OpenDlg("鏌ョ湅鍥剧墖", "", 3, '', '', '鍏抽棴绐楀彛', false, false); } //闃呰璁℃暟 function myp2c_ViewCount() { var div = $('#div_viewcount'); div.html('...'); $.ajax({ url: _json_base.SourcePath + "/_wx_home_news_i_ajax.ashx", type: 'POST', data: { action: 'ViewCount', said: _json_base.said, iid: _json_base.iid }, dataType: 'text', cache: false, success: function (result, s, r) { if (result.indexOf('vc:') == 0) { div.html(result.replace('vc:', '')); } else { div.html(_json_base.ViewCount); } }, error: function (r, s, err) { div.html(_json_base.ViewCount); }, complete: function (r, s) { // } }); } //閫氳繃涓婄骇璺冲嚭iframe妗嗘灦 function parentUrl(sUrl) { if (parent.toUrl) { parent.toUrl(sUrl); } else { location.href = sUrl; } }