filesbox/web/dist/design/designstatic/front/js/info.js

2 lines
56 KiB
JavaScript
Raw Permalink Normal View History

2024-07-26 06:10:54 +00:00
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.te