1 line
15 KiB
JavaScript
1 line
15 KiB
JavaScript
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-64a20499"],{"3d1a":function(e,t,a){var i=a("6e600");i.__esModule&&(i=i.default),"string"===typeof i&&(i=[[e.i,i,""]]),i.locals&&(e.exports=i.locals);var o=a("499e").default;o("92020836",i,!0,{sourceMap:!1,shadowMode:!1})},"3f0a":function(e,t,a){"use strict";a.r(t);var i=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",[a("div",{staticClass:"chapter-video"},[e.videoUrl?a("video",{ref:"myVideo",attrs:{"x5-video-player-type":"h5","webkit-playsinline":"true",playsinline:"true","x5-playsinline":"true","x-webkit-airplay":"true","x5-video-ignore-metadata":"true",poster:e.chapterInfo.cover,Controls:"",src:e.videoUrl,id:"myVideo",width:"100%",height:"175px"},on:{ended:e.timeupdate,play:e.videoTimeData}},[a("source",{attrs:{src:e.videoUrl,type:"video/mp4"}}),a("source",{attrs:{src:e.videoUrl,type:"video/ogv"}})]):a("van-empty",{attrs:{description:"暂无视频"}}),a("div",{staticClass:"explain"},[a("h3",{staticClass:"line-clamp-2"},[e._v(e._s(e.chapterInfo.name))]),a("div",{staticClass:"details flex-j-sb flex-a-c"},[a("span",{staticClass:"browse"},[e._v("浏览 "+e._s(e.chapterInfo.views))]),a("div",{staticClass:"flex-a-c details-right",on:{click:e.backClick}},[a("span",[e._v("课程详情")]),a("span",{staticClass:"iconfont icon-advertise-next"})])])])],1),a("div",{staticClass:"chapter-list"},[a("div",{staticClass:"title flex-j-sb"},[a("div",[e._v("目录")]),a("div",[e._v("共"+e._s(e.chapterCount)+"章,"+e._s(e.sectionCount)+"小节")])]),a("div",{staticClass:"chapter-content",style:e.iPnoneBottomBol?"padding-bottom: 34px;":""},[e.chapterData.length>0?a("van-collapse",{attrs:{border:!1},model:{value:e.activeNames,callback:function(t){e.activeNames=t},expression:"activeNames"}},e._l(e.chapterData,(function(t,i){return a("block",{key:i},[a("van-collapse-item",{attrs:{name:t.id,border:!0},scopedSlots:e._u([{key:"title",fn:function(){return[a("div",{staticClass:"flex-a-c"},[a("div",{staticClass:"play"},[a("span",{staticClass:"iconfont icon-course_play"})]),a("h3",[e._v(e._s(t.name))])])]},proxy:!0}],null,!0)},e._l(t.section,(function(t,o){return a("block",{key:o,staticClass:"chapter-item"},[a("div",{staticClass:"flex-a-c content",on:{click:function(a){return a.stopPropagation(),e.sectionOn(t,o,i)}}},[a("h3",{staticClass:"line-clamp-2",class:e.subchapterIndex===o&&e.chapterIndex===i?"on":""},[e._v(e._s(t.name))]),a("div",{staticClass:"examine flex-a-c flex-j-sb"},[a("div",{staticClass:"time flex-a-c"},[0!==t.try_time||0!==t.video_second?a("span",{staticClass:"iconfont icon-course_time"}):e._e(),0!==e.courseStatus?a("span",[e._v(e._s(e.videoSecondTime(t.video_second)))]):0!=e.courseStatus||t.can_try?a("span",[e._v(e._s(e.videoSecondTime(t.try_time)))]):a("span",[e._v(e._s(e.videoSecondTime(t.video_second)))])]),1===e.courseStatus?a("span",{staticClass:"iconfont icon-course_lock"}):t.can_try&&0===e.courseStatus?a("div",{staticClass:"try-and"},[e._v("试看")]):a("span",{staticClass:"iconfont icon-course_unlock"})])])])})),1)],1)})),1):a("van-empty",{attrs:{description:"暂无数据"}}),e.page<e.total_page?a("p",{staticClass:"upload"},[e._v("下拉加载更多")]):e._e(),e.chapterData.length>0?a("p",{staticClass:"upload"},[e._v("加载完毕")]):e._e()],1)]),e.chapterInfo.time_limit&&0===e.courseStatus&&2===e.chapterInfo.sale_mode?a("van-notice-bar",{style:e.iPnoneBottomBol?"bottom: 34px;":"",attrs:{mode:"closeable"}},[a("div",[e._v("课程有效期:购买后"+e._s(e.chapterInfo.time_limit)+"天有效")])]):e._e(),0===e.courseStatus&&1===e.chapterInfo.sale_mode?a("van-notice-bar",{style:e.iPnoneBottomBol?"bottom: 34px;":"",attrs:{mode:"closeable"}},[a("div",[e._v("课程有效期:购买后永久有效")])]):e._e(),1===e.courseStatus&&2===e.chapterInfo.sale_mode?a("van-notice-bar",{style:e.iPnoneBottomBol?"bottom: 34px;":"",attrs:{mode:"closeable"}},[a("div",[e._v("有效期:"+e._s(e.deadline)+"到期")])]):e._e(),a("van-popup",{style:{borderRadius:"16px",width:"80%"},attrs:{closeable:""},model:{value:e.videoShow,callback:function(t){e.videoShow=t},expression:"videoShow"}},[a("div",{staticClass:"video-main"},[a("h3",[e._v("购买后继续观看")]),a("div",{staticClass:"content flex"},[a("div",{staticClass:"img"},[a("img",{attrs:{src:e.chapterInfo.cover}})]),a("div",{staticClass:"right"},[a("p",{staticClass:"ell"},[e._v(e._s(e.chapterInfo.name))]),a("p",{staticClass:"price"},[e._v(e._s(e.chapterInfo.price))])])]),e.pluginSetting&&e.pluginSetting.yz_course_supply&&1==e.pluginSetting.yz_course_supply.is_ios_sell?a("div",{staticClass:"video-back gray"},[e._v("立即购买")]):a("div",{staticClass:"video-back",on:{click:e.videoPlay}},[e._v("立即购买")])])])],1)},o=[],n=a("2909"),r=a("5530"),c=(a("99af"),a("14d9"),a("a9e3"),a("b0c0"),a("ac0d")),s={name:"",components:{},mixins:[c["a"]],data:function(){return{activeNames:[""],id:"",chapterId:"",sectionId:"",courseId:"",goodsId:"",optionId:"",videoUrl:"",deadline:"",chapterData:[],chapterInfo:{},chapterCount:0,sectionCount:0,subchapterIndex:0,chapterIndex:0,page:1,videoSecond:0,videoShow:!1,isLoadMore:!0,total_page:0,total:1,courseStatus:"",timer:0,canTry:0,pluginSetting:{},iPnoneBottomBol:!1}},computed:{videoSecondTime:function(){return function(e){var t=parseInt(e/60),a=e%60;if(0!=a||0!=t)return"".concat(t,"分").concat(a,"秒")}}},methods:{backClick:function(){if(window.history.length<=1)return this.$router.push(this.fun.getUrl("home")),!1;this.$router.go(-1)},sectionOn:function(e,t,a){var i=Object(r["a"])({},e),o=i.section_id,n=i.can_try;this.canTry=n,0===this.courseStatus?this.videoSecond=e.try_time:this.videoSecond=e.video_second,e.can_try&&0===this.courseStatus||1===this.courseStatus?(this.chapterId=this.chapterData[a].chapter_id,this.sectionId=o,this.subchapterIndex=t,this.chapterIndex=a,this.videoUrlData()):this.videoShow=!0},timeupdate:function(e){var t;parseInt(null===(t=e.target)||void 0===t?void 0:t.currentTime)>0&&0===this.courseStatus&&(this.videoShow=!0,this.$refs.myVideo.pause())},videoTimeData:function(e){this.canTry||0!==this.courseStatus||(this.videoShow=!0,this.$refs.myVideo.pause())},videoPlay:function(){var e=this;setTimeout((function(){e.$router.push(e.fun.getUrl("goodsorder",{},{goodsId:e.chapterInfo.goods_id,optionsId:e.optionId,total:e.total,tag:"course"}))}),500)},chapterList:function(){var e=this;$http.post("plugin.course-supply.api.course.chapter-list",{id:this.id,page:this.page},"加载中..").then((function(t){if(1==t.result){var a,i,o,n,r,c,s,d=t.data;if(e.isLoadMore=!0,e.total_page=d.last_page,e.total_page||(e.page=0),e.sectionCount=d.section_count,e.chapterCount=d.chapter_count,e.chapterData=d.data,e.activeNames[0]=null===(a=e.chapterData[0])||void 0===a?void 0:a.id,e.canTry=Number(null===(i=e.chapterData[0])||void 0===i||null===(i=i.section[0])||void 0===i?void 0:i.can_try),e.courseStatus=d.course_status,0===e.courseStatus)e.videoSecond=Number(null===(o=e.chapterData[0])||void 0===o||null===(o=o.section[0])||void 0===o?void 0:o.try_time);else e.videoSecond=Number(null===(n=e.chapterData[0])||void 0===n||null===(n=n.section[0])||void 0===n?void 0:n.video_second);if(!e.courseId)e.courseId=null===(r=e.chapterData[0])||void 0===r?void 0:r.course_id;if(!e.chapterId)e.chapterId=null===(c=e.chapterData[0])||void 0===c?void 0:c.chapter_id;if(!e.sectionId)e.sectionId=null===(s=e.chapterData[0])||void 0===s||null===(s=s.section[0])||void 0===s?void 0:s.section_id;e.deadline=e.timestampToTime(d.deadline),e.videoUrlData()}else e.page=e.page-1,e.isLoadMore=!1,e.$dialog.alert({message:t.msg})}))},getMoreData:function(){var e=this;this.isLoadMore=!1,this.page>=this.total_page||(this.page=this.page+1,$http.post("plugin.course-supply.api.course.chapter-list",{id:this.id,page:this.page},"加载中").then((function(t){if(e.isLoadMore=!0,1===t.result){var a,i=null===(a=t.data)||void 0===a?void 0:a.data;e.chapterData=[].concat(Object(n["a"])(e.chapterData),Object(n["a"])(i))}else e.page=e.page-1,e.isLoadMore=!1}),(function(e){})))},timestampToTime:function(e){var t=new Date(1e3*e),a=t.getFullYear()+"-",i=(t.getMonth()+1<10?"0"+(t.getMonth()+1):t.getMonth()+1)+"-",o=this.change(t.getDate())+" ",n=this.change(t.getHours())+":",r=this.change(t.getMinutes())+":",c=this.change(t.getSeconds());return a+i+o+n+r+c},change:function(e){return e<10?"0"+e:e},courseInfo:function(){var e=this;$http.post("plugin.course-supply.api.course.info",{id:this.id,basic_info:1},"加载中..").then((function(t){if(1==t.result){var a,i=t.data;e.chapterInfo=i,e.pluginSetting=null===(a=t.basic_info)||void 0===a?void 0:a.plugin_setting,e.$nextTick((function(){var t,a;e.fun.wxShare("",{mid:e.fun.getKeyByMid()},{link:window.location.href,title:e.chapterInfo.name,imgUrl:null===(t=e.chapterInfo)||void 0===t?void 0:t.cover,description:null===(a=e.chapterInfo)||void 0===a?void 0:a.content})}),50)}else e.$dialog.alert({message:t.msg})}))},videoUrlData:function(){var e=this,t={course_id:this.courseId,chapter_id:this.chapterId,section_id:this.sectionId};$http.post("plugin.course-supply.api.course.get-video-url",t,"加载中..").then((function(t){if(1==t.result){var a=t.data,i=a.data;e.videoUrl=null===i||void 0===i?void 0:i.url,e.optionId=null===a||void 0===a?void 0:a.option_id}else e.$dialog.alert({message:t.msg})}))}},created:function(){this.id=this.$route.params.chapterId,this.chapterId=this.$route.params.videoId,this.courseId=this.$route.params.courseId,this.sectionId=this.$route.params.sectionId,this.courseInfo(),this.chapterList()},mounted:function(){},beforeCreate:function(){},beforeMount:function(){},beforeUpdate:function(){},updated:function(){},beforeDestroy:function(){},destroyed:function(){},activated:function(){}},d=s,l=d,p=(a("c93d"),a("efe4"),a("2877")),h=Object(p["a"])(l,i,o,!1,null,"3eff228e",null);t["default"]=h.exports},"6e600":function(e,t,a){var i=a("24fb");t=i(!1),t.push([e.i,"#appMain.pcStyle .van-popup[data-v-3eff228e]{left:50%}.chapter-content[data-v-3eff228e] .van-cell{padding:1rem .625rem;background:#f6fafd}.chapter-content[data-v-3eff228e] .van-collapse{background:#f6fafd;border-radius:.625rem}.chapter-content[data-v-3eff228e] .van-collapse-item__content{background:#f6fafd;padding:0 1rem}.chapter-video[data-v-3eff228e] video{width:100%;height:12.625rem}#appMain.pcStyle .van-notice-bar[data-v-3eff228e]{width:23.4375rem}.van-notice-bar[data-v-3eff228e]{width:100%;position:fixed;bottom:0;z-index:10;color:#ff7a0e;font-size:.75rem;height:1.5rem;background-color:rgba(255,123,15,.2)}.chapter-list .chapter-content .chapter-item:last-child .content[data-v-3eff228e]{border-bottom:none}.ell[data-v-3eff228e]{text-overflow:ellipsis;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}",""]),e.exports=t},"6f91":function(e,t,a){var i=a("24fb");t=i(!1),t.push([e.i,".chapter-video[data-v-3eff228e]{background-color:#fff}.chapter-video .explain[data-v-3eff228e]{padding:1.125rem}.chapter-video .explain h3[data-v-3eff228e]{font-size:1rem;font-weight:700;color:#151515;line-height:1.4375rem;text-align:left}.chapter-video .explain .details[data-v-3eff228e]{padding:1.375rem 0 0 0}.chapter-video .explain .details .browse[data-v-3eff228e]{font-size:.875rem;font-weight:500;color:#8a8c92}.chapter-video .explain .details .details-right[data-v-3eff228e]{color:#2a74c1;font-size:.875rem}.chapter-list[data-v-3eff228e]{background:#fff;border-radius:.625rem;margin:.8125rem 0 0 0}.chapter-list .title[data-v-3eff228e]{border-bottom:.0625rem solid #f5f6fa;padding:1.25rem 1.75rem 1rem 1.875rem}.chapter-list .chapter-content[data-v-3eff228e]{padding:1rem 1.125rem 2.5rem 1.125rem}.chapter-list .chapter-content .play[data-v-3eff228e]{background:#fd453f;border-radius:.1875rem;padding:0 .3125rem 0 .3125rem;display:inline}.chapter-list .chapter-content .play .icon-course_play[data-v-3eff228e]{color:#fff}.chapter-list .chapter-content h3[data-v-3eff228e]{font-size:.9375rem;color:#202020;padding:0 0 0 .6875rem}.chapter-list .chapter-content .on[data-v-3eff228e]{color:#fd453f!important}.chapter-list .chapter-content .content[data-v-3eff228e]{-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;padding:.625rem 0;border-bottom:.0625rem solid #e7eef6}.chapter-list .chapter-content .content h3[data-v-3eff228e]{width:100%;padding:0;text-align:left;font-size:.8125rem;font-weight:500;color:#202020}.chapter-list .chapter-content .content .examine[data-v-3eff228e]{width:100%;padding:.875rem 0 .3125rem 0}.chapter-list .chapter-content .content .examine .time[data-v-3eff228e]{color:#2a74c1;font-size:.6875rem}.chapter-list .chapter-content .content .examine .time .icon-course_time[data-v-3eff228e]{padding-right:.5rem}.chapter-list .chapter-content .content .examine .try-and[data-v-3eff228e]{font-size:.6875rem;line-height:.6875rem;font-weight:500;border-radius:.3125rem;color:#ff3101;padding:.1875rem .3125rem;background-color:rgba(255,49,1,.2)}.video-main[data-v-3eff228e]{padding:18px 20px 30px 20px}.video-main h3[data-v-3eff228e]{line-height:1.125rem;font-size:1.125rem;font-weight:700;color:#000;padding-bottom:2.375rem}.video-main .content[data-v-3eff228e]{padding-bottom:1.6875rem}.video-main .content .img img[data-v-3eff228e]{width:120px;height:auto;display:block}.video-main .content .right[data-v-3eff228e]{padding:0 0 0 10px}.video-main .content .right p[data-v-3eff228e]{text-align:left;font-size:16px}.video-main .content .right .price[data-v-3eff228e]{padding:10px 0 0 0;font-size:1.125rem;font-weight:800;color:#fd453f;text-align:left}.video-main .video-back[data-v-3eff228e]{font-size:1.125rem;font-weight:500;color:#fff;line-height:1.125rem;padding:.625rem 3.75rem .625rem 3.5rem;background:-webkit-linear-gradient(11deg,#ed7e40 14%,#ea553a);background:linear-gradient(79deg,#ed7e40 14%,#ea553a);border-radius:1.25rem;white-space:nowrap}.video-main .gray[data-v-3eff228e]{background:#ccc!important}.upload[data-v-3eff228e]{color:#cecece;font-size:.75rem;line-height:1.4375rem;padding:1.625rem 0 0 0}",""]),e.exports=t},"734e":function(e,t,a){var i=a("6f91");i.__esModule&&(i=i.default),"string"===typeof i&&(i=[[e.i,i,""]]),i.locals&&(e.exports=i.locals);var o=a("499e").default;o("7fc4150e",i,!0,{sourceMap:!1,shadowMode:!1})},ac0d:function(e,t,a){"use strict";a.d(t,"a",(function(){return n}));var i=document.documentElement,o=document.body,n={data:function(){return{}},activated:function(){window.addEventListener("scroll",this.handleScroll)},deactivated:function(){window.removeEventListener("scroll",this.handleScroll)},methods:{getScrollTop:function(){var e=0;return i&&i.scrollTop?e=i.scrollTop:o&&(e=o.scrollTop),e},getClientHeight:function(){var e=0;return e=o.clientHeight&&i.clientHeight?Math.min(o.clientHeight,i.clientHeight):Math.max(o.clientHeight,i.clientHeight),e},getScrollHeight:function(){return Math.max(o.scrollHeight,i.scrollHeight)},handleScroll:function(){this.otherScroll();var e=document.documentElement.scrollTop||document.body.scrollTop;this.btnFlag=e>60,this.getScrollTop()+this.getClientHeight()+105>this.getScrollHeight()?(this.isLoadMore&&this.getMoreData(),this.isBottom=!0):this.isBottom=!1},otherScroll:function(){}}}},c93d:function(e,t,a){"use strict";a("3d1a")},efe4:function(e,t,a){"use strict";a("734e")}}]); |