theory.e7f03671.js 3.1 KB

1
  1. import{d as l,y as r,g as n,n as h,j as i,C as c,$ as m}from"./ResizeObserver.es.f28023e0.js";import{C as p}from"./index.3b2e70c8.js";import{L as d}from"./index.79f59946.js";import{I as u}from"./index.7a1af785.js";import{C as g,a as f}from"./index.59c5b571.js";import{S as _}from"./index.22776016.js";import{u as y}from"./hooks.19957bf3.js";import{C as v}from"./index.bd375ca9.js";import{C as S}from"./index.8c937010.js";import"./use-tab-status.653933d8.js";import"./index.975e8f79.js";import"./use-id.cc14bbe9.js";import"./index.9a41251d.js";const C="_groupTitle_4zxi8_1",N="_groupImg_4zxi8_9",T="_cell_4zxi8_16",w="_title_4zxi8_24",L="_time_4zxi8_28",x="_imgCover_4zxi8_33",I="_musicTitle_4zxi8_37",b="_theory_4zxi8_40";var a={groupTitle:C,groupImg:N,cell:T,title:w,time:L,imgCover:x,musicTitle:I,theory:b};function z(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Object]"&&!m(t)}var P=l({name:"special",data(){return this.$route.query,{activeNames:[],list:[],dataShow:!0,loading:!1,finished:!1,params:{search:"",page:1,rows:20},theory:null}},mounted(){const t=sessionStorage.getItem("theoryCache");if(t){const e=JSON.parse(t);this.theory=e;const s=e.activeNames.split(",").map(o=>o*1);this.activeNames=s,this.params.search=e.search||""}this.getList(),y("\u70ED\u95E8\u8D44\u8BAF")},methods:{async getList(){try{const t=this.params,e=await r.post("/api-cms/music/theory/app/page",{data:{...t}});this.loading=!1;const s=e.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(t){this.params.search=t,this.params.page=1,this.list=[],this.dataShow=!0,this.loading=!1,this.finished=!1,this.getList()},onDetail(t){if(t.linkUrl)window.location.href=t.linkUrl;else{const e=n.platformType==="STUDENT"?"student":"teacher";h({api:"openWebView",content:{url:`${location.origin}/${e}/#/theoryDetail?id=${t.id}`,orientation:1,isHideTitle:!1}})}}},render(){let t;return i("div",{class:[a.theory,"theory"]},[i(S,{position:"top",class:"mb12"},{default:()=>[i(v,{border:!1},null),i(_,{onSearch:this.onSearch,modelValue:this.params.search},null)]}),this.dataShow?i(d,{class:a.videoList,loading:this.loading,"onUpdate:loading":e=>this.loading=e,finished:this.finished,finishedText:"\u6CA1\u6709\u66F4\u591A\u4E86",immediateCheck:!1,onLoad:this.getList},z(t=this.list.map(e=>i(g,{modelValue:this.activeNames,"onUpdate:modelValue":s=>this.activeNames=s,border:!1},{default:()=>[i(f,{title:e.name,name:e.id,center:!0},{default:()=>[e.newsInformationList.map(s=>i(p,{title:s.title,class:a.cell,border:!1,onClick:()=>{this.onDetail(s)},titleClass:["van-ellipsis",a.title]},null))],title:()=>i("div",{class:[a.groupTitle]},[e.url&&i(u,{src:e.url,fit:"cover",class:a.groupImg},null),i("p",{class:["van-ellipsis",a.musicTitle]},[e.name])])})]})))?t:{default:()=>[t]}):i(c,{btnStatus:!1,classImgSize:"SMALL",tips:"\u6682\u65E0\u5185\u5BB9"},null)])}});export{P as default};