filesbox/web/dist/design/designstatic/common/js/wxConfig.js

2 lines
4.7 KiB
JavaScript
Raw Permalink Normal View History

2024-07-26 06:10:54 +00:00
(function(){function r(a){for(var t=document.cookie,n=t.split("; "),e=0;e<n.length;e++){var i=n[e].split("=");if(i[0]==a)return i[1]}return""}if(window.$){var f=window.frames.length!=parent.frames.length,l={init:function(){var a=this,t="wx1ae69c2e8734dd28";if(cdnPath=="//pre-static.1x.cn"&&(t="wx1ae69c2e8734dd28"),cdnPath=="//static.wxbig.cn"&&(t="wx1ae69c2e8734dd28"),(location.hostname=="zdb.xx.cn"||location.hostname=="hxyx.xx.cn"||location.hostname=="book.xx.cn")&&(t="wx4eb245aa9fa3d680"),window.wxconfigappid=t,window.wxconfigappid){var n={appId:window.wxconfigappid,currentUrl:location.href.split("#")[0]};a.getSignature(n,function(e){window.wx&&(wx.config({debug:location.search.indexOf("isdebug=1")>-1,appId:n.appId,timestamp:e.timestamp,nonceStr:e.nonceStr,signature:e.signature,jsApiList:["updateAppMessageShareData","updateTimelineShareData","getUserInfo"],openTagList:["wx-open-launch-weapp"]}),(location.pathname==""||location.pathname=="/"||location.pathname.indexOf("shtml")>-1||location.pathname.indexOf("bundle.html")>-1||location.pathname.indexOf("info.html")>-1||location.pathname.indexOf("audition.html")>-1||location.pathname.indexOf("information.html")>-1||location.href.indexOf("/information/")>-1&&location.href.indexOf(".shtml")>-1||location.href.indexOf("/pubinfo/")>-1&&location.href.indexOf(".html")>-1)&&a.ShareHome())})}else $.ajax({headers:{token:r("token")},type:"GET",url:"/api/welink/wechat/qrCode/params",data:{envTypeName:"page",sceneTypeName:location.href.indexOf("scale-h5server")>-1?"ce_ping":"consulting",redirectUrl:encodeURIComponent(decodeURIComponent(location.href))},dataType:"json",async:!1,success:function(e){if(e.code==200&&e.success){var i=e.data||{},c={appId:i.appid,currentUrl:location.href.split("#")[0]};window.wxconfigappid=i.appid,a.getSignature(c,function(o){window.wx&&(wx.config({debug:location.search.indexOf("isdebug=1")>-1,appId:c.appId,timestamp:o.timestamp,nonceStr:o.nonceStr,signature:o.signature,jsApiList:["updateAppMessageShareData","updateTimelineShareData","getUserInfo"],openTagList:["wx-open-launch-weapp"]}),(location.pathname==""||location.pathname=="/"||location.pathname.indexOf("shtml")>-1||location.pathname.indexOf("bundle.html")>-1||location.pathname.indexOf("info.html")>-1||location.pathname.indexOf("audition.html")>-1||location.pathname.indexOf("information.html")>-1||location.href.indexOf("/information/")>-1&&location.href.indexOf(".shtml")>-1||location.href.indexOf("/pubinfo/")>-1&&location.href.indexOf(".html")>-1)&&a.ShareHome())})}}})},getSignature:function(a,t,n){$.ajax({type:"get",headers:{token:r("token")},url:"/api/welink/getSignature",contentType:"application/json;charset=utf-8",dataType:"json",data:a,success:function(e){t&&t(e)},error:function(e){n&&n(e)}})},ShareHome:function(){var a=window.roominfo||{};wx.ready(function(){var t=a.logo||"",n=a.schoolName,e=a.introduction,i=t?t.indexOf("http")>-1?t||"":location.origin+t:"";if(location.pathname.indexOf("shtml")>-1&&(n=$("[sharetitle]").attr("sharetitle")||document.title,e=$("[data-type=text] .box").eq(0).text(),i=$("img").eq(0).attr("src")),location.pathname.indexOf("bundle.html")>-1||location.pathname.indexOf("info.html")>-1||location.pathname.indexOf("audition.html")>-1){var c=$(".curfeng img").attr("src")||"",o=c.replace(".png","!small.png").replace(".jpg","!small.jpg").replace(".jpeg","!small.jpeg")||"https://static.wxbig.cn"+t||"https://static.wxbig.cn"+$(".courseWareIntroduceBox img").eq(0).attr("src");n=$(".touspe").text()||document.title,e=$(".cursimp").text(),i=o}if((location.pathname.indexOf("information.html")>-1||location.href.indexOf("/information/")>-1&&location.href.indexOf(".shtml")>-1||location.href.indexOf("/pubinfo/")>-1&&location.href.indexOf(".html")>-1)&&(n=$(".inforht").text()||$(".swiper-slide-active .infotitle").text()||document.title,e=$(".swiper-slide-active .infointroducetext").text()||$(".coursemain").text()),location.pathname.indexOf("ware.html")>-1){n=$(".inforht").text()||document.title,e=$(".coursemain").text();var c=$(".curfeng img").attr("src")||"",o=c.replace(".png","!small.png