1(function ($) { 2 var appId, 3 timeStamp, 4 nonceStr, 5 signature, 6 imgUrl, 7 title, 8 desc; 9 10 if (isWeiXinBrowser()) { 11 getWeixinShareParameters(); 12 } 13 14 function setImgUrl() { 15 imgUrl = $('meta[name="Image"]').attr("content"); 16 } 17 18 function setTitle() { 19 title = $('meta[name="ArticleTitle"]').attr('content'); 20 } 21 22 function setDesc() { 23 title = $('meta[name="description"]').attr('content'); 24 } 25 26 function getWeixinShareParameters() { 27 setImgUrl(); 28 setTitle(); 29 setDesc(); 30 if (imgUrl || title || desc) { 31 $.ajax({ 32 type: "get", 33 url: "/weixin/home/AjaxGetWeixinShareParameters", 34 dataType: 'json', 35 async: false, 36 data: { currentUrl: window.location.href }, 37 success: function (data) { 38 if (data !== false) { 39 appId = data.appId; 40 timeStamp = data.timestamp; 41 nonceStr = data.nonceStr; 42 signature = data.signature; 43 setWxConfig(); 44 } 45 } 46 }); 47 } 48 } 49 50 function setWxConfig() { 51 wx.config({ 52 debug: false, // å¼å¯è°è¯æ¨¡å¼,è°ç¨çææapiçè¿åå¼ä¼å¨å®¢æ·ç«¯alertåºæ¥ï¼è¥è¦æ¥çä¼ å ¥çåæ°ï¼å¯ä»¥å¨pc端æå¼ï¼åæ°ä¿¡æ¯ä¼éè¿logæåºï¼ä» å¨pcç«¯æ¶æä¼æå°ã 53 appId: appId, // å¿ å¡«ï¼å ¬ä¼å·çå¯ä¸æ è¯ 54 timestamp: timeStamp, // å¿ å¡«ï¼çæç¾åçæ¶é´æ³ 55 nonceStr: nonceStr, // å¿ å¡«ï¼çæç¾åçéæºä¸² 56 signature: signature, // å¿ å¡«ï¼ç¾å 57 jsApiList: [ 58 "checkJsApi", 59 'onMenuShareTimeline', 60 'onMenuShareAppMessage', 61 'onMenuShareQQ', 62 'onMenuShareWeibo', 63 'hideMenuItems', 64 'showMenuItems', 65 'hideAllNonBaseMenuItem', 66 'showAllNonBaseMenuItem', 67 'translateVoice', 68 'startRecord', 69 'stopRecord', 70 'onRecordEnd', 71 'playVoice', 72 'pauseVoice', 73 'stopVoice', 74 'uploadVoice', 75 'downloadVoice', 76 'chooseImage', 77 'previewImage', 78 'uploadImage', 79 'downloadImage', 80 'getNetworkType', 81 'openLocation', 82 'getLocation', 83 'hideOptionMenu', 84 'showOptionMenu', 85 'closeWindow', 86 'scanQRCode', 87 'chooseWXPay', 88 'openProductSpecificView', 89 'addCard', 90 'chooseCard', 91 'openCard' 92 ] 93 }); 94 95 wx.error(function (res) { 96 console.log(res); 97 console.warn('微信éªè¯å¤±è´¥ï¼å享åè½æ æ³æ£å¸¸ä½¿ç¨ï¼'); 98 }); 99 100 wx.ready(function () { 101 wx.onMenuShareTimeline({ 102 title: title, 103 desc: desc, 104 imgUrl: imgUrl 105 }); 106 107 wx.onMenuShareAppMessage({ 108 title: title, 109 desc: desc, 110 imgUrl: imgUrl 111 }); 112 }); 113 } 114 115 function isWeiXinBrowser() { 116 var userAgent = window.navigator.userAgent.toLowerCase(); 117 if (userAgent.match(/MicroMessenger/i) == 'micromessenger') { 118 return true; 119 } else { 120 return false; 121 } 122 } 123})(jQuery);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.