import{d as y,Q as k,g as l,y as g,S,j as a,F as _,B as d,O as b,U as I,V as p,A as E,bf as N,C as V}from"./ResizeObserver.es.62ab429c.js";import{I as L}from"./index.021584f9.js";import{C}from"./index.d7a13e47.js";import{c as j}from"./index.a6e5e68b.js";import{c as D}from"./index.926ca9c5.js";import{b as T,S as h}from"./hooks.3b599d36.js";import{I as R,a as F}from"./icon-xin-active.3d0e362e.js";import{L as x}from"./index.00698f4b.js";import{S as U}from"./index.6fbb4850.js";import{g as H}from"./music.9463d067.js";import"./use-tab-status.a98984d2.js";import"./icon-xin2.4ab2a52d.js";const P="_songbook_1omyu_1",$="_sticky_1omyu_11",q="_title_1omyu_14",B="_cellTitle_1omyu_20",O="_cellValue_1omyu_25",X="_albumContainer_1omyu_34",z="_album_1omyu_34",G="_albumType_1omyu_52",K="_main_1omyu_65",M="_favorite_1omyu_68",Q="_img_1omyu_82",W="_model_1omyu_101",J="_num_1omyu_116",Y="_listContainer_1omyu_119";var s={songbook:P,sticky:$,title:q,cellTitle:B,cellValue:O,albumContainer:X,album:z,albumType:G,main:K,favorite:M,img:Q,model:W,num:J,listContainer:Y},Z=y({name:"Songbook",setup(){k();const o={};l.version&&(o.version=l.version||"",o.platform=l.platformType==="STUDENT"?"ios-student":"ios-teacher");const n=l.platformType==="STUDENT"?"/api-student":"/api-teacher";o.myself=!1;const r=T(h.SEARCH);r&&(o.subjectIds=r.id);const{isLoading:v,state:e}=j(g.post(`${n}/music/album/list`,{data:{...o}}),null),u=S();return()=>a(_,null,[e.value&&e.value.data.rows.length?a(_,null,[a(C,{class:s.title,titleClass:s.cellTitle,title:"\u4E13\u8F91",to:"/music-album",border:!1},{value:()=>a("span",{class:s.cellValue},[d("\u66F4\u591A"),a(b,{name:"arrow"},null)])}),a("div",{class:s.albumContainer},[e.value.data.rows.map(t=>a("div",{class:s.album,key:t.id,onClick:()=>u.push("/music-album-detail/"+t.id)},[a("div",{class:s.main},[t.paymentType==="CHARGE"&&a("span",{class:s.albumType},[d("\u4ED8\u8D39")]),a(L,{class:s.img,src:t.albumCoverUrl},null),a("div",{class:s.model},[a(b,{name:t.favorite?R:F},null),a("span",{class:s.num},[t.albumFavoriteCount,d("\u4EBA")])])]),a("h4",{class:D(s.title,"van-ellipsis")},[t.albumName])]))])]):null])}}),aa=y({name:"Songbook",setup(){const o=S(),n={};l.version&&(n.version=l.version||"",n.platform=l.platformType==="STUDENT"?"ios-student":"ios-teacher");const r=T(h.SEARCH);r&&(n.subjectIds=r.id);const v=I({auditStatus:"PASS",myself:!1,page:1,...n}),e=p(null),u=p(!1),t=p(!1),f=p(!1),w=async()=>{var c;if(u.value)return;u.value=!0,f.value=!1;const m={...v};try{const i=await g.post(`${l.platformApi}/music/sheet/list`,{data:m});if(e.value){const A=(((c=e.value)==null?void 0:c.rows)||[]).concat(i.data.rows||[]);e.value.rows=A}e.value=e.value||i.data,v.page=i.data.pageNo+1,t.value=i.data.pageNo>=i.data.totalPage}catch{f.value=!0}u.value=!1};return()=>a(_,null,[e.value&&e.value.rows.length>0&&a(C,{class:s.title,titleClass:s.cellTitle,title:"\u66F2\u8C31",to:"/music-list",border:!1},{value:()=>a("span",{class:s.cellValue},[d("\u66F4\u591A"),a(b,{name:"arrow"},null)])}),a(x,{loading:u.value,finished:t.value,"finished-text":e.value&&e.value.rows.length?"\u6CA1\u6709\u66F4\u591A\u4E86":"",onLoad:w,error:f.value},{default:()=>[e.value&&e.value.rows.length?a("div",{class:s.listContainer},[a(U,{list:e.value.rows,onDetail:m=>{const c=E()+location.pathname+"#/music-detail?id="+m.id;N(c,()=>{o.push({path:"/music-detail",query:{id:m.id}})})}},null)]):!u.value&&a(V,{tips:"\u6682\u65E0\u66F2\u76EE",classImgSize:"SMALL",btnStatus:!1},null)]})])}}),da=y({name:"Songbook",setup(){return localStorage.setItem("behaviorId",H()),()=>a("div",{class:s.songbook},[a(Z,null,null),a(aa,null,null)])}});export{da as default};
