(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-d971c80a"],{"25cc":function(e,t,o){e.exports=o.p+"assets/img/carousel_default.b0e9bfe4.jpg"},"2cb7":function(e,t,o){"use strict";o("ee89")},"59ab":function(e,t,o){"use strict";var n=o("f2bf");const i={class:"img_container"},s={class:"header_img"},l=["src"];function a(e,t,o,a,c,r){return Object(n["openBlock"])(),Object(n["createElementBlock"])("div",i,[Object(n["createElementVNode"])("div",s,[Object(n["createElementVNode"])("img",{src:r.useImgUrl,alt:""},null,8,l)])])}var c={name:"top-imgview",props:{imgUrl:{required:!0,type:String,default:""}},computed:{useImgUrl(){return this.imgUrl||""==this.imgUrl?this.imgUrl:o("25cc")}}},r=(o("2cb7"),o("6b0d")),d=o.n(r);const u=d()(c,[["render",a],["__scopeId","data-v-8a3ecbf4"]]);t["a"]=u},"65e4":function(e,t,o){"use strict";o("7305")},7305:function(e,t,o){},"7be8":function(e,t,o){"use strict";o.r(t);var n=o("f2bf");const i=e=>(Object(n["pushScopeId"])("data-v-046b92af"),e=e(),Object(n["popScopeId"])(),e),s={class:"detail"},l={class:"info-page-title"},a={class:"info-page-tip"},c={class:"info-page-live"},r=["src","poster"],d={class:"info-page-introduce"},u=i(()=>Object(n["createElementVNode"])("span",null,"课程简介",-1)),g=["innerHTML"],h=["src"];function m(e,t,o,i,m,v){const b=Object(n["resolveComponent"])("topimgview"),f=Object(n["resolveComponent"])("el-breadcrumb-item"),p=Object(n["resolveComponent"])("el-breadcrumb"),w=Object(n["resolveComponent"])("score-list"),y=Object(n["resolveComponent"])("score");return Object(n["openBlock"])(),Object(n["createElementBlock"])(n["Fragment"],null,[Object(n["createElementVNode"])("div",null,[Object(n["createElementVNode"])("header",null,[Object(n["createVNode"])(b,{imgUrl:m.detail.desImage},null,8,["imgUrl"])]),Object(n["createElementVNode"])("div",s,[Object(n["createVNode"])(p,{separator:"->"},{default:Object(n["withCtx"])(()=>[Object(n["createVNode"])(f,{to:{path:"/courses",query:{type:1}}},{default:Object(n["withCtx"])(()=>[Object(n["createTextVNode"])("课程回放")]),_:1}),Object(n["createVNode"])(f,null,{default:Object(n["withCtx"])(()=>[Object(n["createTextVNode"])(Object(n["toDisplayString"])(m.detail.tagName||"全部"),1)]),_:1})]),_:1}),Object(n["createElementVNode"])("div",l,Object(n["toDisplayString"])(m.detail.title),1),Object(n["createElementVNode"])("div",a,"主讲人: "+Object(n["toDisplayString"])(m.detail.presenter),1),Object(n["createElementVNode"])("div",c,[Object(n["createElementVNode"])("video",{ref:"videoPlayer",id:"videoPlay",src:m.detail.video,poster:m.detail.image,controls:"controls",controlslist:"nodownload",preload:"preload",aspectRatio:"16:9",onPause:t[0]||(t[0]=e=>v.videoPause()),onPlay:t[1]||(t[1]=e=>v.videoPlay()),oncontextmenu:"return false",onSeeked:t[2]||(t[2]=e=>v.videoSeeked()),onPlaying:t[3]||(t[3]=(...e)=>v.videoPlaying&&v.videoPlaying(...e)),onEnded:t[4]||(t[4]=(...e)=>v.videoEnd&&v.videoEnd(...e))},null,40,r)]),Object(n["createElementVNode"])("div",d,[u,Object(n["createElementVNode"])("p",{style:{"text-indent":"2em"},innerHTML:m.detail.remarks},null,8,g)]),Object(n["createElementVNode"])("img",{class:"info-page-detail",src:m.detail.courseware},null,8,h)])]),Object(n["createVNode"])(w,{class:"login",dialogFormVisible:m.scoreListVisible,listData:m.scoreList,onCloseview:v.closeEvaluation,onShowEvaluation:v.viewEvaluation},null,8,["dialogFormVisible","listData","onCloseview","onShowEvaluation"]),Object(n["createVNode"])(y,{class:"login",dialogFormVisible:m.dialogUnrated,evaluate:m.unrated.evaluate,id:m.unrated.id,presenter:m.unrated.presenter,title:m.unrated.title,className:m.unrated.className,onCloseview:v.closeUnrated},null,8,["dialogFormVisible","evaluate","id","presenter","title","className","onCloseview"])],64)}var v=o("7864"),b=o("dfa1"),f=o("4ea3"),p=o("1a1b"),w=o("12d4"),y=o("59ab"),S={name:"detail",components:{Comment:f["a"],scoreList:w["a"],score:p["a"],topimgview:y["a"]},inject:["$global","$api","$message"],data(){return{hoverTime:null,detail:{id:"",title:"",presenter:"",image:"",video:"",starttime:"",endtime:"",remarks:"",totalduration:0,tagId:-1,tagName:""},videoPlayTimer:null,videoCanPlay:!1,id:"",utc:"",city:"",Presenter:"",flowInfoTimer:"",playTime:0,remarks:[],scoreListVisible:!1,dialogUnrated:!1,scoreList:{},unrated:{evaluate:"",id:"",presenter:"",title:"",className:""}}},mounted(){this.id=this.$route.query.id,this.utc=this.$route.query.utc,this.city=this.$route.query.city,b["b"].scheduleId=this.id,b["b"].connect(),b["b"].onNotifyWSStatus(e=>{console.log("NotifyWSStatus",e),"1"==e.status&&(this.playTime=0)}),this.schedule()},beforeUnmount(){console.log("销毁"),b["b"].disconnect(),clearInterval(this.flowInfoTimer),clearInterval(this.videoPlayTimer)},methods:{schedule(){this.$api.courses.postCourseDetail({},this.id,1).then(e=>{let t=e.data;0===t.code?(this.detail=t.data,console.log("api logout success"),b["b"].connect(),this.showVideoPlayDialog()):console.log("api logout error")}).catch(()=>{console.log("api logout error")})},videoPlay(){console.info("开始播放时触发 "),this.sendTrafficData();let e={type:"3",uuid:sessionStorage.getItem("uuid")};e=JSON.stringify(e),console.log("params",e),b["b"].ws?b["b"].ws.send(e):b["b"].connect()},videoSeeked(){const e=this.$refs.videoPlayer.currentTime;console.log("videoSeeked",e),this.stopVideoPlayerIfNeeded(e)},videoPlaying(){const e=this.$refs.videoPlayer.currentTime;console.log("videoPlaying",e),clearInterval(this.videoPlayTimer),this.stopVideoPlayerIfNeeded(e)||(this.videoPlayTimer=setInterval(()=>{const e=this.$refs.videoPlayer.currentTime;console.log("videoPlaying2",e),this.stopVideoPlayerIfNeeded(e)},800))},videoEnd(){clearInterval(this.videoPlayTimer)},videoPause(){console.info("暂停播放时触发 "),clearInterval(this.flowInfoTimer),clearInterval(this.videoPlayTimer)},stopVideoPlayerIfNeeded(e){return!this.$global.isExitVipInfo()&&e>360&&(this.$refs.videoPlayer.pause(),this.$refs.videoPlayer.load(),clearInterval(this.videoPlayTimer),this.videoPause(),this.showVideoPlayDialog(),!0)},showVideoPlayDialog(){this.$global.isExitVipInfo()||v["b"].confirm("非会员用户仅可观看6分钟,请登录后继续观看","提示",{confirmButtonText:"登录",cancelButtonText:"取消",type:"warning",center:!0}).then(()=>{this.$global.gotoLogin()}).catch(()=>{v["a"].warning("非会员用户仅可观看6分钟")})},sendTrafficData(){let e=this;e.flowInfoTimer&&(clearInterval(e.flowInfoTimer),e.flowInfoTimer=null),e.flowInfoTimer=setInterval(()=>{e.playTime+=10,console.log(" that.playTime:",e.playTime);let t={type:"2",duration:e.playTime,scheduleId:e.id,uuid:sessionStorage.getItem("uuid")};t=JSON.stringify(t),console.log("params",t),b["b"].ws?b["b"].ws.send(t):b["b"].connect()},1e4)},downloadExcel(e){this.downloadLog(e),console.log("courseware:",e);let t=document.createElement("a");t.href=e,t.click()},downloadLog(e){let t={scheduleId:this.id,fileUrl:e};this.$api.courses.downloadLog(t).then(e=>{let t=e.data;console.log(t),"0"==t.code?console.log("success"):console.log(" error")}).catch(()=>{console.log("api error")})},getCurrentTime(e,t){e*=1e3,t||(t=8);const o=new Date(e),n=o.getTime(),i=6e4*o.getTimezoneOffset(),s=n+i,l=new Date(s+36e5*t),a=(l.getFullYear(),l.getMonth()+1),c=l.getDate(),r=l.getHours(),d=l.getMinutes();l.getSeconds();function u(e){return e<10?"0"+e:e}const g=u(a)+"-"+u(c)+" "+u(r)+":"+u(d);return g},viewEvaluation(e){this.unrated=e,this.dialogUnrated=!0},closeEvaluation(){this.scoreListVisible=!1,this.dialogUnrated=!1},closeUnrated(e){e&&this.getScoreList(),this.dialogUnrated=!1},getScoreList(){let e={token:this.$global.getLoginToken(),"Access-Control-Allow-Headers":"Origin"};this.$api.login.getScoreList(e).then(e=>{let t=e.data;0===t.code?(console.log("getScoreList success",t.data),null==t.data||0==t.data.length?(this.scoreListVisible=!1,this.scoreList={}):(this.scoreListVisible=!0,this.scoreList=t.data)):console.log("getScoreList error")}).catch(()=>{console.log("getScoreList error")})},getWatch(){let e={token:this.$global.getLoginToken(),"Access-Control-Allow-Headers":"Origin",type:1};this.$api.login.getWatch(e,this.id).then(e=>{let t=e.data;0===t.code?console.log("getWatch success"):console.log("getWatch error")}).catch(()=>{console.log("getWatch error")})}}},O=(o("65e4"),o("6b0d")),C=o.n(O);const k=C()(S,[["render",m],["__scopeId","data-v-046b92af"]]);t["default"]=k},dfa1:function(e,t,o){"use strict";o.d(t,"b",(function(){return n})),o.d(t,"a",(function(){return i}));let n={connectCount:0,ws:null,heartbeatTimer:0,disconnected:!1,liveOfWebSocketPrefix:"wss://www.chinamuseum.org.cn/icom/ws/sc/",lockReconnect:!1,scheduleId:"",liveId:"",doctorListCallBack:null,registerWaitCallBack:null,startConsultationCallBack:null,endConsultationCallBack:null,onNotifyDoctorList(e){this.doctorListCallBack=e},onNotifyRegisterWait(e){this.registerWaitCallBack=e},onNotifyConsultationStart(e){this.startConsultationCallBack=e},onNotifyConsultationComplete(e){this.endConsultationCallBack=e},checkLiveStatusCallBack:null,onCheckLiveStatus(e){this.checkLiveStatusCallBack=e},chatMsgCallBack:null,onReceiveChatMsg(e){this.chatMsgCallBack=e},wsStatusCallBack:null,onNotifyWSStatus(e){this.wsStatusCallBack=e},connect(){let e=this,t=sessionStorage.getItem("loginInfo");if(t){t=JSON.parse(t);const o=t.token;let n=t.firstName,i=`${e.liveOfWebSocketPrefix}${e.scheduleId}?token=${o}&name=${n}&liveId=${e.liveId}`;console.info("WS:开始连接>>> connect ",i);const s=()=>{console.info("WS:页面关闭>>> disconnect"),e.disconnect()};if(e.ws){if(e.ws.readyState!=e.ws.CLOSED&&e.ws.readyState!=e.ws.CLOSING)return;e.ws.onclose=null,e.ws.onerror=null,e.ws=null}if(clearInterval(e.heartbeatTimer||-1),"WebSocket"in window)e.ws=new WebSocket(i);else{if(!("MozWebSocket"in window))return;{let t;e.ws=new t(i)}}e.ws.onopen=e.onOpen.bind(this),e.ws.onmessage=e.onMessage.bind(this),e.ws.onclose=e.onClose.bind(this),e.ws.onerror=e.onSocketError.bind(this),window.addEventListener("beforeunload",s)}},onOpen(e){let t=this;t.connectCount=0,t.disconnected=!1,t.startHeartbeat(),t.wsStatusCallBack({status:"1"})},onMessage(e){let t=null;try{if(t=JSON.parse(e.data),console.info("WS:接收到的信息>>>",t),"3"==t.type&&sessionStorage.setItem("uuid",t.uuid),"1"==t.type&&t.message){let e=JSON.parse(t.message);this.checkLiveStatusCallBack(e)}"6"==t.type&&this.chatMsgCallBack(t);let o=sessionStorage.getItem("liveStatus");if("status"in t.data&&t.data.status!=o){let e=document.createEvent("HTMLEvents");e.val="status change",e.initEvent("liveStatusChange",!0,!0),document.dispatchEvent(e),sessionStorage.setItem("liveStatus",t.status)}}catch(o){}},onClose(){let e=this;e.disconnected||e.reconnect()},onSocketError(){let e=this;e.reconnect()},disconnect(){let e=this;e.disconnected=!0,clearInterval(e.heartbeatTimer);try{e.ws.close(),e.ws=null}catch(t){console.info(JSON.stringify(t))}},reconnect(){let e=this;e.lockReconnect||(e.lockReconnect=!0,e.connectCount<30&&setTimeout(()=>{e.ws&&(e.ws.close(),e.ws=null),e.connect(),console.info(`WS:正在进行第${e.connectCount+1}次重连`),e.connectCount++,e.lockReconnect=!1},5e3))},startHeartbeat(){console.info("WS:心跳监测已开启");let e=this;clearInterval(e.heartbeatTimer||-1),e.heartbeatTimer=null,e.heartbeatTimer=setInterval(()=>{e.ws.send("{type: 1}")},1e4)},sendMsg(e){let t=this;t.ws.send(""+JSON.stringify(e)),console.log("sendMsg",JSON.stringify(e))}},i=e=>{let t=new Date(1e3*e),o=t.getFullYear().toString(),n=(t.getMonth()+1).toString(),i=t.getDate().toString(),s=t.getHours().toString(),l=t.getMinutes().toString(),a=t.getSeconds().toString();return 1===n.length&&(n="0"+n),1===i.length&&(i="0"+i),1===s.length&&(s="0"+s),1===l.length&&(l="0"+l),1===a.length&&(a="0"+a),o+"-"+n+"-"+i+" "+s+":"+l+":"+a}},ee89:function(e,t,o){}}]);