var cdnPath="",datime,tes=window.location.protocol,wapurl=window.location.origin+"/pages/wap/info.html"+window.location.search;/Android|webOS|iPhone|iPod|iPad|BlackBerry/i.test(navigator.userAgent)&&(window.location.href=wapurl),$(".coursetit ul li").on("click",function(){if(!$(this).hasClass("active")){$(".course .coursetit ul li").removeClass("active"),$(this).addClass("active"),$(".hides").hide();var e=$(this).attr("tabs");e==1?$(".hides:eq(0)").css("display","block"):e==2?$(".hides:eq(1)").css("display","block"):$(".hides:eq(2)").css("display","block")}});var hid=0,types="",futit,retit,rightTime,leftTime,upLoadClicktag=0,urls=location.search;if(urls.indexOf("?")!=-1)var ster=urls.substr(1),sty=ster.split("&"),cide=getShtmlUrl()?["",getShtmlUrl()]:sty[0].split("cid="),usid=ster.split("&uid=");var deusid=usid[1]?usid[1].split(","):[],urlpd=window.location.href,rtime,rtype,m3u8,cid,videoCover,pre,intro,gName,courid,cover,covers,deadline,personNumLimit,person,isInCart,incart,courseType,parid,play,userInfo,isOtherBtn,isOtherBtns,courseOnlyBalance,isShare=getPar("share"),sceneId=getPar("sceneId")||"",sceneType=getPar("sceneType")?getPar("sceneType"):0,globaCourseId,channels=getchannel();if(getPar("redirect"))var sourceurl=getPar("redirect")+(getPar("redirect").indexOf("?cwid=")>-1?"":"?cwid="+getPar("cwid"))+"&courseId="+getPar("courseId");var diliater="",onlydeusid=[];function encrypt(e){var a=CryptoJS.enc.Utf8.parse("njsdearr8h239ay3"),i=CryptoJS.enc.Utf8.parse(e),s=CryptoJS.AES.encrypt(i,a,{mode:CryptoJS.mode.ECB,padding:CryptoJS.pad.Pkcs7});return s.toString()}function decrypt(e){var a=CryptoJS.enc.Utf8.parse("njsdearr8h239ay3"),i=CryptoJS.AES.decrypt(e,a,{mode:CryptoJS.mode.ECB,padding:CryptoJS.pad.Pkcs7});return CryptoJS.enc.Utf8.stringify(i).toString()}function goCenterDetail(e){if(getPar("redirect"))window.location.href=sourceurl;else{var a=e||"";window.location.href="/myroom/#/learn/detail/"+globaCourseId+a}}function goBalance(){window.location.href="/myroom/#/personal/purse"}function request(e){var a=e.url,i=e.type||"GET",s=e.data,n=e.success,t=e.error||function(){},o=e.loading;o&&layer.load(2),$.ajax({headers:{token:getCookie("token")},type:i,url:a,contentType:"application/json",dataType:"json",data:s,async:!0,success:function(c){layer.closeAll(),n(c)},error:function(c){layer.closeAll(),t(c)}})}function getBtnStatus(e){var a=e.data||{},i=a.isOpenSignUp,s=a.isPay,n=a.price,t=a.isInCart,o=a.isLimit,c=a.courseType,l=a.isShareCourse,d=!1,p=!1,r=!1,u=!1,f=!1,v=!1;return i?s?d=!0:n===0?p=!0:(t?(r=!0,u=!0):r=!0,f=!0):(f=!0,r=!0,u=!0,v=!0),o||(u=!0,v=!0),+c==3&&l===0&&(u=!0,v=!0),{isStudy:d,isSign:p,isCart:r,cartDisabled:u,isBuy:f,buyDisabled:v}}function getDetailsInfo(e){$.ajax({headers:{token:getCookie("token")},type:"GET",url:"/api/course/getCourseDetail?projectid=12",data:{courseId:getShtmlUrl()||getPar("cid"),isFromLive:sceneType=="1"?1:void 0,sceneId:sceneId||void 0},dataType:"json",async:!1,success:function(a){e(a)}})}function isGoBundle(e){var a=e.courseType;if(a==="2"||a==="4"){var i=window.location.origin+"/pages/bundle.html"+window.location.search;window.location.href=i}}function getShtmlUrl(){for(var e=location.href.split("/"),a=0,i=e.length;a-1)return s.split(".shtml")[0]}return!1}var courseInfo={init:function(e,a){var i=this;i.callback=e,i.detailBack=a,i.upLoadClicktag=0,i.getLoginUser(),i.getCourseDetail()},getLoginUser:function(){var e=this,a={url:"/api/jwt/getLoginUser?projectid=45",type:"GET",data:{},success:function(i){e.loginEvent(i)},error:function(){},loading:!1};e.request(a)},loginEvent:function(e){var a=this;if(e.code==200){a.callback&&a.callback(e);var i=e.data.userId;userInfo=e.data;for(var s="",n="",t="\u8BFE\u7A0B\u8BE6\u60C5",o="",c=deusid,l=[],d=0;d\u8BE5\u8BFE\u7A0B\u4E0D\u5B58\u5728'))},error:function(){},loading:!1};e.request(a)},renderDetail:function(e){var a=this;a.isGoBundle(e),a.detailBack&&a.detailBack(e);var i=window.location.href,s=e.data||{};cid=s.courseId,pre=s.price,intro=s.introduce,gName=s.courseName,courid=s.courseId,courseOnlyBalance=s.courseOnlyBalance,globaCourseId=s.courseId,a.nowSeverTimeStamp=e.timeStamp,cover=s.cover,covers=a.converImg(s),play=s.isPay,deadline=s.deadline,videoCover=s.videoCover,retit=s.courseName,hid=s.activityId,personNumLimit=s.personNumLimit,person=s.personNumLimit-s.personNumCount,isInCart=s.isInCart;var n=!s.isLimit,t=s.courseType,o=s.isShareCourse,c=s.isShopBudget||0,l=c?'':"";if(+t==3&&o===0&&(n=!0),isOtherBtns=!(s.isOpenSignUp&&s.isPay),isOtherBtn=!(s.isOpenSignUp||s.isPay),types=s.type,t=s.courseType,s.courseType==3){var d=3;a.ctype=3}else{var d=1;a.ctype=1}incart=s.isInCart;var p=location.search;if(p.indexOf("?")!=-1)var r=p.substr(1),u=r.split("&"),f=getShtmlUrl()?["",getShtmlUrl()]:u[0].split("cid="),v=r.split("&uid=");var h=window.location.origin+window.location.pathname+"?"+r,b=getPar("diliater")||"",w=decrypt(b)?decrypt(b).split(","):[];parid=s.parentCourseId;var T=new Array,L=new Array,O=new Array;O[0]=courid,s.parentCourseId==0?(L[0]={goodsId:courid,price:pre,goodsUrl:h,goodsType:d,goodsName:gName,cover:covers,operateType:1,introduce:intro,endTime:deadline},T[0]={courseId:courid,courseName:gName,orderTitle:gName,orderType:d,price:pre,firstLevelId:w[1],secondLevelId:w[2],thirdLevelId:w[3]},courseOnlyBalance==1&&(T[0].paymentSource="6"),sceneType==1&&(T[0].sceneType="1",T[0].sceneId=sceneId)):(L[0]={goodsId:courid,price:pre,goodsUrl:h,goodsType:d,goodsName:gName,cover:covers,sourceSchoolCourseId:parid,operateType:1,introduce:intro,endTime:deadline},T[0]={courseId:courid,courseName:gName,orderTitle:gName,orderType:d,price:pre,firstLevelId:w[1],secondLevelId:w[2],thirdLevelId:w[3],sourceSchoolCourseId:parid},courseOnlyBalance==1&&(T[0].paymentSource="6"),sceneType==1&&(T[0].sceneType="1",T[0].sceneId=sceneId)),a.renderCover(s),a.renderMainHtml(s);var A=$(".coursemain").html(s.detail);A.find("img").length<1&&A.text()==""&&($(".coursemain").html("
"),$("li[tabs=1]").removeClass("active"),$("li[tabs=2]").addClass("active"),$(".hides").hide(),$(".hides:eq(1)").css("display","block")),$(".curcoll").on("click",function(){channels=getchannel(),user.isLogin(function(m){parseInt(m.code)==200?$.ajax({headers:{token:getCookie("token")},type:"GET",url:"/api/course/collectCourse?projectid=37",contentType:"application/json",dataType:"json",async:!0,data:{courseId:courid,pvid:channels.pvid,uvcid:channels.uvcid,shareUserId:channels.shareUserId,clientType:channels.channel},success:function(g){$(".curcoll").hide(),$(".curcolls").show()}}):parseInt(m.code)==401||parseInt(m.code)==403?user.loginLayer(function(g){g.success&&courseInfo.init()}):layer.alert("\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458\uFF01")})}),$(".curcolls").on("click",function(){user.isLogin(function(m){parseInt(m.code)==200?$.ajax({headers:{token:getCookie("token")},type:"GET",url:"/api/course/cancelCollectCourse?projectid=37",data:{courseId:courid},dataType:"json",async:!0,success:function(g){$(".curcolls").hide(),$(".curcoll").show()}}):parseInt(m.code)==401||parseInt(m.code)==403?user.loginLayer(function(g){g.success&&courseInfo.init()}):layer.alert("\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458\uFF01")})});var D="/static/front/images/shareBackground.png",k=s;if(a.shareEvent=function(){k.userInfo=userInfo,k.iscourse=!0,k.cover=covers,user.isLogin(function(m){if(parseInt(m.code)==200){var g=window.imgEditor,S=this,N=m.data.userId,j=window.location.href;g.shareLayer(j,D,function(y){y.success||S.unlogin()},k)}else parseInt(m.code)==401||parseInt(m.code)==403?user.loginLayer(function(y){y.success&&courseInfo.init()}):layer.alert("\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458\uFF01")})},isShare==!0||isShare=="true")var E=setInterval(function(){window.imgEditor&&(clearInterval(E),a.shareEvent())},300);a.bindEvent(),a.res=s,a.limitDisabled=n,a.goodsList=L,a.orderList=T,types==2&&($(".shaste").show(),$(".coursetit li").addClass("lione"),$.ajax({headers:{token:getCookie("token")},type:"GET",url:"/api/operate/listByActivityId?projectid=43",data:{groupActivityId:hid},dataType:"json",async:!0,success:function(m){var g=m.data.list||[],S=m.timeStamp;function N(){for(var y="",I=0,x=g.length;I=0){var q=deadTime(C),U=g[I].groupLimit-g[I].groupCount,P=g[I].realName||"",F=P.length>0?P:g[I].loginName;y+='
',y+=''+F+"",y+='\u53BB\u62FC\u56E2',y+='
',y+='\u8FD8\u5DEE'+U+"\u4EBA\u62FC\u6210",y+='\u5269\u4F59'+q+"",y+="
",y+="
"}}y===""?$(".tuanlist").html("
"):$(".tuanlist").html(y)}N();function j(){for(var y=0,I=g.length;y=0){var C=deadTime(x);$(".js_pt_time"+y).html(C)}else $(".js_pt_time"+y).parents(".jstsde").hide()}}g.length>0&&setInterval(function(){j(),S+=1e3},1e3),$("body").on("click",".ptbtn",function(){var y=$(this).data("tuan");user.isLogin(function(I){if(parseInt(I.code)==200)if(I.data.userTypeExact=="STUDENT")if(play==!0)goCenterDetail();else{layer.open({type:1,offset:"300px",title:"\u8BF7\u626B\u63CF\u4E8C\u7EF4\u7801",content:'
'});var x=window.location.origin+"/pages/wap/group.html?cid="+f[1]+"&did="+hid+"&fid="+y,C=new QRCode("qrcode",{text:x,width:200,height:200})}else layer.alert("\u53EA\u6709\u5B66\u751F\u8D26\u53F7\u624D\u80FD\u62FC\u56E2\uFF01");else parseInt(I.code)==401||parseInt(I.code)==403?user.loginLayer(function(B){B.success&&courseInfo.init()}):layer.alert("\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458\uFF01")})})}})),$.ajax({type:"GET",headers:{token:getCookie("token")},url:"/api/school/getSubheadByHostName?projectid=12",contentType:"application/json",dataType:"json",data:{},async:!0,success:function(m){m.data.subhead?futit="-"+m.data.subhead:futit="";var g="";g=retit+futit,$("title").html(g)}})},getCourseTeacherInfo:function(e){var a=this,i={url:"/api/course/getCourseTeacherInfo",type:"GET",data:{courseId:getShtmlUrl()||getPar("cid")},success:function(s){s.success&&a.renderTeacherInfo(s.data)},error:function(){},loading:!1};a.request(i)},renderTeacherInfo:function(e){var a=this,i=e.teacherList,s=i.length,n="";if($(".rightInfoBox").css({opacity:1}),$(".teacherBox .cardHeader").html("\u6388\u8BFE\u6559\u5E08"+(s>1?"\uFF08"+s+"\uFF09":"")),s>1){var t=$(".sildeBox .scrollBarBox"),o=$(".sildeBox .leftBtn"),c=$(".sildeBox .rightBtn"),l=0;t.width(s*248),o.show(),c.show().addClass("disabled");var d=s-1;o.on("click",function(){l++,c.removeClass("disabled"),l>=d&&(l=d,o.addClass("disabled")),t.css({transform:"translateX(-"+248*l+"px)"})}),c.on("click",function(){l--,o.removeClass("disabled"),l<=0&&(l=0,c.addClass("disabled")),t.css({transform:"translateX(-"+248*l+"px)"})})}for(var p=0,r=s;p

'+u.realName+'

'+u.className+'

\u4E2A\u4EBA\u7B80\u4ECB\uFF1A'+(u.introduction||"\u6682\u65E0")+"
"}$(".teacherScrollBox .scrollBarBox").html(n);var f=e.course,v='

\u6240\u5C5E\u9662\u7CFB: '+(f.className||"\u672C\u6821")+"

\u9009\u8BFE\u5B66\u751F\u6570\uFF1A"+f.personNumCount+"

\u8BFE\u7A0B\u8D44\u6E90\u6570\uFF1A"+f.attachmentCount+"

\u89C6\u9891\u8D44\u6E90\u6570\uFF1A "+f.videoWareCount+"

\u95EE\u7B54\u533A\u63D0\u95EE\u6570\uFF1A "+f.answeringQuestionCount+"

\u95EE\u7B54\u533A\u56DE\u7B54\u6570\uFF1A "+f.answerCount+"

\u4F5C\u4E1A\u6570\uFF1A"+f.taskCount+"

\u95EE\u5377\u6570\uFF1A"+f.questionCount+"

\u5377\u5E93\u8BD5\u5377\uFF1A"+f.wareQuestionCount+"

";$(".infoAmountBox .infoList").html(v)},renderCover:function(e){var a=e.videoCover,i="";a?(m3u8=e.videoCoverPath,i='':"",t='

'+e.courseName+"

";if(e.childClassifyName=="")t+='

'+e.mainClassifyName+"

";else{var o=(e.classifyNamePath||"").replace(/\,/g," > ");t+='

'+o+"

"}t+=''+e.playLengthCount+"\u8BFE\u65F6",e.isFavorite==!0?t+='\u5DF2\u6536\u85CF':t+='\u6536\u85CF',t+='\u5206\u4EAB'+n+'

';r+='\u9650\u65F6\u79D2\u6740',r+='

',rightTime>=0?(r+='\u8DDD\u79BB\u79D2\u6740\u5F00\u59CB\u8FD8\u6709',r+='\u5929',r+=':',r+=':',r+=''):leftTime>=0?(r+='\u8DDD\u79BB\u79D2\u6740\u7ED3\u675F\u8FD8\u6709',r+='00\u5929',r+='00:',r+='00:',r+='00'):r+="\u6D3B\u52A8\u7ED3\u675F",r+="
",r+="",r+='

',r+='\u5E73\u53F0\u4F7F\u7528\u8D39',r+='\uFFE5'+(s.price/100).toFixed(2)+"",r+='\uFFE5'+((a.marketPrice?a.marketPrice:s.oldPrice)/100).toFixed(2)+"",a.deadline==0?r+='\u81EA\u62A5\u540D\u4E4B\u65E5\u8D77\u6C38\u4E45\u6709\u6548':a.isPay?deteTime(i.syTime)>=1?r+='\u6709\u6548\u671F\u5269\u4F59'+deteTime(i.syTime)+"\u5929":r+='\u6709\u6548\u671F\u4E0D\u8DB3'+(i.syTime>864e5?deteTime(i.syTime):1)+"\u5929":r+='\u81EA\u62A5\u540D\u4E4B\u65E5\u8D77'+a.deadline+"\u5929\u6709\u6548",r+="

",rightTime>=0?(e.data.flashBuyCount==s.flashBuyLimit?r+='\u5DF2\u62A2\u5B8C':r+='\u9650\u65F6\u79D2\u6740\uFFE5'+(s.price/100).toFixed(2)+"",a.isPay==!0?r+='\u8FDB\u5165\u5B66\u4E60':isOtherBtn||i.limitDisabled?r+='\u76F4\u63A5\u5F00\u901A\uFFE5'+(s.oldPrice/100).toFixed(2)+"":r+='\u76F4\u63A5\u5F00\u901A\uFFE5'+(s.oldPrice/100).toFixed(2)+""):e.data.flashBuyCount==s.flashBuyLimit?(a.isPay==!0?r+='\u8FDB\u5165\u5B66\u4E60':isOtherBtn||i.limitDisabled?r+='\u76F4\u63A5\u5F00\u901A\uFFE5'+(s.oldPrice/100).toFixed(2)+"":r+='\u76F4\u63A5\u5F00\u901A\uFFE5'+(s.oldPrice/100).toFixed(2)+"",r+='\u5DF2\u62A2\u5B8C'):(a.isPay==!0?r+='\u8FDB\u5165\u5B66\u4E60':isOtherBtn||i.limitDisabled?r+='\u9650\u65F6\u79D2\u6740\uFFE5'+(s.price/100).toFixed(2)+"":r+='\u9650\u65F6\u79D2\u6740\uFFE5'+(s.price/100).toFixed(2)+"",r+='',r+="\u5DF2\u62A2"+n+'%',r+='',r+="",r+=""),$(".curwithin").append(r)},seckillOpen:function(e,a){var i=this,s=i.rem,n=i.ctype,t=window.location.href;$(".opening").on("click",function(){if(channels=getchannel(),i.upLoadClicktag==0){if(i.upLoadClicktag=1,isOtherBtn||i.limitDisabled)return;var o=new Array,c=new Array,l=[courid],d=s.oldPrice;if(a.parentCourseId==0?(o[0]={goodsId:courid,price:d,goodsUrl:t,goodsType:n,goodsName:gName,cover:covers,operateType:1,introduce:intro,endTime:deadline},c[0]={activityType:"1",courseId:courid,courseName:gName,orderTitle:gName,orderType:n,price:d,firstLevelId:deusid[1],secondLevelId:deusid[2],thirdLevelId:deusid[3]},courseOnlyBalance==1&&(c[0].paymentSource="6",c[0].activityId=hid),sceneType==1&&(c[0].sceneType="1",c[0].sceneId=sceneId)):(o[0]={goodsId:courid,price:d,goodsUrl:t,goodsType:n,goodsName:gName,cover:covers,sourceSchoolCourseId:parid,operateType:1,introduce:intro,endTime:deadline},c[0]={activityType:"1",courseId:courid,courseName:gName,orderTitle:gName,orderType:n,price:d,firstLevelId:deusid[1],secondLevelId:deusid[2],thirdLevelId:deusid[3],sourceSchoolCourseId:parid},courseOnlyBalance==1&&(c[0].paymentSource="6",c[0].activityId=hid),sceneType==1&&(c[0].sceneType="1",c[0].sceneId=sceneId)),a.isPay){goCenterDetail();return}i.isBuyState(function(p){parseInt(p.code)==200?courseOnlyBalance==1?layer.open({type:1,offset:"auto",title:"\u8BF7\u786E\u8BA4",skin:"balancepay-class",area:["300px","150px"],content:d>0?"\u8BE5\u8BFE\u7A0B\u9700\u8981\u6D88\u8017"+d/100+"\u4F59\u989D":"\u786E\u8BA4\u514D\u8D39\u5F00\u901A\u8BE5\u8BFE\u7A0B",btn:["\u53D6\u6D88","\u786E\u8BA4\u52A0\u5165"],btnAlign:"c",yes:function(r,u){layer.closeAll()},btn2:function(r,u){diliater=getPar("diliater")||"",onlydeusid=decrypt(diliater)?decrypt(diliater).split(","):[],c[0].firstLevelId=onlydeusid[1],c[0].secondLevelId=onlydeusid[2],c[0].thirdLevelId=onlydeusid[3],channels.orderList=c,request({url:"/api/order/createOrder?projectid=22",data:JSON.stringify(channels),type:"POST",loading:!0,success:function(f){var v=f.code;f&&f.success?layer.open({type:1,offset:"auto",title:"\u52A0\u5165\u6210\u529F",skin:"balancepay-class",area:["300px","150px"],content:"\u524D\u5F80\u5B66\u4E60\u4E2D\u5FC3\u53EF\u76F4\u63A5\u5F00\u59CB\u5B66\u4E60",btn:["\u518D\u901B\u901B","\u7ACB\u5373\u524D\u5F80"],btnAlign:"c",yes:function(h,b){layer.closeAll()},btn2:function(h,b){goCenterDetail("?payCom=1"),layer.closeAll()}}):v=="605"?layer.open({type:1,offset:"auto",title:"\u4F59\u989D\u4E0D\u8DB3",skin:"balancepay-class",area:["300px","150px"],content:"\u8BF7\u5145\u503C\u540E\u518D\u8BD5",btn:["\u5173\u95ED","\u7ACB\u5373\u524D\u5F80"],btnAlign:"c",yes:function(h,b){layer.closeAll()},btn2:function(h,b){goBalance(),layer.closeAll()}}):layer.open({type:1,offset:"auto",title:"\u63D0\u793A",skin:"balancepay-class",area:["300px","150px"],content:f.message||"\u62A5\u540D\u5931\u8D25",btn:["\u5173\u95ED"],btnAlign:"c",yes:function(h,b){layer.closeAll()}})}})}}):i.delShoppingCart(o,l):parseInt(p.code)==401||parseInt(p.code)==403?user.loginLayer(function(r){parseInt(r.code)==200}):layer.alert("\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458\uFF01")}),setTimeout(function(){i.upLoadClicktag=0},300)}})},seckillBuy:function(e,a){var i=this,s=a.activityId,n=i.rem,t=i.ctype;$(".seckill").on("click",function(){if(channels=getchannel(),i.upLoadClicktag==0){if(i.upLoadClicktag=1,isOtherBtn||i.limitDisabled)return;if(i.rightTime<0){var o=window.location.href+"&bid="+s,c=new Array,l=new Array,d=[courid],p=n.price;if(a.parentCourseId==0?(c[0]={goodsId:courid,price:p,goodsUrl:o,goodsType:t,goodsName:gName,cover:covers,operateType:3,introduce:intro,endTime:deadline},l[0]={activityType:"2",courseId:courid,courseName:gName,orderTitle:gName,orderType:t,price:p,firstLevelId:deusid[1],secondLevelId:deusid[2],thirdLevelId:deusid[3]},courseOnlyBalance==1&&(l[0].paymentSource="6",l[0].activityId=hid),sceneType==1&&(l[0].sceneType="1",l[0].sceneId=sceneId)):(c[0]={goodsId:courid,price:p,goodsUrl:o,goodsType:t,goodsName:gName,cover:covers,sourceSchoolCourseId:parid,operateType:3,introduce:intro,endTime:deadline},l[0]={activityType:"2",courseId:courid,courseName:gName,orderTitle:gName,orderType:t,price:p,firstLevelId:deusid[1],secondLevelId:deusid[2],thirdLevelId:deusid[3],sourceSchoolCourseId:parid},courseOnlyBalance==1&&(l[0].paymentSource="6",l[0].activityId=hid),sceneType==1&&(l[0].sceneType="1",l[0].sceneId=sceneId)),a.isPay){goCenterDetail();return}i.isBuyState(function(r){parseInt(r.code)==200?courseOnlyBalance==1?layer.open({type:1,offset:"auto",title:"\u8BF7\u786E\u8BA4",skin:"balancepay-class",area:["300px","150px"],content:p>0?"\u8BE5\u8BFE\u7A0B\u9700\u8981\u6D88\u8017"+p/100+"\u4F59\u989D":"\u786E\u8BA4\u514D\u8D39\u5F00\u901A\u8BE5\u8BFE\u7A0B",btn:["\u53D6\u6D88","\u786E\u8BA4\u52A0\u5165"],btnAlign:"c",yes:function(u,f){layer.closeAll()},btn2:function(u,f){diliater=getPar("diliater")||"",onlydeusid=decrypt(diliater)?decrypt(diliater).split(","):[],l[0].firstLevelId=onlydeusid[1],l[0].secondLevelId=onlydeusid[2],l[0].thirdLevelId=onlydeusid[3],channels.orderList=l,request({url:"/api/order/createOrder?projectid=22",data:JSON.stringify(channels),type:"POST",loading:!0,success:function(v){var h=v.code;v&&v.success?layer.open({type:1,offset:"auto",title:"\u52A0\u5165\u6210\u529F",skin:"balancepay-class",area:["300px","150px"],content:"\u524D\u5F80\u5B66\u4E60\u4E2D\u5FC3\u53EF\u76F4\u63A5\u5F00\u59CB\u5B66\u4E60",btn:["\u518D\u901B\u901B","\u7ACB\u5373\u524D\u5F80"],btnAlign:"c",yes:function(b,w){layer.closeAll()},btn2:function(b,w){goCenterDetail("?payCom=1"),layer.closeAll()}}):h=="605"?layer.open({type:1,offset:"auto",title:"\u4F59\u989D\u4E0D\u8DB3",skin:"balancepay-class",area:["300px","150px"],content:"\u8BF7\u5145\u503C\u540E\u518D\u8BD5",btn:["\u5173\u95ED","\u7ACB\u5373\u524D\u5F80"],btnAlign:"c",yes:function(b,w){layer.closeAll()},btn2:function(b,w){goBalance(),layer.closeAll()}}):layer.open({type:1,offset:"auto",title:"\u63D0\u793A",skin:"balancepay-class",area:["300px","150px"],content:v.message||"\u62A5\u540D\u5931\u8D25",btn:["\u5173\u95ED"],btnAlign:"c",yes:function(b,w){layer.closeAll()}})}})}}):i.delShoppingCart(c,d):parseInt(r.code)==401||parseInt(r.code)==403?user.loginLayer(function(u){parseInt(u.code)==200}):layer.alert("\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458\uFF01")})}setTimeout(function(){i.upLoadClicktag=0},300)}})},renderGroup:function(e){var a=this,i=e.activityId,s={url:"/api/operate/pcGroupActiviy?projectid=43",type:"GET",data:{groupActivityId:i},success:function(n){var t=n.data;a.renderGroupDom(t,e),a.groupAloneBuy(t,e),a.groupBuy(t,e)}};a.request(s)},renderGroupDom:function(e,a){var i=this,s=i.syTime,n=e.groupFoundId,t='

';a.price==0?t+='\u514D\u8D39':(t+='\u5E73\u53F0\u4F7F\u7528\u8D39',t+='\uFFE5'+(e.price/100).toFixed(2)+""),a.marketPrice>0&&(t+='\uFFE5'+(a.marketPrice/100).toFixed(2)+""),t+="

",a.deadline==0?t+='

\u81EA\u62A5\u540D\u4E4B\u65E5\u8D77\u6C38\u4E45\u6709\u6548

':a.isPay?deteTime(i.syTime)>=1?t+='

\u6709\u6548\u671F\u5269\u4F59'+deteTime(i.syTime)+"\u5929

":t+='

\u6709\u6548\u671F\u4E0D\u8DB3'+(i.syTime>864e5?deteTime(i.syTime):1)+"\u5929

":t+='

\u81EA\u62A5\u540D\u4E4B\u65E5\u8D77'+a.deadline+"\u5929\u6709\u6548

",a.isPay==!0?t+='\u8FDB\u5165\u5B66\u4E60':i.isOtherBtn||i.limitDisabled?(e.type==0?t+='\u53D1\u8D77\u62FC\u56E2\uFFE5'+(e.price/100).toFixed(2)+"":t+='\u627E\u5C0F\u4F19\u4F34\u4E00\u8D77\u62FC\u56E2',t+='\u5355\u72EC\u62A5\u540D\uFFE5'+(e.oldPrice/100).toFixed(2)+""):(e.type==0?t+='\u53D1\u8D77\u62FC\u56E2\uFFE5'+(e.price/100).toFixed(2)+"":t+='\u627E\u5C0F\u4F19\u4F34\u4E00\u8D77\u62FC\u56E2',t+='\u5355\u72EC\u62A5\u540D\uFFE5'+(e.oldPrice/100).toFixed(2)+""),$(".curwithin").append(t)},groupAloneBuy:function(e,a){var i=this;$(".opening").on("click",function(){if(channels=getchannel(),i.upLoadClicktag==0){if(i.upLoadClicktag=1,i.isOtherBtn||i.limitDisabled)return;var s=+a.courseType==3?3:1,n=e.oldPrice,t=[{goodsId:courid,price:n,goodsUrl:window.location.href,goodsType:s,goodsName:gName,cover:covers,operateType:1,introduce:intro,endTime:deadline}],o=[{activityType:"1",courseId:courid,courseName:gName,orderTitle:gName,orderType:s,price:n,firstLevelId:deusid[1],secondLevelId:deusid[2],thirdLevelId:deusid[3]}],c=[courid];if(courseOnlyBalance==1&&(o[0].paymentSource="6"),sceneType==1&&(o[0].sceneType="1",o[0].sceneId=sceneId),a.isPay){goCenterDetail();return}i.isBuyState(function(l){parseInt(l.code)==200?courseOnlyBalance==1?layer.open({type:1,offset:"auto",title:"\u8BF7\u786E\u8BA4",skin:"balancepay-class",area:["300px","150px"],content:n>0?"\u8BE5\u8BFE\u7A0B\u9700\u8981\u6D88\u8017"+n/100+"\u4F59\u989D":"\u786E\u8BA4\u514D\u8D39\u5F00\u901A\u8BE5\u8BFE\u7A0B",btn:["\u53D6\u6D88","\u786E\u8BA4\u52A0\u5165"],btnAlign:"c",yes:function(d,p){layer.closeAll()},btn2:function(d,p){diliater=getPar("diliater")||"",onlydeusid=decrypt(diliater)?decrypt(diliater).split(","):[],o[0].firstLevelId=onlydeusid[1],o[0].secondLevelId=onlydeusid[2],o[0].thirdLevelId=onlydeusid[3],channels.orderList=o,request({url:"/api/order/createOrder?projectid=22",data:JSON.stringify(channels),type:"POST",loading:!0,success:function(r){var u=r.code;r&&r.success?layer.open({type:1,offset:"auto",title:"\u52A0\u5165\u6210\u529F",skin:"balancepay-class",area:["300px","150px"],content:"\u524D\u5F80\u5B66\u4E60\u4E2D\u5FC3\u53EF\u76F4\u63A5\u5F00\u59CB\u5B66\u4E60",btn:["\u518D\u901B\u901B","\u7ACB\u5373\u524D\u5F80"],btnAlign:"c",yes:function(f,v){layer.closeAll()},btn2:function(f,v){goCenterDetail("?payCom=1"),layer.closeAll()}}):u=="605"?layer.open({type:1,offset:"auto",title:"\u4F59\u989D\u4E0D\u8DB3",skin:"balancepay-class",area:["300px","150px"],content:"\u8BF7\u5145\u503C\u540E\u518D\u8BD5",btn:["\u5173\u95ED","\u7ACB\u5373\u524D\u5F80"],btnAlign:"c",yes:function(f,v){layer.closeAll()},btn2:function(f,v){goBalance(),layer.closeAll()}}):layer.open({type:1,offset:"auto",title:"\u63D0\u793A",skin:"balancepay-class",area:["300px","150px"],content:r.message||"\u62A5\u540D\u5931\u8D25",btn:["\u5173\u95ED"],btnAlign:"c",yes:function(f,v){layer.closeAll()}})}})}}):n==0?i.createOrder(o):i.delShoppingCart(t,c):parseInt(l.code)==401||parseInt(l.code)==403?user.loginLayer(function(d){d.success&&courseInfo.init()}):layer.alert("\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458\uFF01")}),setTimeout(function(){i.upLoadClicktag=0},300)}})},createOrder:function(e){var a=this;channels=getchannel(),channels.orderList=e;var i={url:"/api/order/createOrder?projectid=22",data:JSON.stringify(channels),type:"POST",loading:!0,success:function(s){s&&s.success?layer.open({type:1,offset:"auto",content:'
\u62A5\u540D\u6210\u529F\uFF0C\u8FDB\u5165\u5B66\u4E60\u4E2D\u5FC3\uFF01
',btn:"\u786E\u8BA4",btnAlign:"c",yes:function(){goCenterDetail("?payCom=1"),layer.closeAll()}}):layer.alert(s.message||"\u62A5\u540D\u5931\u8D25")}};a.request(i)},delShoppingCart:function(e,a){var i=this,s={type:"GET",url:"/api/order/shoppingCartList?projectid=22",success:function(n){if(n.data.shoppingCart=="")i.requestShoppingCart(e);else{for(var t=JSON.parse(n.data.shoppingCart),o=!1,c=0,l=t.length;c'});var n=new QRCode("qrcode",{text:window.location.origin+"/pay/#/shopping?type=1&isLeader=1",width:200,height:200})}else window.location.href="/pay/#/shopping"+(e[0].operateType=="3"?"?type=1":"")}};a.request(i)},groupBuy:function(e,a){var i=this;$(".seckill").on("click",function(){if(console.log(e.groupFoundId),i.upLoadClicktag==0){if(i.upLoadClicktag=1,i.isOtherBtn||i.limitDisabled)return;var s=+a.courseType==3?3:1,n=+a.courseType==3?3:1,t=e.price,o=window.location.href+"&bid="+hid+"&bType=1",c=[{goodsId:courid,price:t,goodsUrl:o,goodsType:s,goodsName:gName,cover:covers,operateType:2,introduce:intro,endTime:deadline}],l=[{activityType:"3",courseId:courid,courseName:gName,orderTitle:gName,orderType:n,price:t,firstLevelId:deusid[1],secondLevelId:deusid[2],thirdLevelId:deusid[3]}],d=[courid];courseOnlyBalance==1&&(l[0].paymentSource="6"),sceneType==1&&(l[0].sceneType="1",l[0].sceneId=sceneId),user.isLogin(function(p){if(parseInt(p.code)==200)if(p.data.userTypeExact=="STUDENT")if(play==!0)goCenterDetail();else if(e.type==0)i.QRCodeLayer=!0,i.delShoppingCart(c,d);else{layer.open({type:1,offset:"300px",title:"\u8BF7\u626B\u63CF\u4E8C\u7EF4\u7801",content:'
'});var r=window.location.origin,u=new QRCode("qrcode",{text:r+"/pages/wap/group.html?cid="+cide[1]+"&did="+hid+"&fid="+fid,width:200,height:200})}else layer.alert("\u53EA\u6709\u5B66\u751F\u8D26\u53F7\u624D\u80FD\u62A5\u540D\uFF01");else parseInt(p.code)==401||parseInt(p.code)==403?user.loginLayer(function(f){f.success&&courseInfo.init()}):layer.alert("\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458\uFF01")}),setTimeout(function(){i.upLoadClicktag=0},300)}})},renderBargain:function(e){var a=this,i={type:"GET",url:"/api/operate/pcBargainActivity?projectid=43",data:{bargainActivityId:hid},success:function(s){var n=s.data;a.renderBargainDom(n,e),a.bargainOpen(n,e),a.bargainBuy(n,e)}};a.request(i)},renderBargainDom:function(e,a){var i=this,s=e.bargainActivityId,n='

';a.price==0?n+='\u514D\u8D39':(n+='\u5E73\u53F0\u4F7F\u7528\u8D39',n+='\uFFE5'+(e.price/100).toFixed(2)+""),a.marketPrice>0&&(n+='\uFFE5'+(a.marketPrice/100).toFixed(2)+""),n+="

",a.deadline==0?n+='

\u81EA\u62A5\u540D\u4E4B\u65E5\u8D77\u6C38\u4E45\u6709\u6548

':a.isPay?deteTime(i.syTime)>=1?n+='

\u6709\u6548\u671F\u5269\u4F59'+deteTime(i.syTime)+"\u5929

":n+='

\u6709\u6548\u671F\u4E0D\u8DB3'+(syTime>864e5?deteTime(i.syTime):1)+"\u5929

":n+='

\u81EA\u62A5\u540D\u4E4B\u65E5\u8D77'+a.deadline+"\u5929\u6709\u6548

",a.isPay==!0?n+='\u8FDB\u5165\u5B66\u4E60':isOtherBtn||i.limitDisabled?(e.type==0?n+='\u53EF\u780D\u81F3\uFFE5'+(e.price/100).toFixed(2)+"":n+='\u627E\u5C0F\u4F19\u4F34\u4E00\u8D77\u780D\u4EF7',n+='\u76F4\u63A5\u5F00\u901A\uFFE5'+(e.oldPrice/100).toFixed(2)+""):(e.type==0?n+='\u53EF\u780D\u81F3\uFFE5'+(e.price/100).toFixed(2)+"":n+='\u627E\u5C0F\u4F19\u4F34\u4E00\u8D77\u780D\u4EF7',n+='\u76F4\u63A5\u5F00\u901A\uFFE5'+(e.oldPrice/100).toFixed(2)+""),$(".curwithin").append(n)},bargainOpen:function(e,a){var i=this,s=window.location.href,n=e.bargainActivityId;$(".opening").on("click",function(){if(channels=getchannel(),i.upLoadClicktag==0){if(i.upLoadClicktag=1,isOtherBtn||i.limitDisabled)return;var t=e.oldPrice,o=i.ctype;diliater=getPar("diliater")||"",onlydeusid=decrypt(diliater)?decrypt(diliater).split(","):[];var c=[{goodsId:courid,price:t,goodsUrl:s,goodsType:o,goodsName:gName,cover:covers,operateType:1,introduce:intro,endTime:deadline}],l=[{activityType:"1",courseId:courid,courseName:gName,orderTitle:gName,orderType:o,price:t,firstLevelId:deusid[1],secondLevelId:deusid[2],thirdLevelId:deusid[3]}],d=[courid];if(courseOnlyBalance==1&&(l[0].paymentSource="6",l[0].firstLevelId=onlydeusid[1],l[0].secondLevelId=onlydeusid[2],l[0].thirdLevelId=onlydeusid[3]),sceneType==1&&(l[0].sceneType="1",l[0].sceneId=sceneId),a.isPay){goCenterDetail();return}i.isBuyState(function(p){parseInt(p.code)==200?courseOnlyBalance==1?layer.open({type:1,offset:"auto",title:"\u8BF7\u786E\u8BA4",skin:"balancepay-class",area:["300px","150px"],content:t>0?"\u8BE5\u8BFE\u7A0B\u9700\u8981\u6D88\u8017"+t/100+"\u4F59\u989D":"\u786E\u8BA4\u514D\u8D39\u5F00\u901A\u8BE5\u8BFE\u7A0B",btn:["\u53D6\u6D88","\u786E\u8BA4\u52A0\u5165"],btnAlign:"c",yes:function(r,u){layer.closeAll()},btn2:function(r,u){diliater=getPar("diliater")||"",onlydeusid=decrypt(diliater)?decrypt(diliater).split(","):[],l[0].firstLevelId=onlydeusid[1],l[0].secondLevelId=onlydeusid[2],l[0].thirdLevelId=onlydeusid[3],channels.orderList=l,request({url:"/api/order/createOrder?projectid=22",data:JSON.stringify(channels),type:"POST",loading:!0,success:function(f){var v=f.code;f&&f.success?layer.open({type:1,offset:"auto",title:"\u52A0\u5165\u6210\u529F",skin:"balancepay-class",area:["300px","150px"],content:"\u524D\u5F80\u5B66\u4E60\u4E2D\u5FC3\u53EF\u76F4\u63A5\u5F00\u59CB\u5B66\u4E60",btn:["\u518D\u901B\u901B","\u7ACB\u5373\u524D\u5F80"],btnAlign:"c",yes:function(h,b){layer.closeAll()},btn2:function(h,b){goCenterDetail("?payCom=1"),layer.closeAll()}}):v=="605"?layer.open({type:1,offset:"auto",title:"\u4F59\u989D\u4E0D\u8DB3",skin:"balancepay-class",area:["300px","150px"],content:"\u8BF7\u5145\u503C\u540E\u518D\u8BD5",btn:["\u5173\u95ED","\u7ACB\u5373\u524D\u5F80"],btnAlign:"c",yes:function(h,b){layer.closeAll()},btn2:function(h,b){goBalance(),layer.closeAll()}}):layer.open({type:1,offset:"auto",title:"\u63D0\u793A",skin:"balancepay-class",area:["300px","150px"],content:f.message||"\u62A5\u540D\u5931\u8D25",btn:["\u5173\u95ED"],btnAlign:"c",yes:function(h,b){layer.closeAll()}})}})}}):t==0?i.createOrder(l):i.delShoppingCart(c,d):parseInt(p.code)==401||parseInt(p.code)==403?user.loginLayer(function(r){r.success&&courseInfo.init()}):layer.alert("\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458\uFF01")}),setTimeout(function(){upLoadClicktag=0},300)}})},bargainBuy:function(e,a){var i=this,s=e.bargainActivityId;$(".seckill").on("click",function(){if(i.upLoadClicktag==0){if(i.upLoadClicktag=1,isOtherBtn||i.limitDisabled)return;user.isLogin(function(n){if(parseInt(n.code)==200)if(n.data.userTypeExact=="STUDENT"){var t=getPar("diliater"),o=decrypt(t)||"",c=o.split(",");if(e.type==0)$.ajax({headers:{token:getCookie("token")},type:"POST",url:"/api/operate/saveBargainFound?projectid=43",data:JSON.stringify({bargainActivityId:hid}),contentType:"application/json",dataType:"json",async:!0,success:function(r){if(r.code==802)layer.alert("\u5DF2\u8FBE\u5230\u8BE5\u8D26\u53F7\u780D\u4EF7\u4E0A\u9650\uFF01");else{layer.open({type:1,offset:"300px",title:"\u8BF7\u626B\u63CF\u4E8C\u7EF4\u7801",content:'
'});var u=window.location.protocol,f=window.location.host,v=new QRCode("qrcode",{text:""+u+"//"+f+"/pages/wap/bargain.html?cid="+cide[1]+"&did="+s+"&uid="+c[0],width:200,height:200})}}});else{layer.open({type:1,offset:"300px",title:"\u8BF7\u626B\u63CF\u4E8C\u7EF4\u7801",content:'
'});var l=window.location.protocol,d=window.location.host,p=new QRCode("qrcode",{text:""+l+"//"+d+"/pages/wap/bargain.html?cid="+cide[1]+"&did="+s+"&uid="+c[0],width:200,height:200})}}else layer.alert("\u53EA\u6709\u5B66\u751F\u8D26\u53F7\u624D\u80FD\u62A5\u540D\uFF01");else parseInt(n.code)==401||parseInt(n.code)==403?user.loginLayer(function(r){r.success&&courseInfo.init()}):layer.alert("\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458\uFF01")}),setTimeout(function(){i.upLoadClicktag=0},300)}})},renderNormal:function(e){var a=this,i=e.personNumLimit-e.personNumCount>0?e.personNumLimit-e.personNumCount:!1,s='

';e.price==0?e.organizationType!=5&&(s+='\u514D\u8D39'):s+='\u5E73\u53F0\u4F7F\u7528\u8D39\uFFE5'+(e.price/100).toFixed(2)+"",e.marketPrice>0&&(s+='\uFFE5'+(e.marketPrice/100).toFixed(2)+""),s+="

",e.deadline==0?s+='

\u81EA\u62A5\u540D\u4E4B\u65E5\u8D77\u6C38\u4E45\u6709\u6548':e.isPay?deteTime(a.syTime)>=1?s+='

\u6709\u6548\u671F\u5269\u4F59'+deteTime(a.syTime)+"\u5929":s+='

\u6709\u6548\u671F\u4E0D\u8DB3'+(a.syTime>864e5?deteTime(a.syTime):1)+"\u5929":s+='

\u81EA\u62A5\u540D\u4E4B\u65E5\u8D77'+e.deadline+"\u5929\u6709\u6548",e.personNumLimit!=0&&i&&(s+='\u5269\u4F59\u540D\u989D: '+i+"\u4EBA"),s+="

";var n=!1;courseOnlyBalance?e.isPay==!0?s+='\u8FDB\u5165\u5B66\u4E60':e.isOpenSignUp==!1?e.organizationType!="5"?s+='\u5DF2\u5173\u95ED':n=!0:a.limitDisabled?s+='\u6211\u8981\u5B66\u4E60':s+='\u6211\u8981\u5B66\u4E60':e.isPay==!0?s+='\u8FDB\u5165\u5B66\u4E60':e.isOpenSignUp==!1?e.organizationType!="5"?s+='\u5DF2\u5173\u95ED':n=!0:e.personNumLimit!=0&&!i?s+='\u5DF2\u62A5\u6EE1':e.price==0&&e.organizationType!=5?s+='\u514D\u8D39\u62A5\u540D':s+='\u7ACB\u5373\u62A5\u540D',$(".curwithin").append(s),n&&$(".curexplain").hide(),a.goBuyEvent(),a.joinCarEvent()},converImg:function(e){var a=".jpg",i=e.cover,s=i.lastIndexOf("."),n=i.substring(s+1);if(n=="jpg"||n=="png"||n=="gif"||n=="jpeg"||n=="bmp"||n=="tga"||n=="svg"||n=="psd")covers=i;else{var t=i.lastIndexOf(".done")>=0?i.lastIndexOf(".done"):i.lastIndexOf(".");covers=i?i.substring(0,t)+a:""}return covers},isGoBundle:function(e){var a=e.data.courseType;if(a==="2"||a==="4"){var i=window.location.origin+"/pages/bundle.html"+window.location.search;window.location.href=i}},joinCarEvent:function(){var e=this;$(".curshop").on("click",function(){if(e.limitDisabled&&layer.msg("\u60A8\u4E0D\u5728\u8BE5\u8BFE\u7A0B\u9650\u5B9A\u62A5\u540D\u5185"),!(isOtherBtn||e.limitDisabled)){var a=e.res;a.isOpenSignUp==!0&&e.isBuyState(function(i){parseInt(i.code)==200?isInCart==!0?($(".curshop").addClass("huise"),$(".alertmessage").removeClass("huise")):incart==!1&&(console.log("joinCarEvent",incart),e.buyRequest(function(){layer.msg("\u52A0\u5165\u6210\u529F",{time:1500},function(){courseInfo.init()})})):parseInt(i.code)==401||parseInt(i.code)==403?user.loginLayer(function(s){var n=s;s.success&&courseInfo.init()}):layer.alert("\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458\uFF01")})}})},goBuyEvent:function(){var e=this;$(".cursign").on("click",function(){e.limitDisabled&&layer.msg("\u60A8\u4E0D\u5728\u8BE5\u8BFE\u7A0B\u9650\u5B9A\u62A5\u540D\u5185");var a=e.res;if(!(isOtherBtn||e.limitDisabled)){if(a.isPay){goCenterDetail();return}e.upLoadClicktag===0&&(e.upLoadClicktag=1,a.isOpenSignUp==!0&&e.isBuyState(function(i){parseInt(i.code)==200?courseOnlyBalance==1?e.balancePayRequest():pre==0?e.freeRequest():e.buyRequest(function(s){s.success&&(window.location.href="/pay/#/shopping")}):parseInt(i.code)==401||parseInt(i.code)==403?user.loginLayer(function(s){var n=s;n.success&&courseInfo.init()}):layer.alert("\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458\uFF01")}))}})},bindEvent:function(){var e=this;$(".curshare").on("click",function(){e.shareEvent()}),$(".alertmessage").on("click",function(){e.limitDisabled||layer.open({content:"\u5DF2\u6DFB\u52A0\u5230\u8D2D\u7269\u8F66\u3002",btn:["\u524D\u5F80\u8D2D\u7269\u8F66","\u786E\u8BA4"],yes:function(a,i){window.location.href="/pay/#/shopping"}})})},getNeedSubscribe:function(e){var a=this;e&&e();return;var i},isBuyState:function(e){var a=this;getCookie("token")?user.isLogin(function(i){var s=parseInt(i.code);switch(s){case 200:i.data.userTypeExact=="STUDENT"?person<=0&&personNumLimit!=0?layer.alert("\u62A5\u540D\u4EBA\u6570\u5DF2\u6EE1\uFF01"):a.getNeedSubscribe(function(){e&&e(i)}):getPar("redirect")?window.location.href=sourceurl:layer.alert("\u53EA\u6709\u5B66\u751F\u8D26\u53F7\u624D\u80FD\u62A5\u540D\uFF01");break;case 401:e&&e(i);break;case 403:e&&e({code:401});break;default:layer.alert("\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458\uFF01")}a.upLoadClicktag=0}):(a.upLoadClicktag=0,e&&e({code:401}))},balancePayRequest:function(){var e=this;layer.open({type:1,offset:"auto",title:"\u8BF7\u786E\u8BA4",skin:"balancepay-class",area:["300px","150px"],content:pre>0?"\u8BE5\u8BFE\u7A0B\u9700\u8981\u6D88\u8017"+pre/100+"\u4F59\u989D":"\u786E\u8BA4\u514D\u8D39\u5F00\u901A\u8BE5\u8BFE\u7A0B",btn:["\u53D6\u6D88","\u786E\u8BA4\u52A0\u5165"],btnAlign:"c",yes:function(a,i){layer.closeAll()},btn2:function(a,i){channels=getchannel();var s=getPar("diliater")||"",n=decrypt(s)?decrypt(s).split(","):[],t=e.orderList;t[0].firstLevelId=n[1],t[0].secondLevelId=n[2],t[0].thirdLevelId=n[3],channels.orderList=t,request({url:"/api/order/createOrder?projectid=22",data:JSON.stringify(channels),type:"POST",loading:!0,success:function(o){var c=o.code;o&&o.success?layer.open({type:1,offset:"auto",title:"\u52A0\u5165\u6210\u529F",skin:"balancepay-class",area:["300px","150px"],content:"\u524D\u5F80\u5B66\u4E60\u4E2D\u5FC3\u53EF\u76F4\u63A5\u5F00\u59CB\u5B66\u4E60",btn:["\u518D\u901B\u901B","\u7ACB\u5373\u524D\u5F80"],btnAlign:"c",yes:function(l,d){layer.closeAll()},btn2:function(l,d){goCenterDetail("?payCom=1"),layer.closeAll()}}):c=="605"?layer.open({type:1,offset:"auto",title:"\u4F59\u989D\u4E0D\u8DB3",skin:"balancepay-class",area:["300px","150px"],content:"\u8BF7\u5145\u503C\u540E\u518D\u8BD5",btn:["\u5173\u95ED","\u7ACB\u5373\u524D\u5F80"],btnAlign:"c",yes:function(l,d){layer.closeAll()},btn2:function(l,d){goBalance(),layer.closeAll()}}):layer.open({type:1,offset:"auto",title:"\u63D0\u793A",skin:"balancepay-class",area:["300px","150px"],content:o.message||"\u62A5\u540D\u5931\u8D25",btn:["\u5173\u95ED"],btnAlign:"c",yes:function(l,d){layer.closeAll()}})}})}})},buyRequest:function(e){var a=this;channels=getchannel();var i={url:"/api/order/shoppingCart?projectid=22",type:"POST",data:JSON.stringify({goodsList:coverUid(a.goodsList),pvid:channels.pvid,uvcid:channels.uvcid,shareUserId:channels.shareUserId,clientType:channels.channel}),success:function(s){e&&e(s)},error:function(){},loading:!1};a.request(i)},freeRequest:function(e){var a=this;channels=getchannel(),channels.orderList=a.orderList;var i={url:"/api/order/createOrder?projectid=22",type:"POST",data:JSON.stringify(channels),loading:!0,success:function(s){e&&e(s),s&&s.success?layer.open({type:1,offset:"auto",content:'
\u62A5\u540D\u6210\u529F\uFF0C\u8FDB\u5165\u5B66\u4E60\u4E2D\u5FC3\uFF01
',btn:"\u786E\u8BA4",btnAlign:"c",yes:function(){goCenterDetail("?payCom=1"),layer.closeAll()}}):layer.alert(s.message||"\u62A5\u540D\u5931\u8D25")}};a.request(i)},request:function(e){var a=e.url,i=e.type||"GET",s=e.data,n=e.success,t=e.error,o=e.loading,c=e.noCloseLayer;o&&layer.load(2),$.ajax({headers:{token:getCookie("token")},type:i,url:a,contentType:"application/json",dataType:"json",data:s,async:!0,success:function(l){c||layer.closeAll(),n(l),!l.success&&parseInt(l.code)!==401&&layer.msg(l.message)},error:function(l){layer.closeAll(),t(l)}})}};function vod(){videoCover&&$(".curfengs").on("click",".bose",function(){layer.open({type:1,title:!1,skin:"layui-tavie",area:["658px","460px"],moveType:1,shade:.6,anim:2,content:'
'})})}$(document).ready(function(){var e=window.setInterval(a,100);function a(){window.roominfo&&$(".platform").length>0&&(window.clearInterval(e),window.roominfo.isDisplaySpecialLabel==1&&$("head").append(""))}}),types==1?(setTimeout(function(){courseInfo.init()},10),setTimeout("vod()",100)):(courseInfo.init(),vod()),(leftTime==0||rightTime==0)&&courseInfo.init(),getShtmlUrl()||getPar("cid")||setTimeout(function(){window.location.href="/pages/elective.html"},2e3);var courseWareList={init:function(){var e=this;e.ztime=new Date().getTime(),e.current=1,e.pageSize=20,e.courseId=getPar("cid"),e.getList()},getList:function(){var e=this,a={url:"/api/course/getWaresByCourseId?projectid=12",type:"GET",data:{courseId:getShtmlUrl()||getPar("cid"),currentPage:e.current,pageSize:e.pageSize},success:function(i){e.renderList(i),e.bindEvent()},error:function(){},loading:!1};e.request(a)},bindEvent:function(){var e=this,a=["1","2","3","4","5"];if($(".js-courseware").click(function(){if(!isOtherBtns){var s=$(this).data("wid"),n=$(this).data("cid"),t=$(this).data("wtype").toString(),o;a.indexOf(t)>-1?t==="5"?o="/views/myroom/fakeLive.html":t==="2"?o="/views/common/smallClass.html":o="/views/myroom/livecourse.html":o="/liveclass/course.html";var c=o+"?cwid="+s+"&courseId="+n;window.open(c)}}),$("#pagination2").length>0&&e.total>e.pageSize){if($(".page-elem-field").length)return;var i=new Page({el:"#pagination2",nums:e.total,counts:e.pageSize,defaultPage:1,showHeadFoot:!1,jumpToOrder:!1,showNowAndAll:!0,clickEvent:function(s,n){e.current=s,e.getList()}})}window.nofind=function(){var s=event.srcElement;s.src="/static/common/image/course/fengmian.jpg",s.onerror=null}},renderList:function(e){var a=this;$(".curriculum").show();var i=e.data.list||[];a.total=e.data.total;for(var s="",n=0,t=i.length;n
'+o.directoryName+"("+o.courseWareCount+")
";for(var c=0,l=o.courseWares.length;c"):$(".catalog").html(s)},renderCoverImg:function(e){var a=this,i="",s,n=a.ztime,t=e.courseWareType,o=e.playLength?e.playLength:e.liveLength;if(e.allowBackView&&e.allowBackView!='""'&&!isJSON(e.allowBackView)){var c=e.allowBackView.split(",");c[0]=c[0].replace("[",""),c[1]=c[1].replace("]",""),e.allowBackView=JSON.stringify(c)}var l=e.allowBackView&&e.allowBackView!='""'&&JSON.parse(e.allowBackView)[0]!=""?new Date(JSON.parse(e.allowBackView)[0]).getTime():"",d=e.allowBackView&&e.allowBackView!='""'&&JSON.parse(e.allowBackView)[1]!=""?new Date(JSON.parse(e.allowBackView)[1]).getTime():"";if(e.gmtCourseStart||o){var p=e.gmtCourseStart+o*1e3;n>p&&n>l&&n<(d||n*10)?s=!1:s=!0}else s=!0;return t==0||t==8?i+='':1<=t&&t<=5&&(e.allowBackView&&!s?i+='':i+=''),i},renderWareTime:function(e){var a="",i=e.courseWareType;return 1<=i&&i<=4?(a+="\u5F00\u8BFE\uFF1A"+formatDateTime(e.gmtCourseStart)+"",a+='\u65F6\u957F\uFF1A'+SecondToDate(e.liveLength)+""):i==5?(a+="\u5F00\u8BFE\uFF1A"+formatDateTime(e.gmtCourseStart)+"",a+='\u65F6\u957F\uFF1A'+SecondToDate(e.playLength)+""):e.gmtCourseStart==0||e.gmtCourseEnd==0?a+="":(a+="\u5F00\u8BFE\uFF1A"+formatDateTime(e.gmtCourseStart)+"",a+='\u7ED3\u675F\uFF1A'+formatDateTime(e.gmtCourseEnd)+""),a},renderAudition:function(e){var a="";return e.videoAuditionSet?a+='

\u8BD5\u770B'+e.courseWareName+"

":a+='

'+e.courseWareName+"

",a},renderPrice:function(e){var a="",i=e.price?JSON.parse(e.price):[];return i[0]?a+='\uFFE5'+(i[0]/100).toFixed(2)+"/"+i[1]+"\u5929":i[0]==0&&(a+='\u514D\u8D39/'+i[1]+"\u5929"),a},renderCourseWare:function(e){var a=this,i="",s="/pages/ware.html?cid="+a.courseId+"&rid="+e.courseWareId+"";return i+='",i},request:function(e){var a=e.url,i=e.type||"GET",s=e.data,n=e.success,t=e.error,o=e.loading;o&&layer.load(2),$.ajax({headers:{token:getCookie("token")},type:i,url:a,contentType:"application/json",dataType:"json",data:s,async:!0,success:function(c){layer.closeAll(),n(c)},error:function(c){layer.closeAll(),t(c)}})}};courseWareList.init();function getchannel(){var e,a=localStorage.appAdapt===!0||localStorage.appAdapt==="true";if(a){var i=sessionStorage.getItem("ip")||"",s=sessionStorage.getItem("channel")||"",n=sessionStorage.getItem("gmtStart")||0,t=sessionStorage.getItem("sourceId")||0,o=sessionStorage.getItem("sourceJson")||"",c=sessionStorage.getItem("sourceType")||"";e={ip:i,channel:s,gmtStart:n,sourceId:t,sourceJson:o,sourceType:c}}else{e=sessionStorage.getItem("cluechannel")?JSON.parse(sessionStorage.getItem("cluechannel")):{};var i=sessionStorage.getItem("sourceip");e.ip=i||""}var l=getPar("channel")||"";return l&&(e.channel=l),e.uvcid=localStorage.uvcid||"",e.pvid=sessionStorage.getItem("pvid")||"",e}function getCookie(e){for(var a=document.cookie,i=a.split("; "),s=0;s60&&a<60*60?a=parseInt(a/60)+"\u5206\u949F":a>=60*60&&a<60*60*2?a=parseInt(a/3600)+"\u5C0F\u65F6"+parseInt(a/60-60)+"\u5206\u949F":a>=60*60*2&&a<60*60*3?a=parseInt(a/3600)+"\u5C0F\u65F6"+parseInt(a/60-120)+"\u5206\u949F":a>=60*60*3&&a<60*60*24&&(a=parseInt(a/3600)+"\u5C0F\u65F6")),a}function funcUrlDel(e){var a=window.location,i=a.origin+a.pathname+"?",s=a.search.substr(1);if(s.indexOf(e)>-1){for(var n={},t=s.split("&"),o=0;o24&&(t=parseInt(i/24)+"\u5929"),t}function deteTime(e){var e=e/1e3,a=e,i=parseInt(e/3600);a-=i*3600;var s=parseInt(a/60);a-=s*60;var n=parseInt(a),t=zeroFull(i)+":"+zeroFull(s)+":"+zeroFull(n);return i>24&&(t=parseInt(i/24)),t}function zeroFull(e){return e>9?e:"0"+e}function isJSON(e){if(typeof e=="string")try{var a=JSON.parse(e);return!!(typeof a=="object"&&a)}catch(i){return!1}}var hiddenProperty="hidden"in document?"hidden":"webkitHidden"in document?"webkitHidden":"mozHidden"in document?"mozHidden":null,visibilityChangeEvent=hiddenProperty.replace(/hidden/i,"visibilitychange"),onVisibilityChange=function(){if(!document[hiddenProperty]){var e=!rightTime&&!leftTime;e||window.history.go(0)}};document.addEventListener(visibilityChangeEvent,onVisibilityChange);