video-class-detail-legacy.b93ffaa8.js 12 KB

1
  1. !function(){function e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function t(t){for(var a=1;a<arguments.length;a++){var i=null!=arguments[a]?arguments[a]:{};a%2?e(Object(i),!0).forEach((function(e){n(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):e(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function n(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t,n,a,i,r,s){try{var o=e[r](s),l=o.value}catch(c){return void n(c)}o.done?t(l):Promise.resolve(l).then(a,i)}function i(e){return function(){var t=this,n=arguments;return new Promise((function(i,r){var s=e.apply(t,n);function o(e){a(s,i,r,o,l,"next",e)}function l(e){a(s,i,r,o,l,"throw",e)}o(void 0)}))}}var r=document.createElement("style");r.innerHTML="._video-class-detail_hpnky_1{min-height:100vh}._video-class-detail_hpnky_1 ._videoDesc_hpnky_4{background-color:#fff;padding:0 .37333rem .42667rem;margin-bottom:.16rem;font-size:.37333rem;line-height:.53333rem;color:#7a7a7a}._video-class-detail_hpnky_1 ._titleInfo_hpnky_12{padding-left:.21333rem;font-size:.4rem;font-weight:500;color:#1a1a1a;flex:1 auto;max-width:6.66667rem}._video-class-detail_hpnky_1 ._label_hpnky_20{font-size:.37333rem}._video-class-detail_hpnky_1 ._label_hpnky_20 span,._video-class-detail_hpnky_1 .van-tab--active{color:var(--van-primary)}._video-class-detail_hpnky_1 .van-field__value{background:#f7f7f7;border-radius:.8rem;padding-left:.4rem}._video-class-detail_hpnky_1 .van-tab__panel{overflow:hidden}._video-class-detail_hpnky_1 ._message-list_hpnky_37._message-active_hpnky_37 ._title_hpnky_12,._video-class-detail_hpnky_1 ._message-list_hpnky_37._message-active_hpnky_37 ._label_hpnky_20{color:var(--van-primary)!important}._video-class-detail_hpnky_1 ._message-list_hpnky_37 ._message-name_hpnky_41{flex-basis:65%;line-height:1.2}._video-class-detail_hpnky_1 ._message-list_hpnky_37 ._message-time_hpnky_45{font-size:.32rem;color:#999;flex-basis:35%}._video-class-detail_hpnky_1 ._message-list_hpnky_37 ._userLogo_hpnky_50{width:.90667rem;height:.90667rem;border-radius:50%;margin-right:.21333rem;overflow:hidden}._video-class-detail_hpnky_1 ._message-list_hpnky_37 ._title_hpnky_12{display:flex;justify-content:space-between;font-size:.37333rem;color:#999;font-weight:500}._video-class-detail_hpnky_1 ._message-list_hpnky_37 ._label_hpnky_20{font-size:.37333rem;color:#333;line-height:.53333rem}._messageContainer_hpnky_69{position:fixed;bottom:0;left:0;right:0}\n",document.head.appendChild(r),System.register(["./index-legacy.b903c881.js","./index-legacy.4f272dd3.js","./index-legacy.147431b7.js","./index-legacy.885c229f.js","./index-legacy.033ce0ab.js","./index-legacy.b7f666cc.js","./index-legacy.8abefd50.js","./index-legacy.ae2ce69e.js","./index-legacy.ba78f33e.js","./index-legacy.5b93d63d.js","./index-legacy.e9e6da38.js","./index-legacy.f52c26b4.js","./icon_teacher-legacy.42ba77b1.js","./orderStatus-legacy.d4b782c6.js","./index-legacy.857a8bc7.js","./bars-legacy.9085ff9b.js","./icon_album_active-legacy.fcd6f4c0.js","./icon_music_active-legacy.77693573.js","./index-legacy.5907f1a9.js","./plyr-legacy.180f4c53.js","./use-id-legacy.29724920.js","./use-tab-status-legacy.a19d344b.js","./use-refs-legacy.14daae14.js"],(function(e){"use strict";var n,a,r,s,o,l,c,u,d,f,p,m,h,_,v,g,y,b,k,x,j,I,w,O,C;return{setters:[function(e){n=e.d,a=e.g,r=e.w,s=e.T,o=e.j,l=e.D,c=e.M,u=e.z,d=e.u,f=e.C,p=e.B,m=e.Z},function(e){h=e.C},function(e){_=e.S},function(e){v=e.C},function(e){g=e.C},function(e){y=e.C},function(){},function(){},function(e){b=e.T,k=e.a},function(e){x=e.I},function(e){j=e.F},function(e){I=e.L},function(e){w=e.i},function(e){O=e.o,C=e.a},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){}],execute:function(){var L={"video-class-detail":"_video-class-detail_hpnky_1",videoDesc:"_videoDesc_hpnky_4",titleInfo:"_titleInfo_hpnky_12",label:"_label_hpnky_20","message-list":"_message-list_hpnky_37","message-active":"_message-active_hpnky_37",title:"_title_hpnky_12","message-name":"_message-name_hpnky_41","message-time":"_message-time_hpnky_45",userLogo:"_userLogo_hpnky_50",messageContainer:"_messageContainer_hpnky_69"};function T(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!m(e)}e("default",n({name:"VideoClassDetail",data:function(){var e=this.$route.query;return{groupId:e.groupId,classId:e.classId,tabIndex:1,title:"",lessonPrice:0,useRelationType:"",alreadyBuy:!1,videoDetail:{},detailList:[],posterUrl:"",srcUrl:"",message:"",navHeight:0,currentClassIndex:1,reload:!1,videoContent:"",list:[],dataShow:!0,loading:!1,finished:!1,params:{page:1,rows:20},freeRate:0,trySee:!1,videoHeight:"212px"}},computed:{users:function(){return a.user.data},offsetTop:function(){var e=this.navHeight;return Number(e)+44+"px"}},mounted:function(){var e=this;return i(regeneratorRuntime.mark((function t(){var n,a,i;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=document.body.clientWidth||document.body.offsetWidth,e.videoHeight=n/16*9+"px",e.navHeight=sessionStorage.getItem("navHeight")||0,t.prev=3,t.next=6,e.__init();case 6:return t.next=8,r.get("/api-student/sysConfig/queryByParamNameList",{params:{paramNames:"video_lesson_free_rate"}});case 8:i=t.sent,e.freeRate=(null===(a=i.data[0])||void 0===a?void 0:a.paramValue)||0,t.next=14;break;case 12:t.prev=12,t.t0=t.catch(3);case 14:e.getList();case 15:case"end":return t.stop()}}),t,null,[[3,12]])})))()},methods:{__init:function(){var e=this;return i(regeneratorRuntime.mark((function t(){var n,a;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,e.reload=!0,t.next=4,r.get("/api-student/videoLesson/selectVideoLesson",{params:{groupId:e.groupId}});case 4:n=t.sent,a=n.data||{},e.videoDetail=a.lessonGroup,e.title=a.lessonGroup.lessonName,e.lessonPrice=a.lessonGroup.lessonPrice,e.useRelationType=a.lessonGroup.relationType,e.alreadyBuy=a.alreadyBuy,e.detailList=a.detailList||[],e.trySee=!a.alreadyBuy,e.detailList.forEach((function(t,n){t.id===Number(e.classId)&&(e.posterUrl=t.coverUrl,e.srcUrl=t.videoUrl,e.title=t.videoTitle,e.currentClassIndex=n+1,e.videoContent=t.videoContent)})),e.reload=!1,t.next=19;break;case 17:t.prev=17,t.t0=t.catch(0);case 19:case"end":return t.stop()}}),t,null,[[0,17]])})))()},onSearch:function(){this.params.page=1,this.list=[],this.dataShow=!0,this.loading=!1,this.finished=!1,this.getList()},getList:function(){var e=this;return i(regeneratorRuntime.mark((function n(){var a,i,s;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,a=e.params,n.next=4,r.post("/api-student/videoLesson/page",{data:t(t({},a),{},{videoId:e.classId})});case 4:if(i=n.sent,e.loading=!1,s=i.data||{},!(e.list.length>0&&1===s.pageNo)){n.next=9;break}return n.abrupt("return");case 9:e.list=e.list.concat(s.rows||[]),e.finished=s.pageNo>=s.totalPage,e.params.page=s.pageNo+1,e.dataShow=e.list.length>0,n.next=19;break;case 15:n.prev=15,n.t0=n.catch(0),e.dataShow=!1,e.finished=!0;case 19:case"end":return n.stop()}}),n,null,[[0,15]])})))()},onPlay:function(e){var t=this;e.id!==Number(this.classId)&&(this.reload=!0,this.posterUrl=e.imgUrl,this.srcUrl=e.videoUrl,this.title=e.title,this.currentClassIndex=e.index,this.videoContent=e.content,this.classId=e.id,this.onSearch(),setTimeout((function(){t.reload=!1}),0))},onSubmit:function(){var e=this;return i(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,r.post("/api-student/videoLesson/evaluate",{data:{isTeacher:0,videoId:e.classId,content:e.message,studentId:a.user.data.userId}});case 3:s("评论成功"),e.message="",setTimeout((function(){e.onSearch()}),500),t.next=10;break;case 8:t.prev=8,t.t0=t.catch(0);case 10:case"end":return t.stop()}}),t,null,[[0,8]])})))()}},render:function(){var e,t,n=this;return o("div",{class:L["video-class-detail"]},[o(v,null,{default:function(){return!n.reload&&o(g,{freeRate:Number(n.freeRate),freeTitleStatus:n.lessonPrice>0,trySee:n.trySee,src:n.srcUrl,poster:n.posterUrl,height:n.videoHeight,isBuy:!0,onBuyEmit:(e=i(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(n.lessonPrice>0)){e.next=3;break}return n.$router.back(),e.abrupt("return");case 3:return e.prev=3,t=n.videoDetail,O.orderObject.orderType="VIDEO",O.orderObject.orderName="视频课购买",O.orderObject.orderDesc="视频课购买",O.orderObject.actualPrice=t.lessonPrice,O.orderObject.recomUserId="",O.orderObject.orderNo="",O.orderObject.orderList=[{orderType:"VIDEO",goodsName:"视频课购买",courseGroupId:t.id,courseGroupName:t.lessonName,coursePrice:t.lessonPrice,teacherName:t.username||"游客".concat(t.teacherId||""),teacherId:t.teacherId,avatar:t.headUrl,relationType:t.relationType,courseInfo:n.detailList,recomUserId:""}],e.next=14,C((function(){l.alert({message:"领取成功",confirmButtonText:"确定",confirmButtonColor:"#2dc7aa"}).then((function(){n.__init()}))}));case 14:e.next=18;break;case 16:e.prev=16,e.t0=e.catch(3);case 18:case"end":return e.stop()}}),e,null,[[3,16]])}))),function(){return e.apply(this,arguments)})},null);var e}}),o(y,{border:!1,class:L.cell,title:this.title,titleClass:[L.titleInfo,"van-ellipsis"]},{icon:function(){return o(c,{name:"video",size:18,color:"var(--van-primary)",style:{display:"flex",alignItems:"center"}},null)},value:function(){return o("div",{class:L.label},[o("span",null,[n.currentClassIndex]),u("/"),n.detailList.length,u("课时")])}}),o("div",{class:L.videoDesc},[this.videoContent]),o(b,{active:this.tabIndex,"onUpdate:active":function(e){return n.tabIndex=e},class:L.infoField,color:"var(--van-primary)",sticky:!0,offsetTop:this.offsetTop,lineWidth:20},{default:function(){return[o(k,{title:"目录",name:1},{default:function(){return[o("div",{style:{overflowY:"auto"}},[o(_,{title:"课程列表",icon:"courseList",border:!0},T(e=n.detailList.map((function(e,t){var a=(e.musicAlbumInfos||[]).map((function(e){return{relationMusicAlbum:e.relationType,musicAlbumName:e.name,musicAlbumId:e.musicAlbumId,status:e.status,useRelationType:n.useRelationType}}));return o(h,{musicAlbumInfos:a,playId:Number(n.classId),detail:{id:e.id,title:e.videoTitle,content:e.videoContent,imgUrl:e.coverUrl,videoUrl:e.videoUrl,index:t+1},onPlay:n.onPlay,onMusicAlbumDetail:function(e){n.alreadyBuy||e.status?"MUSIC"===e.relationMusicAlbum?n.$router.push({path:"/music-detail",query:{id:e.musicAlbumId}}):"ALBUM"===e.relationMusicAlbum&&n.$router.push({path:"/music-album-detail/"+e.musicAlbumId}):s("数据正在更新,请稍后再试")}},null)})))?e:{default:function(){return[e]}})])]}}),o(k,{title:"讨论",name:3},{default:function(){return[o("div",{style:{overflowY:"auto",marginBottom:"calc(var(--van-cell-vertical-padding) * 2 + var( --van-cell-line-height))"}},[n.dataShow?o(I,{loading:n.loading,"onUpdate:loading":function(e){return n.loading=e},finished:n.finished,finishedText:" ",immediateCheck:!1,onLoad:n.getList},T(t=n.list.map((function(e){return o(y,{class:[L["message-list"],1===e.isTeacher&&L["message-active"]],valueClass:L["message-time"]},{icon:function(){return o(x,{class:L.userLogo,src:e.avatar||w,fit:"cover"},null)},title:function(){return o("div",{class:L.title},[o("div",{class:L["message-name"]},[e.userName]),o("div",{class:L["message-time"]},[d(e.evaluateTime).format("YYYY年MM月DD日")])])},label:function(){return o("div",{class:L.label},[e.content])}})})))?t:{default:function(){return[t]}}):o(f,{btnStatus:!1,tips:"暂无讨论"},null)]),o("div",{class:L.messageContainer},[o(j,{placeholder:"快来讨论吧~",modelValue:n.message,"onUpdate:modelValue":function(e){return n.message=e}},{button:function(){return o(p,{type:"primary",disabled:!n.message,style:{padding:"0 20px"},size:"small",round:!0,onClick:n.onSubmit},{default:function(){return[u("发布")]}})}})])]}})]}})])}}))}}}))}();