theory.934eb99d.js 3.3 KB

1
  1. var h=Object.defineProperty;var l=Object.getOwnPropertySymbols;var c=Object.prototype.hasOwnProperty,m=Object.prototype.propertyIsEnumerable;var r=(e,t,s)=>t in e?h(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,n=(e,t)=>{for(var s in t||(t={}))c.call(t,s)&&r(e,s,t[s]);if(l)for(var s of l(t))m.call(t,s)&&r(e,s,t[s]);return e};import{r as d,s as p,p as u,C as g}from"./index.937d41ec.js";import{d as f,a as i,S as _,M as v,as as y,at as S,C as x,I as C,x as N}from"./vendor.75613d65.js";/* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import{C as T}from"./index.4a6e2395.js";import{u as j}from"./hooks.e9c2073b.js";/* empty css */const w="_groupTitle_4zxi8_1",L="_groupImg_4zxi8_9",I="_cell_4zxi8_16",b="_title_4zxi8_24",z="_time_4zxi8_28",k="_imgCover_4zxi8_33",V="_musicTitle_4zxi8_37",U="_theory_4zxi8_40";var a={groupTitle:w,groupImg:L,cell:I,title:b,time:z,imgCover:k,musicTitle:V,theory:U};function $(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!N(e)}var B=f({name:"special",data(){return this.$route.query,{activeNames:[],list:[],dataShow:!0,loading:!1,finished:!1,params:{search:"",page:1,rows:20},theory:null}},mounted(){let e=sessionStorage.getItem("theoryCache");if(e){const t=JSON.parse(e);this.theory=t;let s=t.activeNames.split(",").map(o=>o*1);this.activeNames=s,this.params.search=t.search||""}this.getList(),j("\u70ED\u95E8\u8D44\u8BAF")},methods:{async getList(){try{let e=this.params;const t=await d.post("/api-cms/music/theory/app/page",{data:n({},e)});this.loading=!1;const s=t.data||{};if(this.list.length>0&&s.pageNo===1)return;this.list=this.list.concat(s.rows||[]),this.finished=s.pageNo>=s.totalPage,this.params.page=s.pageNo+1,this.dataShow=this.list.length>0;const o=this.list;this.activeNames.length<=0&&this.list.length>0&&this.activeNames.push(o[0].id)}catch{this.dataShow=!1,this.finished=!0}},onSearch(e){this.params.search=e,this.params.page=1,this.list=[],this.dataShow=!0,this.loading=!1,this.finished=!1,this.getList()},onDetail(e){if(e.linkUrl)window.location.href=e.linkUrl;else{let t=p.platformType==="STUDENT"?"student":"teacher";u({api:"openWebView",content:{url:`${location.origin}/${t}/#/theoryDetail?id=${e.id}`,orientation:1,isHideTitle:!1}})}}},render(){let e;return i("div",{class:[a.theory,"theory"]},[i(_,{offsetTop:0,position:"top",class:"mb12"},{default:()=>[i(T,{onSearch:this.onSearch,modelValue:this.params.search},null)]}),this.dataShow?i(v,{class:a.videoList,loading:this.loading,"onUpdate:loading":t=>this.loading=t,finished:this.finished,finishedText:"\u6CA1\u6709\u66F4\u591A\u4E86",immediateCheck:!1,onLoad:this.getList},$(e=this.list.map(t=>i(y,{modelValue:this.activeNames,"onUpdate:modelValue":s=>this.activeNames=s,border:!1},{default:()=>[i(S,{title:t.name,name:t.id,center:!0},{default:()=>[t.newsInformationList.map(s=>i(x,{title:s.title,class:a.cell,border:!1,onClick:()=>{this.onDetail(s)},titleClass:["van-ellipsis",a.title]},null))],title:()=>i("div",{class:[a.groupTitle]},[t.url&&i(C,{src:t.url,fit:"cover",class:a.groupImg},null),i("p",{class:["van-ellipsis",a.musicTitle]},[t.name])])})]})))?e:{default:()=>[e]}):i(g,{btnStatus:!1,classImgSize:"SMALL",tips:"\u6682\u65E0\u5185\u5BB9"},null)])}});export{B as default};