2 lines
56 KiB
JavaScript
2 lines
56 KiB
JavaScript
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<i;a++){var s=e[a];if(s.indexOf(".shtml")>-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<c.length;d++)i!=parseInt(c[d])&&l.push(c[d]);for(var d=0,p=l.length;d<p;d++){var r=l[d];d<3&&(o+=","+r)}o=usid[0]+"&uid="+i+o,s=window.location.origin+window.location.pathname+"?"+o;var u=window.location.origin+"/pages/wap/info.html"+window.location.search;/Android|webOS|iPhone|iPod|iPad|BlackBerry/i.test(navigator.userAgent)&&(window.location.href=u)}},getCourseDetail:function(){var e=this,a={url:"/api/course/getCourseDetail?projectid=12",type:"GET",data:{courseId:getShtmlUrl()||getPar("cid"),isFromLive:sceneType=="1"?1:void 0,sceneId:sceneId||void 0},success:function(i){i.success&&(i.data&&i.data.courseId?(e.renderDetail(i),i.data.organizationType=="5"&&($(".CourseInfoBox").addClass("highSchool"),e.getCourseTeacherInfo()),$(".CourseInfoBox").css({opacity:1})):$(".curriculum").html('<div class="no-detail">\u8BE5\u8BFE\u7A0B\u4E0D\u5B58\u5728</div>'))},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?'<i class="detail_pay_bubble"></i>':"";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("<div class='nodata'></div>"),$("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<x;I++){var C=g[I].gmtEnd-S,B=g[I].groupFoundId;if(C>=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+='<div class="jstsde">',y+='<img class="ptimg" src='+(cdnPath+g[I].headPortrait)+" />",y+='<span class="ptmane">'+F+"</span>",y+='<a class="ptbtn" data-tuan="'+B+'" href="javascript:void(0);">\u53BB\u62FC\u56E2</a>',y+='<div class="ptrisr">',y+='<span class="ptcha">\u8FD8\u5DEE<span class="redes">'+U+"\u4EBA</span>\u62FC\u6210</span>",y+='<span class="pthuit">\u5269\u4F59<i class="pt_time js_pt_time'+I+'">'+q+"</i></span>",y+="</div>",y+="</div>"}}y===""?$(".tuanlist").html("<div class='nodata'></div>"):$(".tuanlist").html(y)}N();function j(){for(var y=0,I=g.length;y<I;y++){var x=g[y].gmtEnd-S;if(x>=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:'<div id="qrcode"></div>'});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<r;p++){var u=i[p];n+='<div class="teacherInfoBox"> <div class="baseicInfo"> <img src="'+cdnPath+u.headPortrait+'" class="headimg"/> <div class="teachName"> <p title="'+u.realName+'">'+u.realName+'</p> <p class="nickName" title="'+u.className+'">'+u.className+'</p> </div> </div> <div class="profileBox"> \u4E2A\u4EBA\u7B80\u4ECB\uFF1A'+(u.introduction||"\u6682\u65E0")+" </div></div>"}$(".teacherScrollBox .scrollBarBox").html(n);var f=e.course,v='<p>\u6240\u5C5E\u9662\u7CFB: <span title="'+f.className+'">'+(f.className||"\u672C\u6821")+"</span></p><p>\u9009\u8BFE\u5B66\u751F\u6570\uFF1A<span>"+f.personNumCount+"</span></p><p>\u8BFE\u7A0B\u8D44\u6E90\u6570\uFF1A<span>"+f.attachmentCount+"</span></p><p>\u89C6\u9891\u8D44\u6E90\u6570\uFF1A <span>"+f.videoWareCount+"</span></p><p>\u95EE\u7B54\u533A\u63D0\u95EE\u6570\uFF1A <span>"+f.answeringQuestionCount+"</span></p><p>\u95EE\u7B54\u533A\u56DE\u7B54\u6570\uFF1A <span>"+f.answerCount+"</span></p><p>\u4F5C\u4E1A\u6570\uFF1A<span>"+f.taskCount+"</span></p><p>\u95EE\u5377\u6570\uFF1A<span>"+f.questionCount+"</span></p><p>\u5377\u5E93\u8BD5\u5377\uFF1A<span>"+f.wareQuestionCount+"</span></p>";$(".infoAmountBox .infoList").html(v)},renderCover:function(e){var a=e.videoCover,i="";a?(m3u8=e.videoCoverPath,i='<span class="bose"></span><img class="zaimg" src='+(cdnPath+covers)+" />"):i="<img src="+(cdnPath+covers)+" />",$(".curfengs").html(i),a&&vod()},renderMainHtml:function(e){var a=this,i=e.type;a.limitDisabled=!e.isLimit;var s=e.courseType,n=e.isShareCourse;+s==3&&n===0&&(a.limitDisabled=!0),a.syTime=e.gmtEnd-a.nowSeverTimeStamp,a.isOtherBtns=!(e.isOpenSignUp&&e.isPay),a.isOtherBtn=!(e.isOpenSignUp||e.isPay),a.renderMainHeader(e),i==1?a.renderSeckill(e):i==2?a.renderGroup(e):i==3?a.renderBargain(e):a.renderNormal(e)},renderMainHeader:function(e){var a=this,i=e.introduce,s=e.isShopBudget||0,n=s?'<i class="detail_pay_bubble"></i>':"",t='<h2 class="curhtit">'+e.courseName+"</h2>";if(e.childClassifyName=="")t+='<p class="curint">'+e.mainClassifyName+"</p>";else{var o=(e.classifyNamePath||"").replace(/\,/g," > ");t+='<p class="curint">'+o+"</p>"}t+='<span class="curke">'+e.playLengthCount+"\u8BFE\u65F6</span>",e.isFavorite==!0?t+='<span class="curcolls">\u5DF2\u6536\u85CF</span><span style="display:none;" class="curcoll">\u6536\u85CF</span>':t+='<span class="curcoll">\u6536\u85CF</span><span style="display:none;" class="curcolls">\u5DF2\u6536\u85CF</span>',t+='<span class="curshare">\u5206\u4EAB'+n+'</span><p class="cursimp" title='+i+">"+i+"</p>",$(".curwithin").html(t)},renderSeckill:function(e){var a=this,i={url:"/api/operate/getSeckillInfo?projectid=43",type:"GET",data:{flashBuyActivityId:hid},success:function(s){a.renderSeckillDom(s,e),a.seckillOpen(s,e),a.seckillBuy(s,e);var n=a.rightTime,t=a.leftTime;if(n>=0){var o=function(d){var p=Math.floor(d);return p>9?p:"0"+p},c=function(){n<950&&n>-950&&(clearInterval(l),setTimeout(function(){courseInfo.init()},10));var d,p,r,u;d=Math.floor(n/1e3/60/60/24),p=Math.floor(n/1e3/60/60%24),r=Math.floor(n/1e3/60%60),u=Math.floor(n/1e3%60),d=d<10?"0"+d:d,p=p<10?"0"+p:p,r=r<10?"0"+r:r,u=u<10?"0"+u:u,document.getElementById("_d").innerHTML=d,document.getElementById("_h").innerHTML=p,document.getElementById("_m").innerHTML=r,document.getElementById("_s").innerHTML=u,n=n-1e3};setTimeout(c,100);var l=setInterval(c,1e3)}else if(t>=0){var o=function(u){var f=Math.floor(u);return f>9?f:"0"+f},c=function(){t<950&&t>-950&&location.reload();var u,f,v,h;u=Math.floor(t/1e3/60/60/24),f=Math.floor(t/1e3/60/60%24),v=Math.floor(t/1e3/60%60),h=Math.floor(t/1e3%60),u=u<10?"0"+u:u,f=f<10?"0"+f:f,v=v<10?"0"+v:v,h=h<10?"0"+h:h,document.getElementById("_d").innerHTML=u,document.getElementById("_h").innerHTML=f,document.getElementById("_m").innerHTML=v,document.getElementById("_s").innerHTML=h,t=t-1e3};setTimeout(c,100);var l=setInterval(c,1e3)}else clearInterval(l)}};a.request(i)},renderSeckillDom:function(e,a){var i=this,s=e.data.flashBuyActivity;i.rem=s;var n=(e.data.flashBuyCount/s.flashBuyLimit*100).toFixed(0);datime=e.timeStamp;var t=new Date(datime),o=t.getTime(),c=new Date(s.gmtStart),l=c.getTime(),d=new Date(s.gmtEnd),p=d.getTime();rightTime=l-o,leftTime=p-o,i.rightTime=rightTime,i.leftTime=leftTime;var r='<div class="stime">';r+='<span class="znars">\u9650\u65F6\u79D2\u6740</span>',r+='<div class="lirig">',rightTime>=0?(r+='<span style="margin-right:5px;">\u8DDD\u79BB\u79D2\u6740\u5F00\u59CB\u8FD8\u6709</span>',r+='<span id="_d"></span>\u5929',r+='<span id="_h"></span>:',r+='<span id="_m"></span>:',r+='<span id="_s"></span>'):leftTime>=0?(r+='<span style="margin-right:5px;">\u8DDD\u79BB\u79D2\u6740\u7ED3\u675F\u8FD8\u6709</span>',r+='<span id="_d">00</span>\u5929',r+='<span id="_h">00</span>:',r+='<span id="_m">00</span>:',r+='<span id="_s">00</span>'):r+="<span>\u6D3B\u52A8\u7ED3\u675F</span>",r+="</div>",r+="</div>",r+='<p class="cursered weits" style="margin:10px 0 0 0;'+(a.showPrice==1?"":"visibility: hidden;")+'">',r+='<span class="platform">\u5E73\u53F0\u4F7F\u7528\u8D39</span>',r+='<span class="cursi">\uFFE5</span>'+(s.price/100).toFixed(2)+"",r+='<span class="cursezhe">\uFFE5'+((a.marketPrice?a.marketPrice:s.oldPrice)/100).toFixed(2)+"</span>",a.deadline==0?r+='<span class="msrer" style="margin-left:10px;color:#b2b2b2;font-size:13px;">\u81EA\u62A5\u540D\u4E4B\u65E5\u8D77<span class="curseorange">\u6C38\u4E45\u6709\u6548</span></span>':a.isPay?deteTime(i.syTime)>=1?r+='<span class="msrer" style="margin-left:10px;color:#b2b2b2;font-size:13px;">\u6709\u6548\u671F\u5269\u4F59<span class="curseorange">'+deteTime(i.syTime)+"\u5929</span></span>":r+='<span class="msrer" style="margin-left:10px;color:#b2b2b2;font-size:13px;">\u6709\u6548\u671F\u4E0D\u8DB3<span class="curseorange">'+(i.syTime>864e5?deteTime(i.syTime):1)+"\u5929</span></span>":r+='<span class="msrer" style="margin-left:10px;color:#b2b2b2;font-size:13px;">\u81EA\u62A5\u540D\u4E4B\u65E5\u8D77<span class="curseorange">'+a.deadline+"\u5929</span>\u6709\u6548</span>",r+="</p>",rightTime>=0?(e.data.flashBuyCount==s.flashBuyLimit?r+='<a class="huiwu" href="javascript:void(0);">\u5DF2\u62A2\u5B8C</a>':r+='<a class="seckill huise" style="background:none #e3e3e3;" href="javascript:void(0);">\u9650\u65F6\u79D2\u6740\uFFE5'+(s.price/100).toFixed(2)+"</a>",a.isPay==!0?r+='<a class="opening" href="javascript:void(0);">\u8FDB\u5165\u5B66\u4E60</a>':isOtherBtn||i.limitDisabled?r+='<a class="opening huise" style="background:none #e3e3e3;" href="javascript:void(0);">\u76F4\u63A5\u5F00\u901A\uFFE5'+(s.oldPrice/100).toFixed(2)+"</a>":r+='<a class="opening" href="javascript:void(0);">\u76F4\u63A5\u5F00\u901A\uFFE5'+(s.oldPrice/100).toFixed(2)+"</a>"):e.data.flashBuyCount==s.flashBuyLimit?(a.isPay==!0?r+='<a class="opening" href="javascript:void(0);">\u8FDB\u5165\u5B66\u4E60</a>':isOtherBtn||i.limitDisabled?r+='<a class="opening huise" style="background:none #e3e3e3;" href="javascript:void(0);">\u76F4\u63A5\u5F00\u901A\uFFE5'+(s.oldPrice/100).toFixed(2)+"</a>":r+='<a class="opening" href="javascript:void(0);">\u76F4\u63A5\u5F00\u901A\uFFE5'+(s.oldPrice/100).toFixed(2)+"</a>",r+='<a class="huiwu" href="javascript:void(0);">\u5DF2\u62A2\u5B8C</a>'):(a.isPay==!0?r+='<a class="opening" href="javascript:void(0);">\u8FDB\u5165\u5B66\u4E60</a>':isOtherBtn||i.limitDisabled?r+='<a class="seckill huise" style="background:none #e3e3e3;" href="javascript:void(0);">\u9650\u65F6\u79D2\u6740\uFFE5'+(s.price/100).toFixed(2)+"</a>":r+='<a class="seckill" href="javascript:void(0);">\u9650\u65F6\u79D2\u6740\uFFE5'+(s.price/100).toFixed(2)+"</a>",r+='<span class="misrde">',r+="\u5DF2\u62A2"+n+'%<span class="resde">',r+='<span class="bsrdes" style="width:'+n+'%"></span>',r+="</span>",r+="</span>"),$(".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='<p style="'+(a.showPrice==1?"":"visibility: hidden;")+'" class="cursered weits">';a.price==0?t+='<span class="curselv">\u514D\u8D39</span>':(t+='<span class="platform">\u5E73\u53F0\u4F7F\u7528\u8D39</span>',t+='<span class="cursi">\uFFE5</span>'+(e.price/100).toFixed(2)+""),a.marketPrice>0&&(t+='<span class="cursezhe">\uFFE5'+(a.marketPrice/100).toFixed(2)+"</span>"),t+="</p>",a.deadline==0?t+='<p class="curexplain">\u81EA\u62A5\u540D\u4E4B\u65E5\u8D77<span class="curseorange">\u6C38\u4E45\u6709\u6548</span></p>':a.isPay?deteTime(i.syTime)>=1?t+='<p class="curexplain">\u6709\u6548\u671F\u5269\u4F59<span class="curseorange">'+deteTime(i.syTime)+"\u5929</span></p>":t+='<p class="curexplain">\u6709\u6548\u671F\u4E0D\u8DB3<span class="curseorange">'+(i.syTime>864e5?deteTime(i.syTime):1)+"\u5929</span></p>":t+='<p class="curexplain">\u81EA\u62A5\u540D\u4E4B\u65E5\u8D77<span class="curseorange">'+a.deadline+"\u5929</span>\u6709\u6548</p>",a.isPay==!0?t+='<a class="opening" href="javascript:void(0);">\u8FDB\u5165\u5B66\u4E60</a>':i.isOtherBtn||i.limitDisabled?(e.type==0?t+='<a class="seckill huise" style="background:none #e3e3e3;" href="javascript:void(0);">\u53D1\u8D77\u62FC\u56E2\uFFE5'+(e.price/100).toFixed(2)+"</a>":t+='<a class="seckill huise" href="javascript:void(0);">\u627E\u5C0F\u4F19\u4F34\u4E00\u8D77\u62FC\u56E2</a>',t+='<a class="opening huise" style="background:none #e3e3e3;" href="javascript:void(0);">\u5355\u72EC\u62A5\u540D\uFFE5'+(e.oldPrice/100).toFixed(2)+"</a>"):(e.type==0?t+='<a class="seckill" href="javascript:void(0);">\u53D1\u8D77\u62FC\u56E2\uFFE5'+(e.price/100).toFixed(2)+"</a>":t+='<a class="seckill" href="javascript:void(0);">\u627E\u5C0F\u4F19\u4F34\u4E00\u8D77\u62FC\u56E2</a>',t+='<a class="opening" href="javascript:void(0);">\u5355\u72EC\u62A5\u540D\uFFE5'+(e.oldPrice/100).toFixed(2)+"</a>"),$(".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:'<div style="padding: 20px 80px;">\u62A5\u540D\u6210\u529F\uFF0C\u8FDB\u5165\u5B66\u4E60\u4E2D\u5FC3\uFF01</div>',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<l;c++)t[c].goodsId==cide[1]&&(o=!0);if(o){var d={type:"POST",url:"/api/order/delShoppingCart?projectid=22",data:JSON.stringify({goodsIdList:a}),success:function(p){i.requestShoppingCart(e)}};i.request(d)}else i.requestShoppingCart(e)}}};i.request(s)},requestShoppingCart:function(e){var a=this;channels=getchannel();var i={type:"POST",url:"/api/order/shoppingCart?projectid=22",data:JSON.stringify({goodsList:e,pvid:channels.pvid,uvcid:channels.uvcid,shareUserId:channels.shareUserId,clientType:channels.channel}),success:function(s){if(s.success)if(a.QRCodeLayer){a.QRCodeLayer=!1,layer.open({type:1,offset:"300px",title:"\u8BF7\u626B\u63CF\u4E8C\u7EF4\u7801",content:'<div id="qrcode"></div>'});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:'<div id="qrcode"></div>'});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='<p style="'+(a.showPrice==1?"":"visibility: hidden;")+'" class="cursered weits">';a.price==0?n+='<span class="curselv">\u514D\u8D39</span>':(n+='<span class="platform">\u5E73\u53F0\u4F7F\u7528\u8D39</span>',n+='<span class="cursi">\uFFE5</span>'+(e.price/100).toFixed(2)+""),a.marketPrice>0&&(n+='<span class="cursezhe">\uFFE5'+(a.marketPrice/100).toFixed(2)+"</span>"),n+="</p>",a.deadline==0?n+='<p class="curexplain">\u81EA\u62A5\u540D\u4E4B\u65E5\u8D77<span class="curseorange">\u6C38\u4E45\u6709\u6548</span></p>':a.isPay?deteTime(i.syTime)>=1?n+='<p class="curexplain">\u6709\u6548\u671F\u5269\u4F59<span class="curseorange">'+deteTime(i.syTime)+"\u5929</span></p>":n+='<p class="curexplain">\u6709\u6548\u671F\u4E0D\u8DB3<span class="curseorange">'+(syTime>864e5?deteTime(i.syTime):1)+"\u5929</span></p>":n+='<p class="curexplain">\u81EA\u62A5\u540D\u4E4B\u65E5\u8D77<span class="curseorange">'+a.deadline+"\u5929</span>\u6709\u6548</p>",a.isPay==!0?n+='<a class="opening" href="javascript:void(0);">\u8FDB\u5165\u5B66\u4E60</a>':isOtherBtn||i.limitDisabled?(e.type==0?n+='<a class="seckill huise" style="background:none #e3e3e3;" href="javascript:void(0);">\u53EF\u780D\u81F3\uFFE5'+(e.price/100).toFixed(2)+"</a>":n+='<a class="seckill huise" style="background:none #e3e3e3;" href="javascript:void(0);">\u627E\u5C0F\u4F19\u4F34\u4E00\u8D77\u780D\u4EF7</a>',n+='<a class="opening huise" style="background:none #e3e3e3;" href="javascript:void(0);">\u76F4\u63A5\u5F00\u901A\uFFE5'+(e.oldPrice/100).toFixed(2)+"</a>"):(e.type==0?n+='<a class="seckill" href="javascript:void(0);">\u53EF\u780D\u81F3\uFFE5'+(e.price/100).toFixed(2)+"</a>":n+='<a class="seckill" href="javascript:void(0);">\u627E\u5C0F\u4F19\u4F34\u4E00\u8D77\u780D\u4EF7</a>',n+='<a class="opening" href="javascript:void(0);">\u76F4\u63A5\u5F00\u901A\uFFE5'+(e.oldPrice/100).toFixed(2)+"</a>"),$(".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:'<div id="qrcode"></div>'});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:'<div id="qrcode"></div>'});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='<p style="'+(e.showPrice==1?"":"visibility: hidden;")+' " class="cursered">';e.price==0?e.organizationType!=5&&(s+='<span class="curselv">\u514D\u8D39</span>'):s+='<span class="platform">\u5E73\u53F0\u4F7F\u7528\u8D39</span><span class="cursi">\uFFE5</span>'+(e.price/100).toFixed(2)+"",e.marketPrice>0&&(s+='<span class="cursezhe">\uFFE5'+(e.marketPrice/100).toFixed(2)+"</span>"),s+="</p>",e.deadline==0?s+='<p class="curexplain">\u81EA\u62A5\u540D\u4E4B\u65E5\u8D77<span class="curseorange">\u6C38\u4E45\u6709\u6548</span>':e.isPay?deteTime(a.syTime)>=1?s+='<p class="curexplain">\u6709\u6548\u671F\u5269\u4F59<span class="curseorange">'+deteTime(a.syTime)+"\u5929</span>":s+='<p class="curexplain">\u6709\u6548\u671F\u4E0D\u8DB3<span class="curseorange">'+(a.syTime>864e5?deteTime(a.syTime):1)+"\u5929</span>":s+='<p class="curexplain">\u81EA\u62A5\u540D\u4E4B\u65E5\u8D77<span class="curseorange">'+e.deadline+"\u5929</span>\u6709\u6548",e.personNumLimit!=0&&i&&(s+='<span class="ml10" style="color:#b2b2b2;">\u5269\u4F59\u540D\u989D: <span class="redes">'+i+"\u4EBA</span></span>"),s+="</p>";var n=!1;courseOnlyBalance?e.isPay==!0?s+='<a class="cursign balancepay" href="javascript:void(0);">\u8FDB\u5165\u5B66\u4E60</a>':e.isOpenSignUp==!1?e.organizationType!="5"?s+='<a class="overflowFull">\u5DF2\u5173\u95ED</a>':n=!0:a.limitDisabled?s+='<a class="cursign huise" href="javascript:void(0);">\u6211\u8981\u5B66\u4E60</a>':s+='<a class="cursign balancepay" href="javascript:void(0);">\u6211\u8981\u5B66\u4E60</a>':e.isPay==!0?s+='<a class="cursign" href="javascript:void(0);">\u8FDB\u5165\u5B66\u4E60</a>':e.isOpenSignUp==!1?e.organizationType!="5"?s+='<a class="overflowFull">\u5DF2\u5173\u95ED</a>':n=!0:e.personNumLimit!=0&&!i?s+='<a class="overflowFull">\u5DF2\u62A5\u6EE1</a>':e.price==0&&e.organizationType!=5?s+='<a class="cursign" href="javascript:void(0);">\u514D\u8D39\u62A5\u540D</a>':s+='<a class="cursign" href="javascript:void(0);">\u7ACB\u5373\u62A5\u540D</a>',$(".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:'<div style="padding: 20px 80px;">\u62A5\u540D\u6210\u529F\uFF0C\u8FDB\u5165\u5B66\u4E60\u4E2D\u5FC3\uFF01</div>',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:'<div style="padding:0px;margin:0 auto;background:#000"><video width="100%" height="460px" src='+(cdnPath+m3u8)+" poster="+(cdnPath+covers)+' autoplay="autoplay" preload="none" controlslist="nodownload" controls="true"></video></div>'})})}$(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("<style>.platform{ display:block!important; }</style>"))}}),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<t;n++){var o=i[n];s+='<div class="tlete"><div class="catalogtit">'+o.directoryName+"("+o.courseWareCount+")</div></div>";for(var c=0,l=o.courseWares.length;c<l;c++)s+=a.renderCourseWare(o.courseWares[c])}i.length==0?$(".catalog").html("<div class='nodata'></div>"):$(".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+='<img class="vico" src="/static/common/image/course/videoico.png" />':1<=t&&t<=5&&(e.allowBackView&&!s?i+='<img class="zhisre" src="/static/common/image/course/huivideo.png" />':i+='<img class="zhisre" src="/static/common/image/course/broadcast2.png" />'),i},renderWareTime:function(e){var a="",i=e.courseWareType;return 1<=i&&i<=4?(a+="<span>\u5F00\u8BFE\uFF1A"+formatDateTime(e.gmtCourseStart)+"</span>",a+='<span class="ml25">\u65F6\u957F\uFF1A'+SecondToDate(e.liveLength)+"</span>"):i==5?(a+="<span>\u5F00\u8BFE\uFF1A"+formatDateTime(e.gmtCourseStart)+"</span>",a+='<span class="ml25">\u65F6\u957F\uFF1A'+SecondToDate(e.playLength)+"</span>"):e.gmtCourseStart==0||e.gmtCourseEnd==0?a+="<span></span>":(a+="<span>\u5F00\u8BFE\uFF1A"+formatDateTime(e.gmtCourseStart)+"</span>",a+='<span class="ml25">\u7ED3\u675F\uFF1A'+formatDateTime(e.gmtCourseEnd)+"</span>"),a},renderAudition:function(e){var a="";return e.videoAuditionSet?a+='<h2 class="catalogrti"><span class="ksanr">\u8BD5\u770B</span>'+e.courseWareName+"</h2>":a+='<h2 class="catalogrti">'+e.courseWareName+"</h2>",a},renderPrice:function(e){var a="",i=e.price?JSON.parse(e.price):[];return i[0]?a+='<span class="kecoud ml25">\uFFE5'+(i[0]/100).toFixed(2)+"/"+i[1]+"\u5929</span>":i[0]==0&&(a+='<span class="kecoud ml25">\u514D\u8D39/'+i[1]+"\u5929</span>"),a},renderCourseWare:function(e){var a=this,i="",s="/pages/ware.html?cid="+a.courseId+"&rid="+e.courseWareId+"";return i+='<div class="cataloglist js-courseware" data-wtype="'+e.courseWareType+'" data-wid="'+e.courseWareId+'" data-cid="'+e.courseId+'"> <a style="width:100%;" href="'+s+'"> <div class="catalet"> <img class="catalogfeng" src='+(cdnPath+e.cover)+' onerror="nofind();" />'+a.renderCoverImg(e)+' </div> <div class="catalogkt">'+a.renderAudition(e)+' <p class="catalogmain">'+e.introduce+'</p> <p class="catalogmain" style="margin-top:5px;"> <span class="lename">'+e.realName+"</span>"+a.renderWareTime(e)+a.renderPrice(e)+" </p> </div> </a></div>",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;s<i.length;s++){var n=i[s].split("=");if(n[0]==e)return n[1]}return""}function formatDate(e){e=new Date(e);var a=e.getDate(),i=e.getHours(),s=e.getMinutes();return s=s<10?"0"+s:s,a=a<10?"0"+a:a,a+"\u5929"+i+":"+s}function formatDateTime(e){e=new Date(e);var a=e.getFullYear(),i=e.getMonth()+1;i=i<10?"0"+i:i;var s=e.getDate();s=s<10?"0"+s:s;var n=e.getHours();n=n<10?"0"+n:n;var t=e.getMinutes();return t=t<10?"0"+t:t,a+"-"+i+"-"+s+" "+n+":"+t}function SecondToDate(e){var a=e;return a!=null&&a!=""&&(a>60&&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;o<t.length;o++)t[o]=t[o].split("="),n[t[o][0]]=t[o][1];delete n[e];var c=i+JSON.stringify(n).replace(/[\"\{\}]/g,"").replace(/\:/g,"=").replace(/\,/g,"&");return c}else return a.href}function coverUid(e,a){var i=e[0].goodsUrl,s=decrypt(localStorage.encryptId),n=s.split(",");if(s){for(var t=window.user&&window.user.useInfo&&window.user.useInfo.userId,o=a||t||n[0],c=a?[a]:[o],l=0,d=n.length;l<d;l++){var p=n[l];parseInt(o)!=parseInt(p)&&c.length<4&&c.push(p)}var r=funcUrlDel("uid").split("diliater")[0];r=r[r.length-1]=="&"?r:r+"&";var u=r+"diliater="+encrypt(c.join(","));e[0].goodsUrl=u}else if(a){var r=funcUrlDel("uid").split("diliater")[0];r=r[r.length-1]=="&"?r:r+"&";var u=r+"&diliater="+encrypt(a);e[0].goodsUrl=u}return e}function getPar(e){var a=document.location.href,i=a.indexOf(e+"=");if(i==-1)return!1;var s=a.slice(e.length+i+1),n=s.indexOf("&");return n!=-1&&(s=s.slice(0,n)),s}function deadTime(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)+"\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);
|