unit-detail-legacy-7b1e180b.js 4.3 KB

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