filesbox/web/dist/design/designstatic/front/routine/js/info.js
2024-07-26 14:10:54 +08:00

2 lines
24 KiB
JavaScript

var datime;$(".coursetit ul li").on("click",function(){if(!$(this).hasClass("active")){$(".course .coursetit ul li").removeClass("active"),$(this).addClass("active"),$(".hides").hide();var n=$(this).attr("tabs");n==1?$(".hides:eq(0)").css("display","block"):n==2?$(".hides:eq(1)").css("display","block"):$(".hides:eq(2)").css("display","block")}});var hid=0,types="",rightTime,leftTime,urls=location.search;if(urls.indexOf("?")!=-1)var ster=urls.substr(1),sty=ster.split("&"),cide=sty[0].split("cid="),usid=ster.split("&uid=");var deusid=usid[1]?usid[1].split(","):[],sceneId=getPar("sceneId")||"",sceneType=getPar("sceneType")?getPar("sceneType"):0,urlpd=window.location.href,channels=getchannel();function details(){$.ajax({headers:{token:getCookie("token")},type:"GET",url:"/api/disk/options?projectid=45",data:{},dataType:"json",async:!0,success:function(n){if(n.code==200){for(var e=n.data.userId,p="",r="",v="\u8BFE\u7A0B\u8BE6\u60C5",d="",l=deusid,h=[],f=0;f<l.length;f++)e!=parseInt(l[f])&&h.push(l[f]);for(var f=0,S=h.length;f<S;f++){var O=h[f];f<3&&(d+=","+O)}d=usid[0]+"&uid="+e+d,p=window.location.origin+window.location.pathname+"?"+d,window.history.replaceState(r,v,p)}}}),$.ajax({headers:{token:getCookie("token")},type:"GET",url:"/api/course/getCourseDetail?projectid=12",data:{courseId:getPar("cid"),isFromLive:sceneType=="1"?1:void 0,sceneId:sceneId||void 0},dataType:"json",async:!0,success:function(n){var e=n.data,p=e.courseId,r=e.price,v=window.location.href,d=e.courseName,l=e.courseId,h=e.cover,f=e.isPay;hid=e.activityId;var S=e.personNumLimit,O=e.personNumLimit-e.personNumCount,F=e.isInCart;if(types=e.type,e.courseType==3)var k=3;else var k=1;var q=e.isInCart,J=location.search;if(J.indexOf("?")!=-1)var M=J.substr(1),K=M.split("&"),P=K[0].split("cid="),G=M.split("&uid=");var H=window.location.origin+window.location.pathname+"?"+M,N=G[1]?G[1].split(","):[],A=e.parentCourseId,U=new Array,B=new Array;e.parentCourseId==0?(B[0]={goodsId:l,price:r,goodsUrl:H,goodsType:k,goodsName:d,cover:h,operateType:1},U[0]={courseId:l,courseName:d,orderTitle:d,orderType:k,price:r,firstLevelId:N[1],secondLevelId:N[2],thirdLevelId:N[3]}):(B[0]={goodsId:l,price:r,goodsUrl:H,goodsType:k,goodsName:d,cover:h,sourceSchoolCourseId:A,operateType:1},U[0]={courseId:l,courseName:d,orderTitle:d,orderType:k,price:r,firstLevelId:N[1],secondLevelId:N[2],thirdLevelId:N[3],sourceSchoolCourseId:A}),sceneType==1&&(U[0].sceneType="1",U[0].sceneId=sceneId);var Q="<img src="+((window.cdnPath||"")+e.cover)+' /><span class="touspe">'+e.courseName+"</span>";$(".curfeng").html(Q),e.isAudition==!0&&($(".auditions").append("<span class='dsre'>\u8BD5\u770B</span>"),$(".auditions").css("width","50px"));var c="";e.childClassifyName==""?c+='<p class="curint">'+e.mainClassifyName+"</p>":c+='<p class="curint">'+e.mainClassifyName+" > "+e.childClassifyName+"</p>",e.deadline==0?c+='<p class="curexplain">\u81EA\u8D2D\u4E70\u4E4B\u65E5\u8D77<span class="curseorange">\u6C38\u4E45\u6709\u6548':c+='<p class="curexplain">\u81EA\u8D2D\u4E70\u4E4B\u65E5\u8D77<span class="curseorange">'+e.deadline+"\u5929</span>\u6709\u6548",e.personNumLimit!=0&&(c+='<span class="ml10" style="color:#999;">\u5DF2\u8D2D\u4E70<span class="redes">'+e.personNumCount+"</span>/"+e.personNumLimit+"</span>"),c+="</p>",types==1?$.ajax({headers:{token:getCookie("token")},type:"GET",url:"/api/operate/getSeckillInfo?projectid=43",data:{flashBuyActivityId:hid},dataType:"json",async:!0,success:function(o){console.log(o);var s=o.data.flashBuyActivity,j=o.data.flashBuyCount/s.flashBuyLimit*100;datime=o.timeStamp;var i=new Date(datime),t=i.getTime(),u=new Date(s.gmtStart),g=u.getTime(),I=new Date(s.gmtEnd),E=I.getTime();rightTime=g-t,leftTime=E-t,console.log(s);var a='<div class="stime">';if(a+='<span class="znars">\u9650\u65F6\u79D2\u6740</span>',a+='<div class="lirig">',rightTime>=0?(a+='<span style="margin-right:5px;">\u8DDD\u79BB\u79D2\u6740\u5F00\u59CB\u8FD8\u6709</span>',a+='<span id="_d">00</span>\u5929',a+='<span id="_h">00</span>:',a+='<span id="_m">00</span>:',a+='<span id="_s">00</span>'):leftTime>=0?(a+='<span style="margin-right:5px;">\u8DDD\u79BB\u79D2\u6740\u7ED3\u675F\u8FD8\u6709</span>',a+='<span id="_d">00</span>\u5929',a+='<span id="_h">00</span>:',a+='<span id="_m">00</span>:',a+='<span id="_s">00</span>'):a+="<span>\u6D3B\u52A8\u7ED3\u675F</span>",a+="</div>",a+="</div>",a+='<p class="cursered weits">',a+='<span class="cursi">\uFFE5</span>'+(s.price/100).toFixed(2)+"",a+='<span class="cursezhe">\uFFE5'+(s.oldPrice/100).toFixed(2)+"</span>",rightTime<0&&flashBuyCount!=flashBuyLimit&&(a+='<span class="misrde">',a+="\u5DF2\u62A2"+j+'%<span class="resde">',a+='<span class="bsrdes" style="width:'+j+'%"></span>',a+="</span>",a+="</span>"),a+="</p>",a+='<p class="cursimp">'+e.introduce+"</p>",a+='<div class="inrout">',e.isFavorite==!0?(a+='<span class="curcolls">\u5DF2\u6536\u85CF</span>',a+='<span style="display:none;" class="curcoll">\u6536\u85CF</span>'):(a+='<span class="curcoll">\u6536\u85CF</span>',a+='<span style="display:none;" class="curcolls">\u5DF2\u6536\u85CF</span>'),a+='<span class="curshare">\u5206\u4EAB</span>',rightTime>=0?(e.isPay==!0?a+='<a class="opening" href="javascript:void(0);">\u8FDB\u5165\u5B66\u4E60</a>':a+='<a class="opening" href="javascript:void(0);">\u76F4\u63A5\u5F00\u901A\uFFE5'+s.oldPrice/100+"</a>",a+='<a class="seckill huise" href="javascript:void(0);">\u79D2\u6740\uFFE5'+s.price/100+"</a>"):flashBuyCount==flashBuyLimit?(e.isPay==!0?a+='<a class="opening" style="border-radius:20px;" href="javascript:void(0);">\u8FDB\u5165\u5B66\u4E60</a>':a+='<a class="opening" style="border-radius:20px;" href="javascript:void(0);">\u76F4\u63A5\u5F00\u901A\uFFE5'+s.oldPrice/100+"</a>",a+='<a class="huiwu" href="javascript:void(0);">\u5DF2\u62A2\u5B8C</a>'):e.isPay==!0?a+='<a class="opening" style="border-radius:20px;" href="javascript:void(0);">\u8FDB\u5165\u5B66\u4E60</a>':a+='<a class="seckill" style="border-radius:20px;margin-right:10px;" href="javascript:void(0);">\u79D2\u6740\uFFE5'+s.price/100+"</a>",a+="</div>",setTimeout(function(){$(".curwithin").append(a),D(),$(".opening").on("click",function(){var m=new Array,T=s.oldPrice;e.parentCourseId==0?m[0]={goodsId:l,price:T,goodsUrl:v,goodsType:k,goodsName:d,cover:h,operateType:1}:m[0]={goodsId:l,price:T,goodsUrl:v,goodsType:k,goodsName:d,cover:h,sourceSchoolCourseId:A,operateType:1},channels=getchannel(),user.isLogin(function(w){w.success?w.data.userTypeExact=="STUDENT"?f==!0?window.location.href="/myroom/#/learn/center":$.ajax({headers:{token:getCookie("token")},type:"POST",url:"/api/order/shoppingCart?projectid=22",contentType:"application/json",dataType:"json",data:JSON.stringify({goodsList:m,pvid:channels.pvid,uvcid:channels.uvcid,shareUserId:channels.shareUserId,clientType:channels.channel}),async:!0,success:function(y){window.location.href="/myroom/#/shopping"}}):layer.alert("\u53EA\u6709\u5B66\u751F\u8D26\u53F7\u624D\u80FD\u8D2D\u4E70\uFF01"):parseInt(w.code)==401?user.loginLayer(function(y){y.success&&details()}):layer.alert("\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458\uFF01")})}),$(".seckill").on("click",function(){if(rightTime<0){var m=new Array,T=s.price;e.parentCourseId==0?m[0]={goodsId:l,price:T,goodsUrl:v,goodsType:k,goodsName:d,cover:h,operateType:3}:m[0]={goodsId:l,price:T,goodsUrl:v,goodsType:k,goodsName:d,cover:h,sourceSchoolCourseId:A,operateType:3},channels=getchannel(),user.isLogin(function(w){w.success?w.data.userTypeExact=="STUDENT"?f==!0?window.location.href="/myroom/#/learn/center":$.ajax({headers:{token:getCookie("token")},type:"POST",url:"/api/order/shoppingCart?projectid=22",contentType:"application/json",dataType:"json",data:JSON.stringify({goodsList:m,pvid:channels.pvid,uvcid:channels.uvcid,shareUserId:channels.shareUserId,clientType:channels.channel}),async:!0,success:function(y){window.location.href="/myroom/#/shopping"}}):layer.alert("\u53EA\u6709\u5B66\u751F\u8D26\u53F7\u624D\u80FD\u8D2D\u4E70\uFF01"):parseInt(w.code)==401?user.loginLayer(function(y){y.success&&details()}):layer.alert("\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458\uFF01")})}})},0),rightTime>=0){var _=function(m){var T=Math.floor(m);return T>9?T:"0"+T},L=function(){rightTime<950&&rightTime>-950&&details();var m,T,w,y;m=Math.floor(rightTime/1e3/60/60/24),T=Math.floor(rightTime/1e3/60/60%24),w=Math.floor(rightTime/1e3/60%60),y=Math.floor(rightTime/1e3%60),m=m<10?"0"+m:m,T=T<10?"0"+T:T,w=w<10?"0"+w:w,y=y<10?"0"+y:y,document.getElementById("_d").innerHTML=m,document.getElementById("_h").innerHTML=T,document.getElementById("_m").innerHTML=w,document.getElementById("_s").innerHTML=y,rightTime=rightTime-1e3};setTimeout(L,100);var W=setInterval(L,1e3)}else if(leftTime>=0){var _=function(y){var x=Math.floor(y);return x>9?x:"0"+x},L=function(){leftTime<950&&leftTime>-950&&location.reload();var y,x,b,C;y=Math.floor(leftTime/1e3/60/60/24),x=Math.floor(leftTime/1e3/60/60%24),b=Math.floor(leftTime/1e3/60%60),C=Math.floor(leftTime/1e3%60),y=y<10?"0"+y:y,x=x<10?"0"+x:x,b=b<10?"0"+b:b,C=C<10?"0"+C:C,document.getElementById("_d").innerHTML=y,document.getElementById("_h").innerHTML=x,document.getElementById("_m").innerHTML=b,document.getElementById("_s").innerHTML=C,leftTime=leftTime-1e3};setTimeout(L,100);var W=setInterval(L,1e3)}else clearInterval(W)}}):types==2?$.ajax({headers:{token:getCookie("token")},type:"GET",url:"/api/operate/pcGroupActiviy?projectid=43",data:{groupActivityId:hid},dataType:"json",async:!0,success:function(o){console.log(o);var s=o.data,j=s.groupFoundId,i='<p class="cursered weits">';e.price==0?i+='<span class="curselv">\u514D\u8D39</span>':i+='<span class="cursi">\uFFE5</span>'+(s.price/100).toFixed(2)+"",i+="</p>",i+='<p class="cursimp">'+e.introduce+"</p>",i+='<div class="inrout">',e.isFavorite==!0?(i+='<span class="curcolls">\u5DF2\u6536\u85CF</span>',i+='<span style="display:none;" class="curcoll">\u6536\u85CF</span>'):(i+='<span class="curcoll">\u6536\u85CF</span>',i+='<span style="display:none;" class="curcolls">\u5DF2\u6536\u85CF</span>'),i+='<span class="curshare">\u5206\u4EAB</span>',e.isPay==!0?i+='<a class="opening" style="border-radius:20px" href="javascript:void(0);">\u8FDB\u5165\u5B66\u4E60</a>':(i+='<a class="opening" href="javascript:void(0);">\u5355\u72EC\u8D2D\u4E70</a>',s.type==0?i+='<a class="seckill" href="javascript:void(0);">\u53D1\u8D77\u62FC\u56E2</a>':i+='<a class="seckill" href="javascript:void(0);">\u5206\u4EAB\u62FC\u56E2</a>'),i+="</div>",$(".curwithin").append(i),D(),$(".opening").on("click",function(){var t=new Array,u=s.oldPrice;t[0]={goodsId:l,price:u,goodsUrl:v,goodsType:1,goodsName:d,cover:h,operateType:1},channels=getchannel(),user.isLogin(function(g){g.success?g.data.userTypeExact=="STUDENT"?f==!0?window.location.href="/myroom/#/learn/center":$.ajax({headers:{token:getCookie("token")},type:"POST",url:"/api/order/shoppingCart?projectid=22",contentType:"application/json",dataType:"json",data:JSON.stringify({goodsList:t,pvid:channels.pvid,uvcid:channels.uvcid,shareUserId:channels.shareUserId,clientType:channels.channel}),async:!0,success:function(I){window.location.href="/myroom/#/shopping"}}):layer.alert("\u53EA\u6709\u5B66\u751F\u8D26\u53F7\u624D\u80FD\u8D2D\u4E70\uFF01"):parseInt(g.code)==401?user.loginLayer(function(I){I.success&&details()}):layer.alert("\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458\uFF01")})}),$(".seckill").on("click",function(){channels=getchannel();var t=new Array,u=s.price;t[0]={goodsId:l,price:u,goodsUrl:v,goodsType:1,goodsName:d,cover:h,operateType:2},user.isLogin(function(g){g.success?g.data.userTypeExact=="STUDENT"?f==!0?window.location.href="/myroom/#/learn/center":s.type==0?$.ajax({headers:{token:getCookie("token")},type:"POST",url:"/api/order/shoppingCart?projectid=22",contentType:"application/json",dataType:"json",data:JSON.stringify({goodsList:t,pvid:channels.pvid,uvcid:channels.uvcid,shareUserId:channels.shareUserId,clientType:channels.channel}),async:!0,success:function(I){window.location.href="/myroom/#/shopping"}}):window.location.href="/pages/routine/group.html?cid="+P[1]+"&did="+j+"":layer.alert("\u53EA\u6709\u5B66\u751F\u8D26\u53F7\u624D\u80FD\u8D2D\u4E70\uFF01"):parseInt(g.code)==401?user.loginLayer(function(I){I.success&&details()}):layer.alert("\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458\uFF01")})})}}):types==3?$.ajax({headers:{token:getCookie("token")},type:"GET",url:"/api/operate/pcBargainActivity?projectid=43",data:{bargainActivityId:hid},dataType:"json",async:!0,success:function(o){console.log(o);var s=o.data,j=s.bargainActivityId,i='<p class="cursered weits">';e.price==0?i+='<span class="curselv">\u514D\u8D39</span>':i+='<span class="cursi">\uFFE5</span>'+(e.price/100).toFixed(2)+"",i+="</p>",i+='<p class="cursimp">'+e.introduce+"</p>",i+='<div class="inrout">',e.isFavorite==!0?(i+='<span class="curcolls">\u5DF2\u6536\u85CF</span>',i+='<span style="display:none;" class="curcoll">\u6536\u85CF</span>'):(i+='<span class="curcoll">\u6536\u85CF</span>',i+='<span style="display:none;" class="curcolls">\u5DF2\u6536\u85CF</span>'),i+='<span class="curshare">\u5206\u4EAB</span>',e.isOpenSignUp==!0?e.isPay==!0?i+='<a class="opening" style="border-radius:20px" href="javascript:void(0);">\u8FDB\u5165\u5B66\u4E60</a>':(i+='<a class="opening" href="javascript:void(0);">\u76F4\u63A5\u5F00\u901A</a>',s.type==0?i+='<a class="seckill" href="javascript:void(0);">\u53EF\u780D\u81F3\uFFE5'+s.price/100+"</a>":i+='<a class="seckill" href="javascript:void(0);">\u5206\u4EAB\u780D\u4EF7</a>'):(i+='<a class="opening huise" href="javascript:void(0);">\u76F4\u63A5\u5F00\u901A</a>',i+='<a class="seckill huise" href="javascript:void(0);">\u53EF\u780D\u81F3\uFFE5'+s.price/100+"</a>"),i+="</div>",$(".curwithin").append(i),D(),$(".opening").on("click",function(){channels=getchannel();var t=new Array,u=s.oldPrice;t[0]={goodsId:l,price:u,goodsUrl:v,goodsType:k,goodsName:d,cover:h,operateType:1},user.isLogin(function(g){g.success?g.data.userTypeExact=="STUDENT"?f==!0?window.location.href="/myroom/#/learn/center":$.ajax({headers:{token:getCookie("token")},type:"POST",url:"/api/order/shoppingCart?projectid=22",contentType:"application/json",dataType:"json",data:JSON.stringify({goodsList:t,pvid:channels.pvid,uvcid:channels.uvcid,shareUserId:channels.shareUserId,clientType:channels.channel}),async:!0,success:function(I){window.location.href="/myroom/#/shopping"}}):layer.alert("\u53EA\u6709\u5B66\u751F\u8D26\u53F7\u624D\u80FD\u8D2D\u4E70\uFF01"):parseInt(g.code)==401?user.loginLayer(function(I){I.success&&details()}):layer.alert("\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458\uFF01")})}),$(".seckill").on("click",function(){user.isLogin(function(t){t.success?t.data.userTypeExact=="STUDENT"?s.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(u){window.location.href="/pages/routine/bargain.html?cid="+P[1]+"&did="+j+""}}):window.location.href="/pages/routine/bargain.html?cid="+P[1]+"&did="+j+"":layer.alert("\u53EA\u6709\u5B66\u751F\u8D26\u53F7\u624D\u80FD\u8D2D\u4E70\uFF01"):parseInt(t.code)==401?user.loginLayer(function(u){u.success&&details()}):layer.alert("\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458\uFF01")})})}}):(c+='<p class="cursered">',e.price==0?c+='<span class="curselv">\u514D\u8D39</span>':c+='<span class="cursi">\uFFE5</span>'+(e.price/100).toFixed(2)+"",c+="</p>",c+='<p class="cursimp">'+e.introduce+"</p>",c+='<div class="inrout">',e.isFavorite==!0?(c+='<span class="curcolls">\u5DF2\u6536\u85CF</span>',c+='<span style="display:none;" class="curcoll">\u6536\u85CF</span>'):(c+='<span class="curcoll">\u6536\u85CF</span>',c+='<span style="display:none;" class="curcolls">\u5DF2\u6536\u85CF</span>'),c+='<span class="curshare">\u5206\u4EAB</span>',e.isOpenSignUp==!0?e.isPay==!0?c+='<div class="cursign" style="border-radius:20px">\u8FDB\u5165\u5B66\u4E60</div>':e.price==0?c+='<div class="cursign" style="border-radius:20px">\u514D\u8D39\u8D2D\u4E70</div>':(c+='<div class="cursign">\u7ACB\u5373\u8D2D\u4E70</div>',F==!0?c+='<div class="curshop huise">\u52A0\u5165\u8D2D\u7269\u8F66</div>':c+='<div class="curshop">\u52A0\u5165\u8D2D\u7269\u8F66</div>'):(c+='<div class="cursign huise" >\u7ACB\u5373\u8D2D\u4E70</div>',c+='<div class="curshop huise" >\u52A0\u5165\u8D2D\u7269\u8F66</div>'),c+="</div>"),$(".curwithin").html(c),$(".coursemain").html(e.detail)==""?($(".coursemain").html("<div class='nodata'></div>"),$("li[tabs=1]").removeClass("active"),$("li[tabs=2]").addClass("active"),$(".hides").hide(),$(".hides:eq(1)").css("display","block")):$(".coursemain").html(e.detail),D();function D(){$(".curcoll").on("click",function(){channels=getchannel(),user.isLogin(function(o){o.success?$.ajax({headers:{token:getCookie("token")},type:"GET",url:"/api/course/collectCourse?projectid=37",contentType:"application/json",dataType:"json",async:!0,data:{courseId:l,pvid:channels.pvid,uvcid:channels.uvcid,shareUserId:channels.shareUserId,clientType:channels.channel},success:function(s){$(".curcoll").hide(),$(".curcolls").show()}}):parseInt(o.code)==401?user.loginLayer(function(s){s.success&&details()}):layer.open({content:"\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458",btn:"\u786E\u5B9A"})})}),$(".curcolls").on("click",function(){user.isLogin(function(o){o.success?$.ajax({headers:{token:getCookie("token")},type:"GET",url:"/api/course/cancelCollectCourse?projectid=37",data:{courseId:l},dataType:"json",async:!0,success:function(s){$(".curcolls").hide(),$(".curcoll").show()}}):parseInt(o.code)==401?user.loginLayer(function(s){s.success&&details()}):layer.open({content:"\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458",btn:"\u786E\u5B9A"})})}),$(".curshare").on("click",function(){var o=layer.open({type:2});user.isLogin(function(s){if(s.success){var j=window.imgEditor,i=this,t=s.data.userId;if(window.ajaxSend)return!1;var u=window.location.href.indexOf("bundle.html")>-1?"b":"c",g=location.search;if(g.indexOf("?")!=-1){var I=g.substr(1);if(strs=I.split("&"),u+=","+strs[0].split("=")[1],strs[1]){var E=strs[1].split("=")[1].split(",");u+=","+E.slice(0,3).join(",")}}$.ajax({type:"post",headers:{token:getCookie("token")},url:"/api/user/other/getPicCode?projectid=45",contentType:"application/json;charset=utf-8",dataType:"json",data:JSON.stringify({page:"pages/logs/logs",scene:u,width:"680"}),success:function(a){window.ajaxSend=!1,layer.close(o),a.success?j.shareLayer(a.data.picCode,lepic):layer.open({content:"\u751F\u6210\u5C0F\u7A0B\u5E8F\u7801\u5F02\u5E38\uFF0C"+a.message,skin:"msg",time:2})},error:function(a){window.ajaxSend=!1}})}else parseInt(s.code)==401?user.loginLayer(function(a){a.success&&details()}):layer.open({content:"\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458\uFF01",btn:"\u786E\u5B9A"})})})}$(".cursign").on("click",function(){channels=getchannel(),e.isOpenSignUp==!0&&user.isLogin(function(o){o.success?o.data.userTypeExact=="STUDENT"?f==!0?window.location.href="/myroom/#/learn/center":O<=0&&S!=0?layer.open({content:"\u8D2D\u4E70\u4EBA\u6570\u5DF2\u6EE1\uFF01",btn:"\u786E\u5B9A"}):r==0?layer.open({type:1,offset:"auto",content:'<div style="padding: 20px 80px;">\u8D2D\u4E70\u6210\u529F\uFF0C\u8FDB\u5165\u5B66\u4E60\u4E2D\u5FC3\uFF01</div>',btn:"\u786E\u8BA4",btnAlign:"c",yes:function(){channels.orderList=U,$.ajax({headers:{token:getCookie("token")},type:"POST",url:"/api/order/createOrder?projectid=22",contentType:"application/json",dataType:"json",data:JSON.stringify(channels),async:!0,success:function(s){window.location.href="/myroom/#/learn/center"}}),layer.closeAll()}}):$.ajax({headers:{token:getCookie("token")},type:"POST",url:"/api/order/shoppingCart?projectid=22",contentType:"application/json",dataType:"json",data:JSON.stringify({goodsList:B,pvid:channels.pvid,uvcid:channels.uvcid,shareUserId:channels.shareUserId,clientType:channels.channel}),async:!0,success:function(s){window.location.href="/myroom/#/shopping"}}):layer.open({content:"\u53EA\u6709\u5B66\u751F\u8D26\u53F7\u624D\u80FD\u8D2D\u4E70\uFF01",btn:"\u786E\u5B9A"}):parseInt(o.code)==401?user.loginLayer(function(s){s.success&&details()}):layer.open({content:"\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458\uFF01",btn:"\u786E\u5B9A"})})}),$(".curshop").on("click",function(){channels=getchannel(),e.isOpenSignUp==!0&&user.isLogin(function(o){o.success?o.data.userTypeExact=="STUDENT"?F==!0?$(".curshop").addClass("huise"):O==0&&S!=0?layer.open({content:"\u8D2D\u4E70\u4EBA\u6570\u5DF2\u6EE1\uFF01",btn:"\u786E\u5B9A"}):q==!1&&$.ajax({headers:{token:getCookie("token")},type:"POST",url:"/api/order/shoppingCart?projectid=22",contentType:"application/json",dataType:"json",data:JSON.stringify({goodsList:B,pvid:channels.pvid,uvcid:channels.uvcid,shareUserId:channels.shareUserId,clientType:channels.channel}),async:!0,success:function(s){details(),layer.open({content:"\u52A0\u5165\u6210\u529F\uFF01",skin:"msg",time:2})}}):layer.open({content:"\u53EA\u6709\u5B66\u751F\u8D26\u53F7\u624D\u80FD\u52A0\u5165\u8D2D\u7269\u8F66\uFF01",btn:"\u786E\u5B9A"}):parseInt(o.code)==401?user.loginLayer(function(s){s.success&&details()}):layer.open({content:"\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458\uFF01",btn:"\u786E\u5B9A"})})}),types==1&&$(".curintro").css("height","170px"),types==2&&($(".shaste").show(),$.ajax({headers:{token:getCookie("token")},type:"GET",url:"/api/operate/listByActivityId?projectid=43",data:{groupActivityId:hid},dataType:"json",async:!0,success:function(o){var s=o.data.list;console.log(s);for(var j=new Date(datime),i=j.getTime(),t="",u=0,g=s.length;u<g;u++){var I=new Date(s[u].gmtEnd),E=I.getTime(),a=E-i,_=formatDate(a);if(a>=0){var L=s[u].groupLimit-s[u].groupCount;t+='<div class="jstsde">',t+='<img class="ptimg" src='+((window.cdnPath||"")+s[u].headPortrait)+" />",t+='<span class="ptmane">'+s[u].loginName+"</span>",t+='<a class="ptbtn" href="javascript:void(0);">\u53BB\u62FC\u56E2</a>',t+='<div class="ptrisr">',t+='<span class="ptcha">\u8FD8\u5DEE<span class="redes">'+L+"\u4EBA</span>\u62FC\u6210</span>",t+='<span class="pthuit">\u5269\u4F59'+_+"</span>",t+="</div>",t+="</div>"}}$(".tuanlist").html(t),$(".ptbtn").on("click",function(){window.location.href="/pages/routine/group.html?cid="+P[1]+""})}}))}})}details(),(leftTime==0||rightTime==0)&&details(),getPar("cid")||(window.location.href="/");function list(n){$.ajax({headers:{token:getCookie("token")},type:"GET",url:"/api/course/getWaresByCourseId?projectid=12",data:{courseId:getPar("cid"),currentPage:n,pageSize:20},dataType:"json",async:!0,success:function(e){$(".curriculum").show();for(var p=e.data.list,r="",v=0,d=p.length;v<d;v++){var l=p[v];r+='<div class="tlete">',r+='<div class="catalogtit">'+l.directoryName+"("+l.courseWareCount+")</div>",r+="</div>";for(var h=0,f=l.courseWares.length;h<f;h++){var S=l.courseWares[h];r+='<div class="cataloglist">',r+='<h2 class="catalogrti">'+S.courseWareName+"</h2>",r+='<img class="catalogfeng" src='+((window.cdnPath||"")+S.cover)+" />",r+='<div class="catalogkt">',r+='<p class="catalogmain">'+S.introduce+"</p>",r+="</div>",r+="</div>"}}p.length==0?$(".catalog").html("<div class='nodata'></div>"):$(".catalog").html(r)}})}list(1);function getchannel(){var n,e=localStorage.appAdapt===!0||localStorage.appAdapt==="true";if(e){var p=sessionStorage.getItem("ip")||"",r=sessionStorage.getItem("channel")||"",v=sessionStorage.getItem("gmtStart")||0,d=sessionStorage.getItem("sourceId")||0,l=sessionStorage.getItem("sourceJson")||"",h=sessionStorage.getItem("sourceType")||"";n={ip:p,channel:r,gmtStart:v,sourceId:d,sourceJson:l,sourceType:h}}else{n=sessionStorage.getItem("cluechannel")?JSON.parse(sessionStorage.getItem("cluechannel")):{};var p=sessionStorage.getItem("sourceip");n.ip=p||""}var f=getPar("channel")||"";return f&&(n.channel=f),n.uvcid=localStorage.uvcid||"",n.pvid=sessionStorage.getItem("pvid")||"",n}function getCookie(n){for(var e=document.cookie,p=e.split("; "),r=0;r<p.length;r++){var v=p[r].split("=");if(v[0]==n)return v[1]}return""}function formatDate(n){n=new Date(n);var e=n.getDate(),p=n.getHours(),r=n.getMinutes();return r=r<10?"0"+r:r,e=e<10?"0"+e:e,p=p<10?"0"+p:p,e+"\u5929"+p+":"+r}function getPar(n){var e=document.location.href,p=e.indexOf(n+"=");if(p==-1)return!1;var r=e.slice(n.length+p+1),v=r.indexOf("&");return v!=-1&&(r=r.slice(0,v)),r}