unit-detail-legacy-b4ec3c8c.js 4.3 KB

1
  1. !function(){function e(e,n,t,l,i,o,r){try{var a=e[o](r),d=a.value}catch(s){return void t(s)}a.done?n(d):Promise.resolve(d).then(l,i)}function n(n){return function(){var t=this,l=arguments;return new Promise((function(i,o){var r=n.apply(t,l);function a(n){e(r,i,o,a,d,"next",n)}function d(n){e(r,i,o,a,d,"throw",n)}a(void 0)}))}}System.register(["./index-legacy-a314c7dd.js","./index-legacy-2788affc.js","./index.module-legacy-e716731e.js","./index-legacy-fb49b6ec.js"],(function(e,t){"use strict";var l,i,o,r,a,d,s,u,c,v,f,w,g,p,I;return{setters:[e=>{l=e.d,i=e.P,o=e.x,r=e.e,a=e.y,d=e.a,s=e.W,u=e.a2,c=e.C,v=e.D,f=e.R},e=>{w=e.M},e=>{g=e.s},e=>{p=e.a,I=e.u}],execute:function(){e("default",l({name:"unit-detail",setup(){const e=i(),{x:t,y:l}=p(),D=o({detailId:e.query.detailId,loading:!1,background:"transparent",color:"transparent",dataInfo:{},title:" ",listKnowledge:[],prevDetailId:"",nextDetailId:""}),y=function(){var e=n((function*(){D.loading=!0;try{const{data:e}=yield v.get("/edu-app/lessonCoursewareKnowledgeDetail/detail/"+D.detailId);D.dataInfo=e,D.title=e.name}catch(e){}D.loading=!1}));return function(){return e.apply(this,arguments)}}(),C=function(){var t=n((function*(){try{const n={lessonCoursewareId:e.query.lessonCoursewareId};f().ios&&(n.platform="iOS-STUDENT",n.verson=e.query.verson||"1.0.8");const{data:t}=yield v.post("/edu-app/lessonCoursewareDetail/listKnowledge",{data:n});D.listKnowledge=t||[]}catch(n){}}));return function(){return t.apply(this,arguments)}}(),x=r((()=>{var e;const n=D.listKnowledge||[];let t=n.findIndex((e=>{var n;return e.id===(null===(n=D.dataInfo)||void 0===n?void 0:n.lessonCoursewareDetailId)}));const l=n.find((e=>{var n;return e.id===(null===(n=D.dataInfo)||void 0===n?void 0:n.lessonCoursewareDetailId)}));if(!l)return!0;let i=null==l||null===(e=l.lessonCoursewareDetailKnowledgeDetailList)||void 0===e?void 0:e.findIndex((e=>e.id==D.detailId)),o=!1,r="";for(;i>=0;){if(i--,i>=0){var a;const e=null==l||null===(a=l.lessonCoursewareDetailKnowledgeDetailList)||void 0===a?void 0:a[i];e.id&&(o=!0,r=e.id)}if(o)break}if(o)return D.prevDetailId=r,!1;let d=!1;for(;t>=0;){var s;t--;const e=(null===(s=n[t])||void 0===s?void 0:s.lessonCoursewareDetailKnowledgeDetailList)||[];let l=e.length;for(;l>0&&(e[l-1]&&(d=!0,r=e[l-1].id),l--,!d););if(d)break}return d&&(D.prevDetailId=r),!d})),b=r((()=>{var e;const n=D.listKnowledge||[];let t=n.findIndex((e=>{var n;return e.id===(null===(n=D.dataInfo)||void 0===n?void 0:n.lessonCoursewareDetailId)}));const l=n.find((e=>{var n;return e.id===(null===(n=D.dataInfo)||void 0===n?void 0:n.lessonCoursewareDetailId)}));if(!l)return!0;let i=null==l||null===(e=l.lessonCoursewareDetailKnowledgeDetailList)||void 0===e?void 0:e.findIndex((e=>e.id==D.detailId)),o=!1,r="";for(;i<(null==l?void 0:l.lessonCoursewareDetailKnowledgeDetailList.length)-1;){if(i++,i>=0){var a;const e=null==l||null===(a=l.lessonCoursewareDetailKnowledgeDetailList)||void 0===a?void 0:a[i];e.id&&(o=!0,r=e.id)}if(o)break}if(o)return D.nextDetailId=r,!1;let d=!1;for(;t<=n.length-1;){var s;t++;const e=(null===(s=n[t])||void 0===s?void 0:s.lessonCoursewareDetailKnowledgeDetailList)||[];let l=0;for(;l<=e.length-1&&(e[l]&&(d=!0,r=e[l].id),l++,!d););if(d)break}return d&&(D.nextDetailId=r),!d})),h=function(){var e=n((function*(e){l.value=0,window.scrollTo(0,0),"up"===e?(D.detailId=D.prevDetailId,yield y()):"down"===e&&(D.detailId=D.nextDetailId,yield y())}));return function(n){return e.apply(this,arguments)}}();return a(n((function*(){I(document,"scroll",(()=>{l.value>52?(D.background="#fff",D.color="#323333"):(D.background="transparent",D.color="transparent")})),yield y(),yield C()}))),()=>{var e,n;return d("div",{class:g.knowledgeLibrary},[d(w,{position:"top"},{default:()=>[d(s,{border:!1,background:D.background,color:D.color,title:D.title},null)]}),d("div",{class:[g.containerSection,g.woringSection]},[(null===(e=D.dataInfo)||void 0===e?void 0:e.desc)&&d("div",{class:g.woringContent,innerHTML:D.dataInfo.desc},null),!(null!==(n=D.dataInfo)&&void 0!==n&&n.desc)&&!D.loading&&d("div",{class:g.woringContent},[d(u,{description:"暂无内容",style:{paddingTop:"40px"}},null)])]),d(w,{position:"bottom"},{default:()=>[d("div",{class:[g.stickBtnGroup]},[d(c,{round:!0,class:g.prevBtn,disabled:x.value,onClick:()=>h("up")},null),d(c,{round:!0,disabled:b.value,class:g.nextBtn,onClick:()=>h("down")},null)])]})])}}}))}}}))}();