filesbox/web/dist/design/designstatic/front/routine/js/group.js

2 lines
5.4 KiB
JavaScript
Raw Permalink Normal View History

2024-07-26 06:10:54 +00:00
var datime,urls=location.search;if(urls.indexOf("?")!=-1)var ster=urls.substr(1),sty=ster.split("&"),cide=sty[0].split("cid="),bdid=ster.split("&did=");var leftTime,channels=getchannel();function datlts(){$.ajax({headers:{token:getCookie("token")},type:"GET",url:"/api/operate/selGroupFollowed?projectid=43",data:{groupFoundId:bdid[1]},dataType:"json",async:!0,success:function(a){var e=a.data,r=new Date(datime),s=r.getTime(),o=new Date(e.gmtEnd),i=o.getTime();leftTime=i-s;var p=e.groupCount,c=e.groupLimit,n=c-p,g=e.courseName,h=e.cover,I=e.price,d=new Array,T=window.location.href;d[0]={goodsId:cide[1],price:I,goodsUrl:T,goodsType:1,goodsName:g,cover:h,operateType:2};var t="";t+='<div class="topcover">',t+=" <img src="+((window.cdnPath||"")+h)+" />",t+=' <p class="ataser">\u8DDD\u79BB\u8BE5\u56E2\u7ED3\u675F\u8FD8\u6709',t+=' <span id="_d">00</span>\u5929',t+=' <span id="_h">00</span>:',t+=' <span id="_m">00</span>:',t+=' <span id="_s">00</span>',t+=" </p>",t+=' <p class="bottke">'+g+"</p>",t+="</div>",n==0?t+='<p class="pcen">\u8FD9\u4E2A\u56E2\u5DF2\u6EE1'+c+"\u4EBA\uFF0C\u62FC\u56E2\u6210\u529F\uFF01</p>":leftTime<=0?t+='<p class="pcen">\u672A\u8FBE\u5230\u6210\u56E2\u4EBA\u6570\uFF0C\u62FC\u56E2\u5931\u8D25\uFF01</p>':t+='<p class="pcen">\u8FD9\u4E2A\u56E2\u5DF2\u6709'+e.groupCount+"\u4EBA\uFF0C\u53EA\u5DEE"+n+"\u4EBA\u5C31\u6EE1\u5458</p>",e.groupFollows.length==1?t+='<div class="lsreet">':e.groupFollows.length==2?t+='<div class="lsreet" style="width:125px">':e.groupFollows.length==3?t+=' <span class="tuanses" style="188px">':e.groupFollows.length==4?t+=' <span class="tuanses" style="250px">':t+=' <span class="tuanses" width:100%;>';for(var u=0,S=e.groupFollows.length;u<S;u++){var f=e.groupFollows[u];t+=' <span class="tuanses">',f.isLeader==1?t+=" <span>\u56E2\u957F</span>":t+=" <span></span>",t+=" <img src="+((window.cdnPath||"")+f.headPortrait)+" />",t+=" </span>"}t+="</div>",n==0||leftTime<=0?t+='<a class="agroupbtn" href="javascript:void(0);">\u6211\u8981\u5F00\u56E2</a>':(e.type=0)?(t+='<a class="agroupbtn" href="javascript:void(0);">\u6211\u8981\u53C2\u56E2</a>',t+='<a class="showke" href="javascript:void(0);">\u67E5\u770B\u8BFE\u7A0B></a>'):t+='<a class="agroups" href="javascript:void(0);">\u627E\u5C0F\u4F19\u4F34\u4E00\u8D77\u62FC\u56E2</a>';var k=e.type;$(".wapbdat").html(t),$(".agroupbtn").on("click",function(){channels=getchannel(),user.isLogin(function(l){l.success?l.data.userTypeExact=="STUDENT"?n==0||leftTime<=0?$.ajax({headers:{token:getCookie("token")},type:"POST",url:"/api/order/shoppingCart?projectid=22",contentType:"application/json",dataType:"json",data:JSON.stringify({goodsList:d,pvid:channels.pvid,uvcid:channels.uvcid,shareUserId:channels.shareUserId,clientType:channels.channel}),async:!0,success:function(v){window.location.href="/myroom/#/shopping"}}):$.ajax({headers:{token:getCookie("token")},type:"POST",url:"/api/order/shoppingCart?projectid=22",contentType:"application/json",dataType:"json",data:JSON.stringify({goodsList:d,pvid:channels.pvid,uvcid:channels.uvcid,shareUserId:channels.shareUserId,clientType:channels.channel}),async:!0,success:function(v){window.location.href="/myroom/#/shopping"}}):layer.alert("\u53EA\u6709\u5B66\u751F\u8D26\u53F7\u624D\u80FD\u62A5\u540D\uFF01"):parseInt(l.code)==401?user.loginLayer(function(v){v.success&&datlts()}):layer.alert("\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458\uFF01")})});var m="",w="\u62FC\u56E2",y=window.location.href;$(".agroups").on("click",function(){var l=y+"?&";window.history.replaceState(m,w,l),$(".zhasr").show()}),$(".zhasr").on("click",function(){window.history.replaceState(m,w,y),$(this).hide()}),$(".showke").on("click",function(){window.location.href="/pages/routine/info.html?cid="+cide[1]+""})}})}datlts();var timeChange=function(){var a,e,r,s;leftTime>=0?(a=Math.floor(leftTime/1e3/60/60/24),e=Math.floor(leftTime/1e3/60/60%24),r=Math.floor(leftTime/1e3/60%60),s=Math.floor(leftTime/1e3%60)):(window.location.href="/pages/routine/info.html?"+ster+"",clearInterval(time)),a=a<10?"0"+a:a,e=e<10?"0"+e:e,r=r<10?"0"+r:r,s=s<10?"0"+s:s,document.getE