2 lines
31 KiB
JavaScript
2 lines
31 KiB
JavaScript
|
var cdnPath="",upLoadClicktag=0,wapurl=window.location.origin+"/pages/wap/ware.html"+window.location.search;/Android|webOS|iPhone|iPod|iPad|BlackBerry/i.test(navigator.userAgent)&&(window.location.href=wapurl);function getNeedSubscribe(r){var p=this;r&&r();return;var t}function request(r){var p=r.url,t=r.type||"GET",o=r.data,e=r.success,s=r.error,y=r.loading,i=r.noCloseLayer;y&&layer.load(2),$.ajax({headers:{token:getCookie("token")},type:t,url:p,contentType:"application/json",dataType:"json",data:o,async:!0,success:function(c){i||layer.closeAll(),e(c)},error:function(c){layer.closeAll(),s(c)}})}var retit,futit,videoAuditionSet,m3u8,rids=getPar("rid"),_w=parseInt($(window).width());$(".coursemain img").each(function(r){var p=$(this),t,o;$("<img/>").attr("src",$(p).attr("src")).load(function(){t=this.width,o=this.height,t>=_w&&$(p).css("width","100%").css("height","auto"),t<1200&&$(p).css("width",t+"px").css("height",o+"px")})}),rids||(window.location.href="/");var rtime,rtype,cid,isYouhui,courseOnlyBalance,userInfo,brond=!1,channels=getchannel();function nofind(){var r=event.srcElement;r.src="/static/common/image/course/fengmian.jpg",r.onerror=null}$.ajax({headers:{token:getCookie("token")},type:"GET",url:"/api/common/mu/getAuditionM3u8.m3u8?projectid=45",data:{courseWareId:rids,onlyQuery:1},dataType:"json",async:!1,success:function(r){if(parseInt(r.code)==200)brond=!0,m3u8="/api/common/mu/getAuditionM3u8.m3u8?courseWareId="+rids;else{switch(parseInt(r.code)){case 403:r.message="\u8BFE\u4EF6\u6CA1\u6709\u8BBE\u7F6E\u8BD5\u542C!";break;case 404:r.message="\u8BFE\u4EF6\u89C6\u9891\u4E0D\u5B58\u5728!";break;case 503:r.message="\u8F6C\u7801\u672A\u5B8C\u6210!";break;case 406:r.message="\u8BD5\u542C\u8BBE\u7F6E\u4E0D\u6B63\u786E!";break}$(".curfengs").on("click",".bose",function(){layer.msg(r.message,{icon:5})})}}});function details(r){$.ajax({headers:{token:getCookie("token")},type:"GET",url:"/api/jwt/getLoginUser?projectid=45",data:{},dataType:"json",async:!0,success:function(p){p.code==200&&(userInfo=p.data,r&&r(p))}}),$.ajax({headers:{token:getCookie("token")},type:"GET",url:"/api/course/getCourseWareDetail?projectid=12",data:{courseId:getPar("cid"),courseWareId:rids},dataType:"json",async:!1,success:function(p){var t=p.data,o=t.introduce,e=window.location.href,s=t.courseWareName,y=rids,i=t.isPay,c=t.isInCart,T=t.cover;cid=t.courseId,courseOnlyBalance=t.courseOnlyBalance||0,videoAuditionSet=t.videoAuditionSet,retit=t.courseWareName,isYouhui=t.isDiscounts||!1;var d=t.price?JSON.parse(t.price):[];if(videoAuditionSet){var I=JSON.parse(videoAuditionSet);rtime=I.time,rtype=I.type;var u='<span class="bose"></span><img class="zaimg" src='+(cdnPath+T)+' onerror="nofind();" />'}else var u="<img src="+(cdnPath+T)+' onerror="nofind();" />';var f=new Array,w=new Array;w[0]={goodsId:y,price:d[0],goodsUrl:e,goodsType:2,goodsName:s,cover:T,introduce:o,endTime:d[1]},f[0]={courseWareId:y,courseWareName:s,orderTitle:s,orderType:2,price:d[0]},courseOnlyBalance==1&&(f[0]={courseWareId:y,courseWareName:s,orderTitle:s,orderType:2,price:d[0],paymentSource:"6"}),$(".curfengs").html(u);var a='<h2 class="curhtit">'+t.courseWareName+"</h2>";t.childClassifyName==""?a+='<p class="curint">'+t.mainClassifyName+" > "+t.courseName+"</p>":a+='<p class="curint">'+t.mainClassifyName+" > "+t.childClassifyName+" > "+t.courseName+"</p>",t.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>',a+='<p class="cursimp" style="width: 100%" title='+t.introduce+">"+t.introduce+"</p>",a+='<p class="cursered">',d[0]?(a+='<span class="cursi">\uFFE5</span>'+(d[0]/100).toFixed(2)+"",a+="</p>",d[1]&&(a+='<p class="curexplain">\u81EA\u62A5\u540D\u4E4B\u65E5\u8D77<span class="curseorange">'+d[1]+"\u5929</span>\u6709\u6548</p>")):d[0]==0&&(a+='<span class="curselv">\u514D\u8D39</span>',a+="</p>",d[1]&&(a+='<p class="curex
|