(function(){function r(a){for(var t=document.cookie,n=t.split("; "),e=0;e-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").replace(".jpg","!small.jpg").replace(".jpeg","!small.jpeg")||"https://static.wxbig.cn"+t||"https://static.wxbig.cn"+$(".courseWareIntroduceBox img").eq(0).attr("src");i=o}location.pathname.indexOf("portal/form")>-1&&(n=$(".formTitle").text()||document.title,e=$(".formDesc").text()||""),$(".shareDesc").length>0&&(e=$(".shareDesc").text()),i.indexOf("http")<0&&(i="https:"+i),i||(i=location.origin+"/common/favicon.png"),wx.updateAppMessageShareData({title:n,desc:e,link:location.href,imgUrl:i,success:function(){}}),wx.updateTimelineShareData({title:n,link:location.href,imgUrl:i,success:function(){}})})}};window.hrefChangeShare=l,$(document).ready(function(){setTimeout(function(){f||l.init()},300)})}})();