filesbox/web/dist/design/designstatic/common/js/shareproduct.js
2024-07-26 14:10:54 +08:00

2 lines
40 KiB
JavaScript

(function(i,y){y.imgEditor={getShareImg:function(r,p){i.ajax({type:"post",headers:{token:getCookie("token")},url:"/api/common/getShareImage",contentType:"application/json;charset=utf-8",dataType:"json",data:JSON.stringify(r),success:function(a){p&&p(a)},error:function(a){layer.open({content:"\u751F\u6210\u56FE\u7247\u5931\u8D25\uFF01",btn:"\u786E\u5B9A"})}})},getTypeList:function(r,p,a){i.ajax({type:"get",headers:{token:getCookie("token")},url:"/api/common/getPicClassify?projectid=45",contentType:"application/json",dataType:"json",data:{classifyType:3,isPrivate:r},success:function(e){p&&p(e)},error:function(e){a&&a(res)}})},getPicList:function(r,p,a,e){var v;p?v={isPrivate:p,isBackPic:p}:v={classifyId:r,isBackPic:p},i.ajax({type:"get",headers:{token:getCookie("token")},url:"/api/common/getClassifyPic?projectid=45",contentType:"application/json",dataType:"json",data:v,success:function(u){a&&a(u)},error:function(u){e&&e(res)}})}},y.imgEditor.sharekj=function(r,p,a,e,v){i("html").css("overflow","hidden"),i("body").css({height:"100vh",overflow:"hidden"});var u=this,f="",x=r,g=function(){i("html").css("overflow","auto"),i("body").css({height:"auto",overflow:"auto"}),i("#coverModal").remove(),typeof e.closeCoverModalListener=="function"&&e.closeCoverModalListener()};i("html").on("click","#unShareBtn",function(t){g(),t.stopPropagation()}),i("html").on("click","#coverModal,.share-card-container-wrap",function(t){g(),t.stopPropagation()}),i("html").on("click","#picCloseShare",function(t){g(),t.stopPropagation()}),i("html").on("click","#picWillShare",function(t){t.stopPropagation()}),i("html").one("click","#shareToWeChatBtn",function(t){if(localStorage.appAdapt===!0||localStorage.appAdapt==="true"){/iPhone|iPad|iPod/i.test(navigator.userAgent)?window.webkit&&window.webkit.messageHandlers.shareAction.postMessage(null):window.Android&&window.Android.jsCallAndroid();return}var _=window.navigator.userAgent,b="";i("#shareToWechat").remove(),i("#shareFooterBar").remove(),/MicroMessenger/gi.test(_)?b='<div id="shareToWechat"><div style="text-align:right;margin-top: 20px;margin-right: 20px;"><img width="144" height="222" src = "/design/designstatic/front/images/shareToUp.png"/></div><div style="margin-top: 10px;text-align: center;color: #fff;"><p style="font-size:18px">\u7ACB\u5373\u5206\u4EAB\u7ED9\u597D\u53CB\u5427</p><p style="font-size:14px;margin-top: 7px">\u70B9\u51FB\u5C4F\u5E55\u53F3\u4E0A\u89D2\u5C06\u672C\u9875\u5206\u4EAB\u7ED9\u597D\u53CB</p></div></div>':b='<div id="shareToWechat" style="position: absolute;bottom: 100px;width: 100%;"><div style="text-align: center;color: #fff;"><p style="font-size:18px">\u7ACB\u5373\u5206\u4EAB\u7ED9\u597D\u53CB\u5427</p><p style="font-size:14px;margin-top: 7px">\u70B9\u51FB\u9009\u62E9\u5206\u4EAB\u9014\u5F84</p></div><div style="margin-top: 20px;text-align: center"><img width="119" height="245" src = "/design/designstatic/front/images/shareToDown.png"/></div></div>',i("#coverModal").append(b),window.socialShareaddShareLog("wechat1"),reportVisitLog&&reportVisitLog.callaction("03"),t.stopPropagation()}),i("html").one("click","#shareOnPicBtn",function(t){var _="";i("#shareOnPic").remove(),i("#shareFooterBar").remove(),_='<div id="shareOnPic" style="display: flex;justify-content: center;align-items: center;height: 100%;"><div style="position: relative;"><img id="picCloseShare" style="position: absolute;top:-15px;right: -15px;" src="/design/designstatic/front/images/closeBtn.png" width="30" height="30"/><div><img id="picWillShare" width="267" height="467"/></div><div style="margin-top: 10px;text-align: center;color: #fff;"><p style="font-size:14px;margin-top: 7px">\u957F\u6309\u4FDD\u5B58\u56FE\u7247\u81F3\u76F8\u518C</p></div></div></div>',i("#coverModal").append(_),i("#picWillShare").attr("src",f),/Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent)||(window.socialShareaddShareLog("picture"),reportVisitLog&&reportVisitLog.callaction("03")),t.stopPropagation()});function l(t,_){if(t||(t=""),t.length<_)return t;var b=t.substring(0,_-2);return b=b+"...",b}function h(t,_){if(t||(t=""),_==="x"){var b=158;return t.length>5?b=158-7*(t.length-5):b=158+7*(5-t.length),b}else{var T=60;return t.length>5?T=60+13*(t.length-5):T=60-13*(5-t.length),T}}function n(t,_){var b=121;return _==="left"?t.length>5?b=121-7*(t.length-5):b=121+7*(5-t.length):_==="right"&&(t.length>5?b=227+7*(t.length-5):b=227-7*(5-t.length)),b}var s=[],w={code:"background",id:v,width:375,height:667,x:0,y:0,level:0},B={code:"subBackground",width:353,height:396,x:11,y:241,level:1},I;e.courseWareId?I={code:"ware",id:e.courseWareId,width:353,height:199,x:11,y:43,level:1}:e.shopId?I={code:"shop",id:e.shopId,width:353,height:199,x:11,y:43,level:1}:I={code:"course",id:e.userInfo.cid,width:353,height:199,x:11,y:43,level:1};var m={code:"block",width:3,height:18,color:"D04165",x:32,y:270,level:2},z={code:"courseIntroduce",width:283,height:116,x:46,y:269,level:2,font:"\u5FAE\u8F6F\u96C5\u9ED1",size:19,rowSpacing:12,color:"363636",text:e.courseName?l(e.courseName,75):""},L={code:"avatar",width:57,height:57,x:26,y:486,level:2,text:e.userInfo.headPortrait},C={code:"name",width:130,height:18,x:92,y:489,level:2,font:"\u5FAE\u8F6F\u96C5\u9ED1",size:17,color:"636363",text:e.userInfo.realName?l(e.userInfo.realName,6):e.userInfo.nickname?l(e.userInfo.nickname,6):l(e.userInfo.loginName,6)},F={code:"content",width:130,height:90,x:92,y:512,level:2,font:"\u5FAE\u8F6F\u96C5\u9ED1",color:"636363",size:13,rowSpacing:6,text:e.iscourse?"":"\u9080\u8BF7\u60A8\u4E00\u8D77\u62FC\u56E2\u957F\u6309\u626B\u7801\u62FC\u56E2"},A={code:"qrCode",width:104,height:104,x:243,y:463,level:2,text:x},P={code:"school",width:h(window.roominfo.name,"width"),height:12,x:h(window.roominfo.name,"x"),y:607,level:2,font:"\u9ED1\u4F53",size:12,color:"FACA86",bold:!0,text:window.roominfo.name},W={code:"block",width:30,height:1,color:"F0ECE3",x:n(window.roominfo.name,"left"),y:613,level:2},O={code:"block",width:30,height:1,color:"F0ECE3",x:n(window.roominfo.name,"right"),y:613,level:2};s.push(w),s.push(B),s.push(I),s.push(m),s.push(z),s.push(L),s.push(C),s.push(F),s.push(A),s.push(P),s.push(W),s.push(O),s.map(function(t){"x"in t&&(t.x=t.x*4),"y"in t&&(t.y=t.y*4),"width"in t&&(t.width=t.width*4),"height"in t&&(t.height=t.height*4),"size"in t&&(t.size=t.size*4),"rowSpacing"in t&&(t.rowSpacing=t.rowSpacing*4)});var a=function(t){f=t.data,i("#picWillShare")[0]&&!i("#picWillShare").attr("src")&&i("#picWillShare").attr("src",t.data)};u.getShareImg(s,a);var D='<div id="coverModal" style="position: fixed;z-index: 10000;background: rgba(0,0,0,0.65);left: 0;top: 0;width: 100%;height: 100vh;font-size: 16px;"><div id="shareFooterBar" style="width:100%;position:fixed;bottom:0;background:#fff"><div style="display:flex;width:100%;height:99px;border-bottom:1px solid #f1eeee;justify-content: center;align-items: center;"><div id="shareToWeChatBtn" style="width: 50%;height:99px;display:flex;justify-content: center;align-items: center;"><div style="text-align: center;"><img width="32" height="32" src="/design/designstatic/front/images/wechat.png" /><div style="width: 100%;height: 25px;line-height: 25px;margin-top: 5px">\u5206\u4EAB\u7ED9\u597D\u53CB</div></div></div><div id="shareOnPicBtn" style="width: 50%;height:99px;display:flex;justify-content: center;align-items: center;"><div style="text-align: center;"><img width="32" height="32" src="/design/designstatic/front/images/sharePicBtn.png" /><div style="width: 100%;height: 25px;line-height: 25px;margin-top: 5px">\u751F\u6210\u6D77\u62A5\u5206\u4EAB</div></div></div></div><div id="unShareBtn" style="width:100%;height:50px;text-align:center;line-height:50px;">\u53D6\u6D88</div></div></div>';i("html").append(D)},/Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent)?(y.imgEditor.shareLayer=function(r,p,a,e,v){r||(r=window.location.href),p||(p="/design/designstatic/front/images/shareBackground.png"),e.cover||(e.cover="/design/designstatic/common/image/course/defult.jpg"),/\.(gif|jpg|jpeg|png|GIF|JPEG|JPG|PNG)$/.test(e.cover)||(e.cover="/design/designstatic/common/image/course/defult.jpg"),window.roominfo||(window.roominfo={}),window.roominfo.name=e.schoolName||window.roominfo.name||"";var u="",f=e.budgetPrice||0,x=e.firstLevelScale||0;if(f>0){var g=(f/100).toFixed(2);u='<div class="budget_view js_budget" data-scale='+x+">\u9080\u8BF7\u597D\u53CB\u8D2D\u4E70\uFF0C\u9884\u8BA1\u53EF\u8D5A"+g+"\u5143 ></div>"}e.userInfo||(e.userInfo={}),i("html").css("overflow","hidden"),i("body").css({height:"100vh",overflow:"hidden"});var l=this,h="",n=r,s=function(){typeof e.preCloseCoverModalListener=="function"&&e.preCloseCoverModalListener(),i("html").css("overflow","auto"),i("body").css({height:"auto",overflow:"auto"}),i("#coverModal").remove(),typeof e.closeCoverModalListener=="function"&&e.closeCoverModalListener()};i("html").on("click","#unShareBtn",function(c){s(),c.stopPropagation()}),i("html").on("click","#coverModal,.share-card-container-wrap,.share-bottom",function(c){s(),c.stopPropagation()}),i("html").on("click","#picCloseShare",function(c){s(),c.stopPropagation()}),i("html").on("click","#picWillShare",function(c){c.stopPropagation()}),i("html").one("click","#shareToWeChatBtn",function(c){if(localStorage.appAdapt===!0||localStorage.appAdapt==="true"){/iPhone|iPad|iPod/i.test(navigator.userAgent)?window.webkit&&window.webkit.messageHandlers.shareAction.postMessage(null):window.Android&&window.Android.jsCallAndroid();return}var d=window.navigator.userAgent,k="";i("#shareToWechat").remove(),i("#shareFooterBar").remove(),/MicroMessenger/gi.test(d)?k='<div id="shareToWechat"><div style="text-align:right;margin-top: 20px;margin-right: 20px;"><img width="144" height="222" src = "/design/designstatic/front/images/shareToUp.png"/></div><div style="margin-top: 10px;text-align: center;color: #fff;"><p style="font-size:18px">\u7ACB\u5373\u5206\u4EAB\u7ED9\u597D\u53CB\u5427</p><p style="font-size:14px;margin-top: 7px">\u70B9\u51FB\u5C4F\u5E55\u53F3\u4E0A\u89D2\u5C06\u672C\u9875\u5206\u4EAB\u7ED9\u597D\u53CB</p></div></div>':k='<div id="shareToWechat" style="position: absolute;bottom: 100px;width: 100%;"><div style="text-align: center;color: #fff;"><p style="font-size:18px">\u7ACB\u5373\u5206\u4EAB\u7ED9\u597D\u53CB\u5427</p><p style="font-size:14px;margin-top: 7px">\u70B9\u51FB\u9009\u62E9\u5206\u4EAB\u9014\u5F84</p></div><div style="margin-top: 20px;text-align: center"><img width="119" height="245" src = "/design/designstatic/front/images/shareToDown.png"/></div></div>',i("#coverModal").append(k),window.socialShareaddShareLog("wechat1"),reportVisitLog&&reportVisitLog.callaction("03"),c.stopPropagation()}),i("html").off("click","#shareOnPicBtn"),i("html").on("click","#shareOnPicBtn",function(c){var d="";if(i("#shareOnPic").remove(),i("#shareFooterBar").remove(),e.shopId||e.courseId||e.courseWareId||e.infoID){var k='<div class="share-card-container-wrap"><canvas id="canvas" width="1500" height="2668" style="display: none"></canvas><div class="share-card-container"> <div class="share-card-inner-container"> <div class="swiper-container swiper-container-horizontal"> <div class="swiper-wrapper" id="swiper" style="visibility: visible;transform: translate3d(0px, 0px, 0px);transition-duration: 0ms;"> <div class="swiper-slide"> <img id="image-A" class="main-img" src=""> </div> <div class="swiper-slide"> <img id="image-B" class="main-img" src=""> </div> <div class="swiper-slide"> <img id="image-C" class="main-img" src=""> </div> <div class="swiper-slide"> <img id="image-D" class="main-img" src=""> </div> <div class="swiper-slide"> <img id="image-E" class="main-img" src=""> </div> <div class="swiper-slide"> <img id="image-F" class="main-img" src=""> </div> <div class="swiper-slide"> <img id="image-G" class="main-img" src=""> </div> <div class="swiper-slide"> <img id="image-H" class="main-img" src=""> </div> <div class="swiper-slide"> <img id="image-I" class="main-img" src=""> </div> </div> </div> </div></div><div id="code" style="display: none"></div><div class="share-bottom"><p class="how-to-share">\u957F\u6309\u56FE\u7247\uFF0C\u4FDD\u5B58\u6216\u53D1\u9001\u7ED9\u670B\u53CB </p></div></div>';i("#coverModal").append(k);var N;N=m.filter(function(o){return o.code!=="content"}),commonPicShare(N,e.iscourse);var G=i.mggScrollImg(".share-card-container .swiper-wrapper",{loop:!1,auto:!1,auto_wait_time:3e3,scroll_time:300,callback:function(o){i("#page").text(o+1)}});i(".prev").click(function(){G.prev()}),i(".next").click(function(){G.next()}),i(".main-img").click(function(o){o.stopPropagation()})}else d='<div id="shareOnPic" style="display: flex;justify-content: center;align-items: center;height: 100%;"><div style="position: relative;"><img id="picCloseShare" style="position: absolute;top:-15px;right: -15px;" src="/design/designstatic/front/images/closeBtn.png" width="30" height="30"/><div><img id="picWillShare" width="267" height="467"/></div><div style="margin-top: 10px;text-align: center;color: #fff;"><p style="font-size:14px;margin-top: 7px">\u957F\u6309\u4FDD\u5B58\u56FE\u7247\u81F3\u76F8\u518C</p></div></div></div>',i("#coverModal").append(d),i("#picWillShare").attr("src",h);/Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent)&&(window.socialShareaddShareLog("picture"),reportVisitLog&&reportVisitLog.callaction("03")),c.stopPropagation()});function w(c,d){if(c||(c=""),c.length<d)return c;var k=c.substring(0,d-2);return k=k+"...",k}function B(c,d){if(c||(c=""),d==="x"){var k=158;return c.length>5?k=158-7*(c.length-5):k=158+7*(5-c.length),k}else{var N=60;return c.length>5?N=60+13*(c.length-5):N=60-13*(5-c.length),N}}function I(c,d){c||(c="");var k=121;return d==="left"?c.length>5?k=121-7*(c.length-5):k=121+7*(5-c.length):d==="right"&&(c.length>5?k=227+7*(c.length-5):k=227-7*(5-c.length)),k}var m=[],z={code:"courseId",id:e.courseId},L={code:"background",id:v||"",width:375,height:667,x:0,y:0,level:0},C={code:"subBackground",width:353,height:396,x:11,y:241,level:1},F={code:"course",id:e.courseId,width:353,height:199,x:11,y:42,level:1,text:e.cover?e.cover:""},A={code:"block",width:3,height:18,color:"D04165",x:32,y:270,level:2},P={code:"courseTitle",width:283,height:46,x:46,y:269,level:2,font:"\u5FAE\u8F6F\u96C5\u9ED1",size:19,rowSpacing:12,color:"000000",text:e.courseName?w(e.courseName,27):""},W={code:"courseIntroduce",width:283,height:70,x:46,y:325,level:2,font:"\u5FAE\u8F6F\u96C5\u9ED1",size:14,rowSpacing:6,color:"414141",text:e.introduce?w(e.introduce,57):""},O={code:"avatar",width:57,height:57,x:26,y:486,level:2,text:e.userInfo.headPortrait},D={code:"name",width:130,height:18,x:92,y:489,level:2,font:"\u5FAE\u8F6F\u96C5\u9ED1",size:17,color:"636363",text:e.userInfo.realName?w(e.userInfo.realName,6):e.userInfo.nickname?w(e.userInfo.nickname,6):w(e.userInfo.loginName,6)},t={code:"content",width:130,height:90,x:92,y:512,level:2,font:"\u5FAE\u8F6F\u96C5\u9ED1",color:"636363",size:13,rowSpacing:6,text:e.iscourse?"\u9080\u8BF7\u60A8\u4E00\u8D77\u5B66\u4E60\u597D\u77E5\u8BC6\u957F\u6309\u626B\u7801\u542C\u8BFE":"\u9080\u8BF7\u60A8\u4E00\u8D77\u4EAB\u53D7\u597D\u5546\u54C1!"};e.iscourse&&e.iscourse=="lookpic"&&(t.text="\u9080\u8BF7\u60A8\u4E00\u8D77\u4EAB\u53D7\u770B\u56FE\u76F8\u518C \u957F\u6309\u626B\u7801\u770B\u56FE");var _={code:"qrCode",width:104,height:104,x:243,y:463,level:2,text:n},b={code:"school",width:B(window.roominfo.name,"width"),height:12,x:B(window.roominfo.name,"x"),y:607,level:2,font:"\u9ED1\u4F53",size:12,color:"FACA86",bold:!0,text:window.roominfo.name},T={code:"block",width:30,height:1,color:"F0ECE3",x:I(window.roominfo.name,"left"),y:613,level:2},U={code:"block",width:30,height:1,color:"F0ECE3",x:I(window.roominfo.name,"right"),y:613,level:2};if(m.push(L),m.push(C),m.push(F),m.push(A),m.push(P),m.push(W),m.push(O),m.push(D),m.push(t),m.push(_),m.push(b),m.push(T),m.push(U),!e.courseId&&!e.courseWareId){var j=m.find(function(d){return d.code==="course"});j||(j={}),e.courseWareId?(j.code="ware",j.id=e.courseWareId):e.shopId?(j.code="shop",j.id=e.shopId):e.vipId?(j.code="vip",j.id=e.vipId):(j.code="course",j.id=e.courseId),m.map(function(d){"x"in d&&(d.x=d.x*4),"y"in d&&(d.y=d.y*4),"width"in d&&(d.width=d.width*4),"height"in d&&(d.height=d.height*4),"size"in d&&(d.size=d.size*4),"rowSpacing"in d&&(d.rowSpacing=d.rowSpacing*4)});var a=function(d){h=d.data,i("#picWillShare")[0]&&!i("#picWillShare").attr("src")&&i("#picWillShare").attr("src",d.data)};l.getShareImg(m,a)}var M='<div id="coverModal" style="position: fixed;z-index: 10000;background: rgba(0,0,0,0.65);left: 0;top: 0;width: 100%;height: 100vh;font-size: 16px;cursor:pointer;"><div id="shareFooterBar" style="width:100%;position:fixed;bottom:0;background:#fff">'+u+'<div style="display:flex;width:100%;height:99px;border-bottom:1px solid #f1eeee;justify-content: center;align-items: center;"><div id="shareToWeChatBtn" style="width: 50%;height:99px;display:flex;justify-content: center;align-items: center;"><div style="text-align: center;"><img width="32" height="32" src="/design/designstatic/front/images/wechat.png" /><div style="width: 100%;height: 25px;line-height: 25px;margin-top: 5px">\u5206\u4EAB\u7ED9\u597D\u53CB</div></div></div><div id="shareOnPicBtn" style="width: 50%;height:99px;display:flex;justify-content: center;align-items: center;"><div style="text-align: center;"><img width="32" height="32" src="/design/designstatic/front/images/sharePicBtn.png" /><div style="width: 100%;height: 25px;line-height: 25px;margin-top: 5px">\u751F\u6210\u6D77\u62A5\u5206\u4EAB</div></div></div></div><div id="unShareBtn" style="width:100%;height:50px;text-align:center;line-height:50px;">\u53D6\u6D88</div></div></div>';i("body").append(M)},y.imgEditor.showPic=function(r,p,a,e){var v=this,u=layer.open({title:"\u9009\u62E9\u80CC\u666F",className:"layui-layer-antd",anim:"scale",success:function(f){var x=i(f);x.find(".layui-m-layercont").css({padding:0}),document.getElementById("showPicDiv").style.backgroundImage="url("+r+") ";var g=x.find(".usepic");g.on("click",function(){layer.close(u),layer.close(p),v.shareLayer(productUrl,r,null,v.res,e)})},content:'<div id="tulip"><style>.layui-layer-antd h3{display:none}.layui-layer-antd.layui-m-layercont{padding:0;max-height:540px}</style><div id="showPicDiv"style="height:610px;background-position: top center; background-size: cover;background-repeat:no-repeat;"><div id="tools"style="z-index: 99;position:absolute;top:15px;left:50%;margin-left: -54px"><img class="usepic"src="/design/designstatic/common/image/share/use.png"/></div></div></div>'})},y.imgEditor.choicePic=function(r,p){var a=this,e=layer.open({title:"\u9009\u62E9\u80CC\u666F",className:"layui-layer-antd",anim:"scale",success:function(v){var u=i(v);u.find(".layui-m-layercont").css({padding:0});var f,x=function(g){var l=!1;g===""&&(l=!0),a.getPicList(g,l,function(h){i(".img_box")[0].innerText="";for(var n=0;n<h.data.list.length;n++){var s=i('<div class="_once"><img src="'+h.data.list[n].sourcePath+'" alt="" /></div>');s.on("click",{sourceId:h.data.list[n].sourceId,source:h.data.list[n].sourcePath},function(w){a.showPic(w.data.source,e,"",w.data.sourceId)}),i(".img_box").append(s)}})};a.getTypeList(!1,function(g){var l;f=g.data,l=i('<div id="all" style="color:#1890FF;"><span class="title" >\u7F51\u6821</span></div>'),l.on("click",{classifyId:""},function(n){lastTitle&&(lastTitle.style.color="#000000"),lastTitle=n.currentTarget,lastTitle.style.color="#1890FF",x(n.data.classifyId)}),lastTitle=l[0],i(".classifyList").append(l),x("");for(var h=0;h<g.data.length;h++)l=i('<div id="'+g.data[h].classifyId+'" style="color:#000000;"><span class="title" >'+g.data[h].classifyName+"</span></div>"),l.on("click",{classifyId:g.data[h].classifyId},function(n){x(n.data.classifyId),lastTitle&&(lastTitle.style.color="#000000"),lastTitle=n.currentTarget,lastTitle.style.color="#1890FF";for(var s=0;s<f.length;s++)if(f[s].classifyId.toString()==n.currentTarget.id){var w=f[s].children;i(".btn_box1")[0].innerText="";var B=i('<div class="_all" id="all">\u5168\u90E8</div>');if(lastButton=B[0],i(".btn_box1").append(B),B.on("click",{classifyId:n.data.classifyId},function(z){lastButton&&(lastButton.className="btn_once"),lastButton=z.currentTarget,lastButton.className="_all",x(z.data.classifyId)}),w!=null)for(var I=0;I<w.length;I++){var m=i('<div class="btn_once" id="'+w[I].classifyId+'">'+w[I].classifyName+"</div>");i(".btn_box1").append(m),m.on("click",{id:f[s].classifyId},function(z){lastButton&&(lastButton.className="btn_once"),lastButton=z.currentTarget,lastButton.className="_all",x(z.data.classifyId)})}}}),i(".classifyList").append(l)})},content:'<div style="height:610px;display: flex;display: -webkit-flex;flex-direction: row"><div id="classifyList"class="classifyList"style="width:70px;border-right: 1px solid #d9d9d9;margin-right:5px;"></div><div id="box"><style>.layui-layer-antd.layui-m-layercont{padding:0;border-top:1px solid#d9d9d9}#box{width:100%;box-sizing:border-box;overflow:hidden}.btn_box1{width:100%;margin-bottom:10px;margin-top:10px}.title{width:50px;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1;overflow:hidden;font-size:14px;margin:5px}._all{float:left;padding:0px 15px;font-size:14px;color:#fff;background:#42a4e5;border:1px solid#42a4e5;border-radius:4px;cursor:pointer;margin:0 15px 10px 0}.btn_once{float:left;padding:8px 15px;font-size:14px;border:1px solid#ccc;border-radius:8px;cursor:pointer;margin:0 15px 10px 0}.img_box{width:100%;display:-webkit-flex;display:flex;flex-direction:row;flex-wrap:wrap}._once{width:50%;box-sizing:border-box;padding-right:20px;margin-bottom:20px}._once img{width:100%;height:100%}</style><div id="btn_box1"class="btn_box1"><div class="_all">\u5168\u90E8</div></div><div id="img_box"class="img_box"></div></div></div>'})}):(y.imgEditor.shareLayer=function(r,p,a,e,v){var u="",f=e.budgetPrice||0,x=e.firstLevelScale||0;if(f>0){var g=(f/100).toFixed(2);u='<div class="budget_view js_budget" data-scale='+x+">\u9080\u8BF7\u597D\u53CB\u8D2D\u4E70\uFF0C\u9884\u8BA1\u53EF\u8D5A"+g+"\u5143 ></div>"}if(i("html").css("overflow","hidden"),i("body").css({height:"100vh",overflow:"hidden"}),i(".share-body-wrap")[0])i(".share-body-wrap").css("display","block");else{var l='<div class="share-body-wrap"> <div class="share-body"> <div class="close-btn" onclick="showShareModal(false)"></div> <div class="self_share"></div>'+u+" </div></div>";if(i("body").append(l),r||(r=window.location.href),e.cover||(e.cover="/design/designstatic/common/image/course/defult.jpg"),!/\.(gif|jpg|jpeg|png|GIF|JPEG|JPG|PNG)$/.test(e.cover)){var h=e.cover.lastIndexOf(".done")>=0?e.cover.lastIndexOf(".done"):e.cover.lastIndexOf(".");e.cover=e.cover?e.cover.substring(0,h)+".jpg":""}var n={url:r,source:e.source||y.location.origin||"",title:e.title||e.courseName||"",origin:e.origin||y.location.origin||"",description:e.description||e.introduce||"",image:e.image||y.location.origin+e.cover||"",sites:["weibo","qq","moments","dingding","wechat","douban","qzone","linkedin","facebook","twitter","google","picture","copylink"],disabled:["google","facebook","twitter"]};e.config&&(n=i.extend({},n,e.config)),y.socialShare&&y.socialShare(".self_share",n),i(".share-body-wrap").on("click",".social-share-icon.icon-picture",function(){window.showShareModal(!1),window.imgEditor.shareLayerPC(r,p,a,e,v)})}},y.imgEditor.shareLayerPC=function(r,p,a,e,v){var u=this;if(this.res=e,r||(r=window.location.href),p||(p="/design/designstatic/front/images/shareBackground.png"),e.cover||(e.cover="/design/designstatic/common/image/course/defult.jpg"),!/\.(gif|jpg|jpeg|png|GIF|JPEG|JPG|PNG)$/.test(e.cover)){var f=e.cover.lastIndexOf(".done")>=0?e.cover.lastIndexOf(".done"):e.cover.lastIndexOf(".");e.cover=e.cover?e.cover.substring(0,f)+".jpg":""}e.userInfo||(e.userInfo={}),window.roominfo||(window.roominfo={}),window.roominfo.name=e.schoolName||window.roominfo.name||"";var x=r;this.getImage=function(l,h){var n=new XMLHttpRequest;n.open("get",l,!0),n.responseType="blob",n.onload=function(){this.status==200&&h&&h(URL.createObjectURL(this.response))},n.send(null)};var g=layer.open({type:1,title:"\u5206\u4EAB\u56FE\u7247",skin:"layui-layer-antd",closeBtn:1,anim:2,area:"375px 667px",scrollbar:!1,shadeClose:!1,cancel:function(l,h){},success:function(l,h){var n="/design/designstatic/front/images/shareContentBg.png";if(u.getImage(p,function(L){document.getElementById("background").style.backgroundImage="url("+L+")"}),u.getImage(n,function(L){document.getElementById("shareContentBg").style.backgroundImage="url("+L+")"}),location.href.indexOf("/pages/routine/")>-1)i("#code").html("<img src="+x+' style="width:104px;height:104px;"/>');else{var s=new QRCode(document.getElementById("code"),{text:x,width:104,height:104,correctLevel:QRCode.CorrectLevel.L});s.makeCode(x)}s.makeCode(x),u.getImage(e.cover,function(L){i("#cover").attr("src",L)}),u.getImage("/design/designstatic/front/images/shareChange.png",function(L){i("#changeBackground").attr("src",L)});var w='<div style="position: relative;"><span style="position:absolute;left: -10px;top: 2px;background:#D04165;width: 3px;height: 18px;font-size: 14px;"></span><p style="text-align:left;font-size: 19px;height:46px;overflow:hidden;line-height: 1.2;">'+e.courseName+"</p></div>";if(e.introduce&&(w+='<p style="text-align:left;position: relative;font-size: 12px;height: 70px;overflow:hidden">'+e.introduce+"</p>"),i("#sharecontent").html(w),i("#userPhoto").attr("src",e.userInfo.headPortrait||"/design/designstatic/common/image/head/boy.png"),e.userInfo.realName?i("#userName").html(e.userInfo.realName):e.userInfo.nickname?i("#userName").html(e.userInfo.nickname):i("#userName").html(e.userInfo.loginName),e.iscourse&&i("#userDes").html("\u9080\u8BF7\u60A8\u4E00\u8D77\u5B66\u4E60\u597D\u77E5\u8BC6 \u957F\u6309\u626B\u7801\u542C\u8BFE"),e.iscourse&&e.iscourse=="information"&&i("#userDes").html("\u9080\u8BF7\u60A8\u4E00\u8D77\u4EAB\u53D7\u597D\u6587\u7AE0 \u957F\u6309\u626B\u7801\u9605\u8BFB"),e.iscourse&&e.iscourse=="lookpic"&&i("#userDes").html("\u9080\u8BF7\u60A8\u4E00\u8D77\u4EAB\u53D7\u770B\u56FE\u76F8\u518C \u957F\u6309\u626B\u7801\u770B\u56FE"),e.iscourse&&e.iscourse=="shortvideo"&&i("#userDes").html("\u9080\u8BF7\u60A8\u4E00\u8D77\u4EAB\u53D7\u597D\u89C6\u9891\uFF0C\u957F\u6309\u626B\u7801\u89C2\u770B"),window.roominfo&&window.roominfo.name){var B='<span style="color: #F0ECE3;">\u2014\u2014\u2014 </span>'+window.roominfo.name+'<span style="color: #F0ECE3;"> \u2014\u2014\u2014</span>';i("#schoolName").html(B)}var I=l.find(".changeBackground");I.on("click",function(){layer.close(g),u.choicePic(x)});var m=l.find(".savepic"),z=document.getElementById("download");m.on("click",function(L){function C(o,E){if(o||(o=""),o.length<E)return o;var S=o.substring(0,E-2);return S=S+"...",S}function F(o,E){if(o||(o=""),E==="x"){var S=158;return o.length>5?S=158-7*(o.length-5):S=158+7*(5-o.length),S}else{var q=60;return o.length>5?q=60+13*(o.length-5):q=60-13*(5-o.length),q}}function A(o,E){var S=121;return E==="left"?o.length>5?S=121-7*(o.length-5):S=121+7*(5-o.length):E==="right"&&(o.length>5?S=227+7*(o.length-5):S=227-7*(5-o.length)),S}var P=[],W={code:"courseId",id:e.courseId},O={code:"background",id:v,width:375,height:667,x:0,y:0,level:0},D={code:"subBackground",width:353,height:396,x:11,y:241,level:1},t;e.courseWareId?t={code:"ware",id:e.courseWareId,width:353,height:199,x:11,y:43,level:1}:e.shopId?t={code:"shop",id:e.shopId,width:353,height:199,x:11,y:43,level:1}:e.vipId?t={code:"vip",id:e.vipId,width:353,height:199,x:11,y:42,level:1,radius:20}:e.iscourse=="information"||e.iscourse=="shortvideo"||e.iscourse=="lookpic"?t={code:"homepage",id:e.infoID,width:353,height:199,x:11,y:42,level:1,radius:20}:t={code:"course",id:e.courseId,width:353,height:199,x:11,y:43,level:1};var _={code:"block",width:3,height:18,color:"D04165",x:32,y:270,level:2},b={code:"courseIntroduce",width:283,height:116,x:46,y:269,level:2,font:"\u5FAE\u8F6F\u96C5\u9ED1",size:19,rowSpacing:12,color:"000000",text:e.courseName?C(e.courseName,27):""},T={code:"courseIntroduce",width:283,height:70,x:46,y:325,level:2,font:"\u5FAE\u8F6F\u96C5\u9ED1",size:14,rowSpacing:6,color:"414141",text:e.introduce?C(e.introduce,57):""},U={code:"avatar",width:57,height:57,x:26,y:486,level:2,text:e.userInfo.headPortrait},j={code:"name",width:130,height:18,x:92,y:489,level:2,font:"\u5FAE\u8F6F\u96C5\u9ED1",size:17,color:"636363",text:e.userInfo.realName?C(e.userInfo.realName,6):e.userInfo.nickname?C(e.userInfo.nickname,6):C(e.userInfo.loginName,6)},M={code:"content",width:130,height:90,x:92,y:512,level:2,font:"\u5FAE\u8F6F\u96C5\u9ED1",color:"636363",size:13,rowSpacing:6,text:e.iscourse?"\u9080\u8BF7\u60A8\u4E00\u8D77\u5B66\u4E60\u597D\u77E5\u8BC6\u957F\u6309\u626B\u7801\u542C\u8BFE":"\u9080\u8BF7\u60A8\u4E00\u8D77\u4EAB\u53D7\u597D\u5546\u54C1\u957F\u6309\u626B\u7801\u8D2D\u4E70"};e.iscourse&&e.iscourse=="information"&&(M.text="\u9080\u8BF7\u60A8\u4E00\u8D77\u4EAB\u53D7\u597D\u6587\u7AE0 \u957F\u6309\u626B\u7801\u9605\u8BFB"),e.iscourse&&e.iscourse=="lookpic"&&(M.text="\u9080\u8BF7\u60A8\u4E00\u8D77\u4EAB\u53D7\u770B\u56FE\u76F8\u518C \u957F\u6309\u626B\u7801\u770B\u56FE"),e.iscourse&&e.iscourse=="shortvideo"&&(M.text="\u9080\u8BF7\u60A8\u4E00\u8D77\u4EAB\u53D7\u597D\u89C6\u9891\uFF0C\u957F\u6309\u626B\u7801\u89C2\u770B");var c={code:"qrCode",width:104,height:104,x:243,y:463,level:2,text:x},d={code:"school",width:F(window.roominfo.name,"width"),height:12,x:F(window.roominfo.name,"x"),y:607,level:2,font:"\u9ED1\u4F53",size:12,color:"FACA86",bold:!0,text:window.roominfo.name},k={code:"block",width:30,height:1,color:"F0ECE3",x:A(window.roominfo.name,"left"),y:613,level:2},N={code:"block",width:30,height:1,color:"F0ECE3",x:A(window.roominfo.name,"right"),y:613,level:2};P.push(O),P.push(D),P.push(t),P.push(_),P.push(b),P.push(T),P.push(U),P.push(j),P.push(M),P.push(c),P.push(d),P.push(k),P.push(N),P.map(function(o){"x"in o&&(o.x=o.x*4),"y"in o&&(o.y=o.y*4),"width"in o&&(o.width=o.width*4),"height"in o&&(o.height=o.height*4),"size"in o&&(o.size=o.size*4),"rowSpacing"in o&&(o.rowSpacing=o.rowSpacing*4)});var G=function(o){var E=o.data,S=document.createElement("a"),q=new MouseEvent("click");S.download="sharePic_"+new Date().getTime()+".png",S.href=E,S.dispatchEvent(q)};u.getShareImg(P,G)})},content:'<div id="tulip"><style>#tulip{width: 375px;position:relative}.layui-layer-antd.layui-m-layercont { padding: 0; max-height: 540px } #tulip div{box-sizing: border-box;} #tools p{display: inline-block;height: 24px;}</style><div id="background" style="height:667px;background-position: top center;background-size: cover;background-repeat:no-repeat;padding:41px 0px 30px;box-sizing: border-box;"><div style="padding: 0 11px"><img id="cover" style="display:block; width:100%;height: 190px; border-radius: 5px 5px 0 0"><div id="shareContentBg" style="width: 100%; height: 396px;background-repeat: no-repeat;background-size: cover;background-position: center;border-radius: 0 0 10px 10px;"><div id="sharecontent" style="width: 100%;height: 184px;padding: 28px 35px;"></div><div style="width: 100%;height: 184px; padding: 0 15px"><div style="display: flex; align-items: center; height: 184px;"><img id="userPhoto" src="" style="width: 57px;height: 57px; border-radius: 50%; margin-right: 10px"/><div style="width: 98px; margin-right: 20px"><p id="userName" style="text-align:left; margin-bottom: 0;font-size: 17px;white-space: nowrap;text-overflow: ellipsis;overflow: hidden;width: 100%;">\u9ED8\u8BA4\u5206\u4EAB\u4EBA</p><p id="userDes" style="text-align: left;font-size: 13px;">\u9080\u8BF7\u60A8\u4E00\u8D77\u4EAB\u53D7\u597D\u5546\u54C1 \u957F\u6309\u626B\u7801\u8D2D\u4E70</p></div><div id="code"class="code"style="margin:0 auto;width:104px;height:104px;background-size:contain;"></div></div></div><div id="schoolName" style="height: 28px;line-height: 28px; text-align: center;color: #FACA86"></div></div></div><div id="tools" style="width: 100%; display: flex;align-items:center;height: 40px;background: #656565; opacity: 0.5;position: absolute;bottom: 0"><p style="width: 50%; text-align: center"><img style="cursor: pointer" class="changeBackground" src="/design/designstatic/front/images/shareChange.png" width="23px" height="23px"></p><p style="width: 50%; text-align: center"><img style="cursor: pointer" class="savepic" src="/design/designstatic/front/images/shareDown.png" width="23px" height="23px"></p></div></div></div>'})},y.imgEditor.showPic=function(r,p,a,e){var v=this,u=layer.open({type:1,title:"\u9009\u62E9\u80CC\u666F",skin:"layui-layer-antd",closeBtn:1,anim:2,area:"375px 610px",scrollbar:!1,shadeClose:!1,cancel:function(f,x){},success:function(f,x){document.getElementById("showPicDiv").style.backgroundImage="url("+r+") ";var g=f.find(".usepic");g.on("click",function(){layer.close(u),layer.close(p),v.shareLayerPC(productUrl,r,null,v.res,e)})},content:'<div id="tulip"><div id="showPicDiv"style="height:610px;width:350px;background-position:center; background-size: contain;background-repeat:no-repeat;"><div id="tools"style="position:absolute;bottom:30px;left:50px;display: flex;display: -webkit-flex;flex-direction: row"><img class="usepic"style="margin-left:60px;"src="/design/designstatic/common/image/share/use.png"/></div></div></div>'})},y.imgEditor.choicePic=function(r,p){var a=this,e=layer.open({type:1,title:"\u9009\u62E9\u80CC\u666F",skin:"layui-layer-antd",closeBtn:1,anim:2,area:"880px 610px",scrollbar:!1,shadeClose:!1,cancel:function(v,u){},success:function(v,u){var f,x=function(g){var l=!1;g===""&&(l=!0),a.getPicList(g,l,function(h){i(".img_box")[0].innerText="";for(var n=0;n<h.data.list.length;n++){var s=i('<div class="_once"><img src="'+h.data.list[n].sourcePath+'" alt="" /></div>');s.on("click",{sourceId:h.data.list[n].sourceId,source:h.data.list[n].sourcePath},function(w){layer.close(e),a.shareLayerPC(r,w.data.source,null,a.res,w.data.sourceId)}),i(".img_box").append(s)}})};a.getTypeList(!1,function(g){var l;f=g.data,l=i('<div id="all" style="color:#1890FF;"><span class="title" >\u7F51\u6821</span></div>'),l.on("click",{classifyId:""},function(n){lastTitle&&(lastTitle.style.color="#000000"),lastTitle=n.currentTarget,lastTitle.style.color="#1890FF",x(n.data.classifyId)}),lastTitle=l[0],i(".classifyList").append(l),x("");for(var h=0;h<g.data.length;h++)l=i('<div id="'+g.data[h].classifyId+'" style="color:#000000;"><span class="title" >'+g.data[h].classifyName+"</span></div>"),l.on("click",{classifyId:g.data[h].classifyId},function(n){x(n.data.classifyId),lastTitle&&(lastTitle.style.color="#000000"),lastTitle=n.currentTarget,lastTitle.style.color="#1890FF";for(var s=0;s<f.length;s++)if(f[s].classifyId.toString()==n.currentTarget.id){var w=f[s].children;i(".btn_box1")[0].innerText="";var B=i('<div class="_all" id="all">\u5168\u90E8</div>');if(lastButton=B[0],i(".btn_box1").append(B),B.on("click",{classifyId:n.data.classifyId},function(z){lastButton&&(lastButton.className="btn_once"),lastButton=z.currentTarget,lastButton.className="_all",x(z.data.classifyId)}),w!=null)for(var I=0;I<w.length;I++){var m=i('<div class="btn_once" id="'+w[I].classifyId+'">'+w[I].classifyName+"</div>");i(".btn_box1").append(m),m.on("click",{id:f[s].classifyId},function(z){lastButton&&(lastButton.className="btn_once"),lastButton=z.currentTarget,lastButton.className="_all",x(z.data.classifyId)})}}}),i(".classifyList").append(l)})},content:'<div style="width:880px;height:610px;display: flex;display: -webkit-flex;flex-direction: row"><div id="classifyList" class="classifyList" style="width:200px; border-right: 1px solid #e8e8e8;margin-right: 10px;"></div><div id="box"><style>.layui-layer-content#classifyList{border-right:1px solid#e8e8e8;text-align:center}.layui-layer-content#box{padding-left:10px}#box{width:100%;box-sizing:border-box;overflow:hidden}.btn_box1{width:100%;margin-bottom:10px;margin-top:10px;display: none;}.title{width:100%;display:block;overflow:hidden;font-size:15px;padding: 15px 5px 0;box-sizing: border-box;white-space: nowrap;text-overflow: ellipsis;cursor:pointer;text-indent: 17px; }._all{float:left;padding:8px 15px;font-size:14px;color:#fff;background:#42a4e5;border:1px solid#42a4e5;border-radius:8px;cursor:pointer;margin:0 15px 10px 0}.btn_once{float:left;padding:8px 15px;font-size:14px;border:1px solid#ccc;border-radius:8px;cursor:pointer;margin:0 15px 10px 0}.img_box{width:100%;display:-webkit-flex;display:flex;flex-direction:row;flex-wrap:wrap}._once{width:12.5%;box-sizing:border-box;padding-right:20px;margin-top:20px}._once img{width:100%;height:100%}</style><div id="btn_box1"class="btn_box1"><div class="_all">\u5168\u90E8</div></div><div id="img_box"class="img_box"></div></div></div>'})})})(jQuery,window);function getCookie(i){for(var y=document.cookie,r=y.split("; "),p=0;p<r.length;p++){var a=r[p].split("=");if(a[0]==i)return a[1]}return""}function delUrlParam(i){var y=new window.URL(window.location.href);return y.searchParams.delete(i),y.href}function addUrlParam(i,y){var r=new window.URL(window.location.href);return r.searchParams.set(i,y),r.href}var productUrl,lastTitle,lastButton;appid="101518260",redirect_uri="https://www.xx.cn",function(i,y,r){function p(a){var e="default";a.self_redirect===!0?e="true":a.self_redirect===!1&&(e="false");var v=y.createElement("iframe"),u="https://open.weixin.qq.com/connect/qrconnect?appid="+a.appid+"&scope="+a.scope+"&redirect_uri="+a.redirect_uri+"&state="+a.state+"&login_type=jssdk&self_redirect="+e+"&styletype="+(a.styletype||"")+"&sizetype="+(a.sizetype||"")+"&bgcolor="+(a.bgcolor||"")+"&rst="+(a.rst||"");u+=a.style?"&style="+a.style:"",u+=a.href?"&href="+a.href:"",v.src=u,v.frameBorder="0",v.allowTransparency="true",v.scrolling="no",v.width="300px",v.height="400px";var f=y.getElementById(a.id);f.innerHTML="",f.appendChild(v)}i.WxLogin=p}(window,document);var showShareModal=function(i){$("html").css("overflow","auto"),$("body").css({height:"auto",overflow:"auto"}),document.getElementsByClassName("share-body-wrap")[0]&&(document.getElementsByClassName("share-body-wrap")[0].style.display=i?"block":"none")};$(function(){$("html").on("click",".js_budget",function(i){var y=$(this),r=y.data("scale")||0;layer.open({title:"\u6536\u76CA\u8BF4\u660E",content:'<div class="budget_layer_content">\u6BCF\u9080\u8BF7\u4E00\u4F4D\u597D\u53CB\u8D2D\u4E70</br>\u53EF\u83B7\u5F97<span class="gold">\u652F\u4ED8\u91D1\u989D\u7684</span><span class="per">'+r+"%</span>\u4F5C\u4E3A\u5956\u52B1</br>\u5177\u4F53\u91D1\u989D\u4EE5\u5B9E\u9645\u5230\u8D26\u4E3A\u51C6</div>",btn:"\u6211\u77E5\u9053\u4E86"}),i.stopPropagation()})});var head=document.getElementsByTagName("head")[0],link=document.createElement("link");link.type="text/css",link.rel="stylesheet",link.href="/design/designstatic/common/js/commonShare/dist/pcShare.css";var link1=document.createElement("link");link1.type="text/css",link1.rel="stylesheet",link1.href="/design/designstatic/common/js/commonShare/commonPicShare.css";var script1=document.createElement("script");script1.type="text/javascript",script1.charset="utf-8",script1.src="/design/designstatic/chatroom/js/jquery.qrcode.min.js";var script2=document.createElement("script");script2.type="text/javascript",script2.charset="utf-8",script2.src="/design/designstatic/common/js/commonShare/dist/social-share.js";var script3=document.createElement("script");script3.type="text/javascript",script3.charset="utf-8",script3.src="/design/designstatic/common/js/commonShare/dist/clipboard.min.js";var script4=document.createElement("script");script4.type="text/javascript",script4.charset="utf-8",script4.src="/design/designstatic/common/js/commonShare/slider-H5.js";var script5=document.createElement("script");script5.type="text/javascript",script5.charset="utf-8",script5.src="/design/designstatic/common/js/commonShare/commonPicShare.js",head.appendChild(link),head.appendChild(link1),head.appendChild(script1),head.appendChild(script2),head.appendChild(script3),head.appendChild(script4),head.appendChild(script5);