webpackJsonp([5],{"/cjr":function(t,e,s){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=s("OF5A"),a=s.n(i),n={data:function(){return{cid:this.$route.query.cid,ctype:this.$route.query.type,Dshow:!1,dtimer:null,dnum:0,bannerP:[{imgUrl:s("PvuI"),title:"探究农耕之谜",count:"256"},{imgUrl:s("fvVt"),title:"劳动遇见农趣",count:"256"},{imgUrl:s("jkZ+"),title:"少年农场农耕大课堂",count:"256"},{imgUrl:s("yIK8"),title:"田园学堂劳动实践",count:"256"}],dataRes:[],playerOptions:{playbackRates:[.7,1,1.5,2],autoplay:!1,muted:!1,loop:!1,preload:"auto",language:"zh-CN",aspectRatio:"16:9",fluid:!0,sources:[{type:"video/mp4",src:""}],notSupportedMessage:"此视频暂无法播放,请稍后再试",controlBar:{timeDivider:!0,durationDisplay:!0,remainingTimeDisplay:!1,fullscreenToggle:!0}},playerO:{}}},computed:{playsinline:function(){var t=navigator.userAgent.toLocaleLowerCase();return null==t.match(/tencenttraveler/)&&null==t.match(/qqbrowse/)}},methods:{goBack:function(){if(this.$router.isBack=!0,window.history.length<=1)return this.dtimer&&clearInterval(this.dtimer),this.$router.push({path:"/"}),!1;this.dtimer&&clearInterval(this.dtimer),this.$router.go(-1)},getCourse:function(){var t=this,e={cid:this.cid?this.cid:""};this.ajax.get(this.$store.state.api+"getCourseByid",e).then(function(e){console.log(e.data);e.data[0].length>0&&e.data[0].filter(function(t){return t.imgUrl=JSON.parse(t.chapters).poster,t.mediaList=JSON.parse(t.chapters).midia.split(","),t}),t.dataRes=e.data[0][0],t.playerOptions.poster=t.dataRes.imgUrl,t.playerOptions.sources[0].src=t.dataRes.mediaList[0],t.playerO=t.playerOptions,console.log(t.dataRes),console.log(t.playerOptions)}).catch(function(t){console.error(t)})},switchVideo:function(t,e){this.playerO={},this.playerOptions.poster="",this.playerOptions.sources[0].src=t,this.playerO=this.playerOptions},goTo:function(t){this.dtimer&&clearInterval(this.dtimer),this.$router.push(t)},onPlayerPlay:function(t){var e=this;"1"==e.ctype&&(e.dtimer=setInterval(function(){e.dnum++,20==e.dnum&&(e.addScore(),e.ctype="2")},1e3))},onPlayerPause:function(t){this.dtimer&&clearInterval(this.dtimer)},handleClose:function(t,e){e()},addScore:function(){var t=this,e=[{uid:this.$store.state.userInfo.userid,score:1,c:"积分增加-学习新课程"}];this.ajax.post(this.$store.state.api+"addScore",e).then(function(e){t.Dshow=!0}).catch(function(t){console.error(t)})},full:function(t){if(t.requestFullscreen)t.requestFullscreen();else if(t.mozRequestFullScreen)t.mozRequestFullScreen();else if(t.msRequestFullscreen)t.msRequestFullscreen();else if(t.oRequestFullscreen)t.oRequestFullscreen();else if(t.webkitRequestFullscreen)t.webkitRequestFullScreen();else{var e=document.getElementsByClassName("video-player");e.style.cssText="width:100%;height:100%;overflow:hidden;;margin:0px;padding:0px;",e.IsFullScreen=!0}},onPlayerCanplay:function(t){console.log("player Canplay!",t);var e=navigator.userAgent.toLocaleLowerCase();null!=e.match(/tencenttraveler/)||null!=e.match(/qqbrowse/)?a()("body").find("video").attr("x-webkit-airplay",!0).attr("x5-playsinline",!0).attr("webkit-playsinline",!0).attr("playsinline",!0):a()("body").find("video").attr("webkit-playsinline","true").attr("playsinline","true")}},destroyed:function(){this.dtimer&&clearInterval(this.dtimer)},beforeRouteLeave:function(t,e,s){this.dtimer&&clearInterval(this.dtimer),s()},created:function(){this.getCourse()}},r={render:function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"pb_content2"},[i("div",{staticClass:"pb_head"},[i("van-icon",{staticClass:"pb_back",attrs:{name:"arrow-left",color:"#fff",size:"1.2rem"},on:{click:t.goBack}}),t._v(" "),i("span",[t._v(t._s(t.dataRes.title))])],1),t._v(" "),i("div",{staticClass:"pb_content_body"},[i("div",{staticClass:"cd_content_head"},[i("div",{staticClass:"cd_content_img"},[i("video-player",{ref:"videoPlayer",staticClass:"video-player vjs-custom-skin",staticStyle:{width:"100%",height:"100%"},attrs:{playsinline:t.playsinline,options:t.playerO},on:{canplay:function(e){return t.onPlayerCanplay(e)},play:function(e){return t.onPlayerPlay(e)},pause:function(e){return t.onPlayerPause(e)}}})],1),t._v(" "),i("div",{staticClass:"cd_content_title"},[t._v(t._s(t.dataRes.title))]),t._v(" "),i("div",{staticClass:"cd_content_steps van-hairline--top"},t._l(t.dataRes.mediaList,function(e,s){return i("div",{key:e,staticClass:"cd_steps_box",on:{click:function(i){return t.switchVideo(e,s)}}},[i("i",{class:{active:t.playerOptions.sources[0].src==e}}),t._v(" "),i("span",[t._v("视频"+t._s(s+1))])])}),0)]),t._v(" "),t._e()]),t._v(" "),i("div",{staticClass:"cd_bottom"},[i("button",{on:{click:function(e){return t.goTo("/class/submitWork?cid="+t.cid)}}},[t._v("提交实践作业")])]),t._v(" "),i("van-dialog",{staticClass:"present",staticStyle:{"border-radius":"7px"},attrs:{"show-confirm-button":!1,"overlay-class":"classOverlay","close-on-click-overlay":"","before-close":t.handleClose,theme:"round-button","bind:cancel":"colseArea"},model:{value:t.Dshow,callback:function(e){t.Dshow=e},expression:"Dshow"}},[i("div",{staticClass:"dia_title"},[i("div",{staticClass:"close",on:{click:function(e){t.Dshow=!1}}},[i("img",{attrs:{src:s("Nj/8")}})])]),t._v(" "),i("div",{staticClass:"dia_content"},[i("div",{staticStyle:{position:"relative"}},[i("img",{attrs:{src:s("4lfJ")}}),t._v(" "),i("span",{staticClass:"scoreInner"},[t._v("提交成功")])]),t._v(" "),i("div",{staticClass:"score"},[t._v("\n 恭喜获得\n "),i("span",{staticStyle:{color:"orange","font-size":"1.8rem",margin:"0 .5rem"}},[t._v("1")]),t._v("积分\n ")]),t._v(" "),i("div",{staticClass:"btn",on:{click:function(e){t.Dshow=!1}}},[t._v("我收下了")])])])],1)},staticRenderFns:[function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"recommend-class-title"},[e("span",[this._v("视频列表")])])}]};var o=s("VU/8")(n,r,!1,function(t){s("BApx")},"data-v-a6fdea5c",null);e.default=o.exports},BApx:function(t,e){},PvuI:function(t,e,s){t.exports=s.p+"static/img/tu21.41cd8af.png"},fvVt:function(t,e,s){t.exports=s.p+"static/img/tu32.c5d1d32.png"},"jkZ+":function(t,e,s){t.exports=s.p+"static/img/tu33.036b842.png"},yIK8:function(t,e,s){t.exports=s.p+"static/img/tu34.1dd94d9.png"}}); //# sourceMappingURL=5.bceb9e1dd2a2f2b7b118.js.map