2 lines
6.3 KiB
JavaScript
2 lines
6.3 KiB
JavaScript
|
(function(){var v=parseInt($(window).width()),o=["/static/chatroom/js/xgplayer/xgplayer.js","/static/common/live/xgplayer-flv.js","/static/common/live/xgplayer-hls.js","/static/chatroom/video/playerreview.js"];$(".coursemain img").each(function(e){var t=$(this),i,r;$("<img/>").attr("src",$(t).attr("src")).load(function(){i=this.width,r=this.height,i>=v&&$(t).css("width","100%").css("height","auto"),i<1200&&$(t).css("width",i+"px").css("height",r+"px")})});function E(e){var t=new Date(e),i=t.getFullYear()+"-",r=t.getMonth()+1<10?"0"+(t.getMonth()+1):t.getMonth()+1,n=t.getDate()+" ",g=t.getHours()+":",c=t.getMinutes()+":",a=t.getSeconds();return i+r+n+g+c+a}var x;$.ajax({headers:{token:s("token")},type:"GET",url:"/api/jwt/getLoginUser?projectid=45",data:{},dataType:"json",async:!1,success:function(e){e.code==200&&(x=e.data.userId)}}),Date.prototype.format=function(e){var t={"M+":this.getMonth()+1,"d+":this.getDate(),"h+":this.getHours(),"m+":this.getMinutes(),"s+":this.getSeconds(),"q+":Math.floor((this.getMonth()+3)/3),S:this.getMilliseconds()};/(y+)/.test(e)&&(e=e.replace(RegExp.$1,(this.getFullYear()+"").substr(4-RegExp.$1.length)));for(var i in t)new RegExp("("+i+")").test(e)&&(e=e.replace(RegExp.$1,RegExp.$1.length==1?t[i]:("00"+t[i]).substr((""+t[i]).length)));return e},document.write('<link rel="stylesheet" href="/designschool/form/css/index.css">'),document.write('<link rel="stylesheet" href="/designschool/form/css/form.css">'),document.write('<script type="text/javascript" charset="utf-8" src="/designschool/form/DateTime/js/calendar.js"></script>'),document.write('<link rel="stylesheet" href="/designschool/form/DateTime/css/calendar.css">'),document.write('<script type="text/javascript" charset="utf-8" src="/designschool/form/js/md5.js"></script>');var y={init:function(e){var t=this;t.formId=e,t.getFormDate()},getFormDate:function(){var e=this;$.ajax({type:"GET",headers:{token:s("token")},url:" /api/common/findFormForStu?projectid=16",contentType:"application/json",dataType:"json",data:{formId:e.formId},async:!0,success:function(t){e.carryFormEvent(t)}})},carryFormEvent:function(e){var t=this,i=e.data||{},r=i.formInfo||{},n=i.answerInfo;window.playerItemList=r.itemList,parseInt(r.anonymousLimit)==0&&!s("token")?t.renderFormState("unlogin",e):parseInt(r.isMultiSubmit)==0&&parseInt(n.isFilled)==1?t.renderFormState("completed"):t.renderFormHtml(r)},renderFormState:function(e,t){var i=this,r="";switch(e){case"completed":r='<div style="text-align:center;font-size: 22px;height:32px;"><div class="textBox" style="height: 60px;text-align: center;color:#2f2d2c;"><p style="font-size: 12px;line-height: 30px;color:#999999;"><img src="//static.wxbig.cn/designschool/form/image/success.png" style="width: 18px;vertical-align: sub;margin-right: 7px;">\u6211\u4EEC\u5DF2\u6536\u5230\u60A8\u7684\u53CD\u9988, \u975E\u5E38\u611F\u8C22\u3002</p></div></div>';break;case"unlogin":r='<div style="text-align:center;font-size: 22px;height:500px;"><div class="textBox" style="height: 200px;text-align: center;color:#2f2d2c;"><p style="font-size: 20px;line-height: 30px;"><img src="//static.wxbig.cn/designschool/form/image/warn.png" style="width: 25px;vertical-align: sub;margin-right: 7px;">\u672A\u767B\u5F55</p><p style="font-size: 12px;line-height: 30px;color:#999999;">\u8BF7\u60A8<a class="loginFormEvent" style="color: #1890ff;cursor: pointer;">\u767B\u5F55</a>\u540E\u586B\u5199\uFF0C\u975E\u5E38\u611F\u8C22\uFF01</p></div></div>';break}$(".relationformul").html(r),$(".loginFormEvent").click(function(){user.loginLayer(function(n){n.success&&i.getFormDate()})})},renderFormHtml:function(e){var t=this;e.referenceSavePath&&$.ajax({type:"get",url:e.referenceSavePath,dataType:"html",success:function(i){if(i){var r="<div class='formtitle'>"+e.title+"</div><div class='formcontro' style='text-align: center;padding: 0 10px;'>"+e.description+"</div><div class='formcontent'>"+i+"</div>";$(".relationformul").html(r)}t.bindEvent()}})},bindEvent:function(){$.getScript("/designschool/form/js/formScript.js",function(){})}};function h(){var e,t,i,r=p()||u("formI
|