index-legacy.4777efb1.js 17 KB

1
  1. !function(){function e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function t(t){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?e(Object(r),!0).forEach((function(e){i(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):e(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function n(e,t,n,r,i,a,o){try{var l=e[a](o),s=l.value}catch(u){return void n(u)}l.done?t(s):Promise.resolve(s).then(r,i)}function r(e){return function(){var t=this,r=arguments;return new Promise((function(i,a){var o=e.apply(t,r);function l(e){n(o,i,a,l,s,"next",e)}function s(e){n(o,i,a,l,s,"throw",e)}l(void 0)}))}}function i(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){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,i,a=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(a.push(r.value),!t||a.length!==t);o=!0);}catch(s){l=!0,i=s}finally{try{o||null==n.return||n.return()}finally{if(l)throw i}}return a}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return o(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return o(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var l=document.createElement("style");l.innerHTML="._playContent_jst3b_1{width:100vw;height:100vh;background-color:#000;overflow:hidden}._coursewarePlay_jst3b_7{position:relative;height:100vh;margin:0 auto}._playModel_jst3b_12{position:absolute;left:0;top:0;right:0;bottom:0;box-shadow:inset 0 0 4.37333rem #000;pointer-events:none}._headerContainer_jst3b_21{position:fixed;top:0;left:0;right:0;z-index:1;padding:.26667rem .64rem;display:flex;align-items:center;color:#fff;font-size:.32rem;background:linear-gradient(180deg,rgba(0,0,0,.6),transparent)}._backBtn_jst3b_34{color:#fff;width:1.06667rem;height:.69333rem;display:flex;justify-content:space-between;align-items:center;z-index:10}._menu_jst3b_43{flex:1;display:flex;justify-content:center;color:#fff}._tabsContent_jst3b_49{width:100vw;height:100vh}._tabsContent_jst3b_49 .van-tabs__wrap{display:none!important}._tabsContent_jst3b_49 .van-tabs__content{width:100%;height:100%}._loadWrap_jst3b_60{position:absolute;left:0;top:0;right:0;bottom:0;background:linear-gradient(45deg,#21232a,#111218);display:flex;justify-content:center;align-items:center}._itemDiv_jst3b_71{position:relative;width:100%;height:100%}._itemDiv_jst3b_71 video{width:100%;height:100%}._itemDiv_jst3b_71 img{display:block;width:100%;height:100%;-o-object-fit:contain;object-fit:contain}._videoModel_jst3b_86{position:absolute;top:0;left:0;width:100%;height:100%;display:flex;justify-content:center;align-items:center}._videoModel_jst3b_86>img{width:1.33333rem;height:1.33333rem}._rightFixedBtns_jst3b_100{position:fixed;top:50%;transform:translateY(-50%);right:.53333rem}._rightFixedBtns_jst3b_100 ._point_jst3b_106{margin-top:.26667rem;border-bottom-left-radius:0;border-bottom-right-radius:0}._rightFixedBtns_jst3b_100 ._point_jst3b_106+._fullBtn_jst3b_111{border-top-left-radius:0;border-top-right-radius:0}._leftFixedBtns_jst3b_115{position:fixed;top:50%;transform:translateY(-50%);left:.53333rem}._leftFixedBtns_jst3b_115 ._prePoint_jst3b_121{margin-bottom:.21333rem}._fullBtn_jst3b_111{width:1.01333rem;height:1.46667rem;background:rgba(51,51,51,.15);border-radius:.21333rem;display:flex;flex-direction:column;align-items:center;color:#fff;justify-content:space-evenly}._fullBtn_jst3b_111:active{opacity:.8}._bottomFixedContainer_jst3b_138{position:absolute;left:0;right:0;bottom:0;z-index:10;background:linear-gradient(0deg,rgba(0,0,0,.5),transparent);padding:0 .8rem}._bottomFixedContainer_jst3b_138 ._time_jst3b_147{display:flex;justify-content:space-between;color:#fff;font-size:.26667rem;padding:.10667rem 0}._bottomFixedContainer_jst3b_138 ._slider_jst3b_154{padding:.26667rem 0}._bottomFixedContainer_jst3b_138 ._actions_jst3b_157{display:flex;justify-content:space-between;color:#fff;font-size:.32rem;align-items:center}._bottomFixedContainer_jst3b_138 ._actions_jst3b_157 ._actionBtn_jst3b_164{display:flex}._bottomFixedContainer_jst3b_138 ._actions_jst3b_157 ._actionBtn_jst3b_164>img{width:.69333rem;height:.69333rem;display:block;padding:.21333rem .21333rem .37333rem}._popup_jst3b_173{background:rgba(0,0,0,.5)}._overlayClass_jst3b_176{--van-overlay-background: transparent}.top-enter-active,.top-leave-active{transition:transform .5s}.top-enter-from,.top-leave-to{transform:translateY(-100%)}.left-enter-active,.left-leave-active{transition:all .5s}.left-enter-from,.left-leave-to{left:-1.6rem}.right-enter-active,.right-leave-active{transition:all .5s}.right-enter-from,.right-leave-to{right:-1.6rem}.bottom-enter-active,.bottom-leave-active{transition:transform .5s}.bottom-enter-from,.bottom-leave-to{transform:translateY(100%)}\n",document.head.appendChild(l),System.register(["./index-legacy.c1f63540.js","./plyr-legacy.2bfabaee.js","./icon-pause-legacy.520e7a8c.js","./index-legacy.c75fe8a2.js","./useFee-legacy.5f55b3ee.js","./index-legacy.49ab1c78.js"],(function(e){"use strict";var n,o,l,s,u,c,d,m,f,v,p,b,_,g,h,y,j,x,w,C,T,B,k,I,O,D,S,A,P,F,V,L,N,R,E,z,M,q,W,Y,H,U,X,G;return{setters:[function(e){n=e.t,o=e.d,l=e.R,s=e.aq,u=e.y,c=e.U,d=e.b4,m=e.a0,f=e.c,v=e.w,p=e.z,b=e.aW,_=e.an,g=e.a4,h=e.bK,y=e.bL,j=e.bB,x=e.aU,w=e.D,C=e.r,T=e.b3,B=e.ah,k=e.ag,I=e.f,O=e.$,D=e.F,S=e.b5,A=e.b7,P=e.V,F=e.a5,V=e.q,L=e.al,N=e.e,R=e.m,E=e.g,z=e.b9},function(){},function(e){M=e.i,q=e.a,W=e.p,Y=e.b},function(e){H=e.q},function(e){U=e.h},function(e){X=e.S,G=e.a}],execute:function(){var $=a(n("slider"),2),J=$[0],K=$[1],Q={min:v(0),max:v(100),step:v(1),range:Boolean,reverse:Boolean,disabled:Boolean,readonly:Boolean,vertical:Boolean,barHeight:p,buttonSize:p,activeColor:String,inactiveColor:String,modelValue:{type:[Number,Array],default:0}},Z=o({name:J,props:Q,emits:["change","dragEnd","dragStart","update:modelValue"],setup:function(e,t){var n,r,o,v=t.emit,p=t.slots,w=l(),C=l(),T=l(),B=s(),k=u((function(){return Number(e.max)-Number(e.min)})),I=u((function(){var t=e.vertical?"width":"height";return i({background:e.inactiveColor},t,c(e.barHeight))})),O=function(t){return e.range&&Array.isArray(t)},D=u((function(){var t,n,r,a=(i(t={},e.vertical?"height":"width",(n=e.modelValue,r=e.min,O(n)?"".concat(100*(n[1]-n[0])/k.value,"%"):"".concat(100*(n-Number(r))/k.value,"%"))),i(t,"background",e.activeColor),t);T.value&&(a.transition="none");return a[e.vertical?e.reverse?"bottom":"top":e.reverse?"right":"left"]=function(){var t=e.modelValue,n=e.min;return O(t)?"".concat(100*(t[0]-Number(n))/k.value,"%"):"0%"}(),a})),S=function(t){var n=+e.min,r=+e.max,i=+e.step;t=x(t,n,r);var a=Math.round((t-n)/i)*i;return y(n,a)},A=function(t,n){t=O(t)?function(t){var n,r,i=null!=(n=t[0])?n:Number(e.min),a=null!=(r=t[1])?r:Number(e.max);return i>a?[a,i]:[i,a]}(t).map(S):S(t),b(t,e.modelValue)||v("update:modelValue",t),n&&!b(t,o)&&v("change",t)},P=function(t){if(t.stopPropagation(),!e.disabled&&!e.readonly){var n=e.min,r=e.reverse,i=e.vertical,o=e.modelValue,l=_(w),s=i?l.height:l.width,u=Number(n)+(i?r?l.bottom-t.clientY:t.clientY-l.top:r?l.right-t.clientX:t.clientX-l.left)/s*k.value;if(O(o)){var c=a(o,2),d=c[0],m=c[1];A(u<=(d+m)/2?[u,m]:[d,u],!0)}else A(u,!0)}},F=function(t){e.disabled||e.readonly||("dragging"===T.value&&(A(r,!0),v("dragEnd",t)),T.value="")},V=function(t){if("number"==typeof t){return K("button-wrapper",["left","right"][t])}return K("button-wrapper",e.reverse?"left":"right")},L=function(t,n){if("number"==typeof n){var r=p[0===n?"left-button":"right-button"];if(r)return r({value:t})}return p.button?p.button({value:t}):f("div",{class:K("button"),style:j(e.buttonSize)},null)},N=function(t){var i="number"==typeof t?e.modelValue[t]:e.modelValue;return f("div",{ref:C,role:"slider",class:V(t),tabindex:e.disabled?void 0:0,"aria-valuemin":e.min,"aria-valuenow":i,"aria-valuemax":e.max,"aria-disabled":e.disabled||void 0,"aria-readonly":e.readonly||void 0,"aria-orientation":e.vertical?"vertical":"horizontal",onTouchstartPassive:function(i){"number"==typeof t&&(n=t),function(t){e.disabled||e.readonly||(B.start(t),r=e.modelValue,o=O(r)?r.map(S):S(r),T.value="start")}(i)},onTouchend:F,onTouchcancel:F,onClick:h},[L(i,t)])};return A(e.modelValue),d((function(){return e.modelValue})),m("touchmove",(function(t){if(!e.disabled&&!e.readonly){"start"===T.value&&v("dragStart",t),g(t,!0),B.move(t),T.value="dragging";var i=_(w),a=(e.vertical?B.deltaY.value:B.deltaX.value)/(e.vertical?i.height:i.width)*k.value;if(e.reverse&&(a=-a),O(o)){var l=e.reverse?1-n:n;r[l]=o[l]+a}else r=o+a;A(r)}}),{target:C}),function(){return f("div",{ref:w,style:I.value,class:K({vertical:e.vertical,disabled:e.disabled}),onClick:P},[f("div",{class:K("bar"),style:D.value},[e.range?[N(0),N(1)]:N()])])}}}),ee=w(Z),te={playContent:"_playContent_jst3b_1",coursewarePlay:"_coursewarePlay_jst3b_7",playModel:"_playModel_jst3b_12",headerContainer:"_headerContainer_jst3b_21",backBtn:"_backBtn_jst3b_34",menu:"_menu_jst3b_43",tabsContent:"_tabsContent_jst3b_49",loadWrap:"_loadWrap_jst3b_60",itemDiv:"_itemDiv_jst3b_71",videoModel:"_videoModel_jst3b_86",rightFixedBtns:"_rightFixedBtns_jst3b_100",point:"_point_jst3b_106",fullBtn:"_fullBtn_jst3b_111",leftFixedBtns:"_leftFixedBtns_jst3b_115",prePoint:"_prePoint_jst3b_121",bottomFixedContainer:"_bottomFixedContainer_jst3b_138",time:"_time_jst3b_147",slider:"_slider_jst3b_154",actions:"_actions_jst3b_157",actionBtn:"_actionBtn_jst3b_164",popup:"_popup_jst3b_173",overlayClass:"_overlayClass_jst3b_176"};var ne="VIDEO",re="SONG";e("default",o({name:"exercise-after-class",setup:function(){var e=C({width:"100vw"}),n=function(){var t=Math.min(screen.width,screen.height)*(16/9);t>Math.max(screen.width,screen.height)?e.width="100vw":e.width=t+"px"},i=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;n(),N({api:"setRequestedOrientation",content:{orientation:e}}),N({api:"setStatusBarVisibility",content:{isVisibility:e}})};i(),T((function(){i(1)}));var a=B();k();var o=a.query,s=I(),u=l(),c=C({videoData:null,trainings:[],trainingTimes:0,itemList:[],showHead:!0,loading:!0,recordLoading:!1}),d=C({nowTime:0,model:!0,timer:null,item:null}),m=function(){var e=r(regeneratorRuntime.mark((function e(){var t,n,r,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,R.post(E.platformApi+"/studentLessonTraining/trainingRecord/".concat(o.courseScheduleId,"?userId=").concat(null===(t=E.user)||void 0===t||null===(n=t.data)||void 0===n?void 0:n.id),{hideLoading:!0});case 3:if(i=e.sent,!Array.isArray(null==i||null===(r=i.data)||void 0===r?void 0:r.trainings)){e.next=6;break}return e.abrupt("return",i.data.trainings);case 6:e.next=10;break;case 8:e.prev=8,e.t0=e.catch(0);case 10:return e.abrupt("return",[]);case 11:case"end":return e.stop()}}),e,null,[[0,8]])})));return function(){return e.apply(this,arguments)}}(),v=function(){var e=r(regeneratorRuntime.mark((function e(n){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:Array.isArray(n)&&(c.trainings=n.map((function(e){try{e.trainingContent=JSON.parse(e.trainingContent)}catch(n){e.trainingContent=""}return t(t({},e),{},{currentTime:0,duration:100,paused:!0,loop:!1,videoEle:null,timer:null,muted:!0,autoplay:!0})})),c.itemList=c.trainings.filter((function(e){return e.materialId==a.query.materialId})),c.videoData=c.itemList[0],h());case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();O(r(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,m();case 2:t=e.sent,v(t),U();case 5:case"end":return e.stop()}}),e)}))));var p=function(){N({api:"back"})},b=l(),_=C({firstIndex:0,open:!1,activeIndex:-1,tabActive:"",tabName:"",itemActive:"",itemName:""}),g=function(){var e=r(regeneratorRuntime.mark((function e(t){var n,r,i,o,l;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!c.recordLoading){e.next=2;break}return e.abrupt("return");case 2:return console.log("记录观看次数"),c.recordLoading=!0,r=a.query,i={materialType:"VIDEO",record:{sourceTime:t.duration,clientType:E.platformType,feature:"LESSON_TRAINING",deviceType:s.android?"ANDROID":s.isApp?"IOS":"WEB"},courseScheduleId:r.courseScheduleId,lessonTrainingId:r.lessonTrainingId,materialId:(null===(n=c.videoData)||void 0===n?void 0:n.materialId)||""},e.prev=6,e.next=9,R.post(E.platformApi+"/studentLessonTraining/lessonTrainingRecord",{data:i,hideLoading:!0});case 9:e.sent,e.next=14;break;case 12:e.prev=12,e.t0=e.catch(6);case 14:return c.recordLoading=!1,e.prev=15,e.next=18,m();case 18:o=e.sent,Array.isArray(o)&&(l=o.find((function(e){var t;return e.materialId==(null===(t=c.videoData)||void 0===t?void 0:t.materialId)})))&&(c.videoData.trainingTimes=l.trainingTimes,h()),e.next=24;break;case 22:e.prev=22,e.t1=e.catch(15);case 24:case"end":return e.stop()}}),e,null,[[6,12],[15,22]])})));return function(t){return e.apply(this,arguments)}}(),h=function e(){var t,n,r,a;if(0!=(null==c||null===(t=c.videoData)||void 0===t?void 0:t.trainingTimes)&&(null==c||null===(n=c.videoData)||void 0===n?void 0:n.trainingTimes)+""===(null===(r=c.videoData)||void 0===r||null===(a=r.trainingContent)||void 0===a?void 0:a.practiceTimes)){var l=c.trainings.findIndex((function(e){var t;return e.materialId==(null===(t=c.videoData)||void 0===t?void 0:t.materialId)})),s=l===c.trainings.length-1;z({title:"课后作业",message:"你已完成该练习~",confirmButtonColor:"var(--van-primary)",confirmButtonText:s?"完成":"下一题",cancelButtonText:"继续"}).then((function(){if(s)N({api:"goBack"});else{var t=c.trainings[l+1];if((null==t?void 0:t.type)===ne&&(c.itemList=[t],c.videoData=t,e()),(null==t?void 0:t.type)===re){i(1),p();var n=H.stringify({id:t.content,courseScheduleId:o.courseScheduleId,lessonTrainingId:o.lessonTrainingId,materialId:t.materialId}),r="".concat(location.origin,"/orchestra-music-score/?")+n;N({api:"openAccompanyWebView",content:{url:r,orientation:0,isHideTitle:!0,statusBarTextColor:!1,isOpenLight:!0}})}}})).catch((function(){c.trainings[l].currentTime=0}))}};return function(){var t,n;return f("div",{class:te.playContent},[f("div",{class:te.coursewarePlay,style:{width:e.width}},[f(X,{style:{height:"100%"},ref:b,showIndicators:!1,loop:!1,vertical:!0,lazyRender:!0,touchable:!1,duration:0},(n=t=c.itemList.map((function(e,t){return f(G,null,{default:function(){return[f(D,null,[f("div",{class:te.itemDiv,onClick:function(){clearTimeout(e.timer),d.model=!d.model}},[f("video",{playsinline:"false",preload:"auto",class:"player",poster:"./assets/icon-videobg.2414ec8d.png","data-vid":e.id,src:e.content,loop:e.loop,autoplay:e.autoplay,muted:e.muted,onLoadedmetadata:(t=r(regeneratorRuntime.mark((function t(n){var r;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=n.target,e.duration=r.duration,e.videoEle=r,e.loaded=!0;case 4:case"end":return t.stop()}}),t)}))),function(e){return t.apply(this,arguments)}),onTimeupdate:function(t){if(e.loaded){var n=t.target;e.currentTime=n.currentTime}},onPlay:function(){console.log("播放"),e.paused=!1,e.muted&&(e.muted=!1,e.videoEle.pause())},onPause:function(){console.log("暂停"),e.paused=!0},onEnded:function(){return g(e)}},[f("source",{src:e.content,type:"video/mp4"},null)])]),f(S,{name:"bottom"},{default:function(){return[d.model&&!e.muted&&f("div",{class:te.bottomFixedContainer},[f("div",{class:te.time},[f("span",null,[A(e.currentTime)]),f("span",null,[A(e.duration)])]),f("div",{class:te.slider},[e.duration&&f(ee,{buttonSize:16,modelValue:e.currentTime,min:0,max:e.duration},null)]),f("div",{class:te.actions},[f("div",{class:te.actionBtn},[e.paused?f("img",{src:M,onClick:function(t){var n;clearTimeout(e.timer),null===(n=e.videoEle)||void 0===n||n.play(),e.paused=!1,e.timer=setTimeout((function(){d.model=!1}),4e3)}},null):f("img",{src:q,onClick:function(t){var n;clearTimeout(e.timer),null===(n=e.videoEle)||void 0===n||n.pause(),e.paused=!0}},null)])])])]}}),e.muted&&f("div",{class:te.loadWrap},[f(P,{animationData:W},null)])])];var t}})})),"function"==typeof n||"[object Object]"===Object.prototype.toString.call(n)&&!L(n)?t:{default:function(){return[t]}})),f(S,{name:"top"},{default:function(){var e,t,n;return[d.model&&f("div",{class:te.headerContainer,ref:u},[f("div",{class:te.backBtn,onClick:function(){return p()}},[f(F,{name:Y},null),V("返回")]),f("div",{class:te.menu},[_.tabName]),f("div",{class:te.nums},[V("练习次数:"),(null===(e=c.videoData)||void 0===e?void 0:e.trainingTimes)||0,V("/"),(null===(t=c.videoData)||void 0===t||null===(n=t.trainingContent)||void 0===n?void 0:n.practiceTimes)||0])])]}})])])}}}))}}}))}();