import{d as f,V as l,a as s,F as S,q as I,a8 as F,_ as h,h as y,w as j,G as q,H as b}from"./vendor.a0144ce9.js";/* empty css               *//* empty css               *//* empty css               */import{r as g,C as x}from"./index.3d95a92c.js";import{b as C}from"./index.28b40a59.js";/* empty css               */import{I as L}from"./item.e115375c.js";import{m as w,g as N}from"./music.21b5a533.js";/* empty css               */import{I as k}from"./item.86e13af7.js";/* empty css               *//* empty css                */import"./index.926ca9c5.js";import"./init-user-icon.d5c3c464.js";import"./favorite.9bdf4305.js";import"./orderStatus.243cb96a.js";import"./index.339fc024.js";import"./footer.b1c4a2d9.js";var A=f({name:"Practice",emits:["favorite"],setup(i,{expose:v,emit:c}){const u=l(0),{isLoading:e,state:t,execute:r}=C(a=>g.get("/api-student/music/sheet/practice",{params:{rows:(a==null?void 0:a.rows)||3}}),null);return v({reload:r}),()=>{var o;const a=((o=t.value)==null?void 0:o.data.rows)||[];return u.value===0&&(u.value=a.length),s(S,null,[u.value>0&&s(I,{title:"\u6700\u8FD1\u7EC3\u4E60"},null),Array.from(Array(u.value)).map((d,p)=>{const n=a[p];return console.log(a,n),n?s(L,{key:n.id,data:n,onClick:()=>w(n),onFavorite:()=>{c("favorite")}},null):s(F,{row:5},null)})])}}}),M=f({name:"MusicList",emits:["favorite"],setup(i,{expose:v,emit:c}){const u=h(),e=y({search:u.query.search||"",musicTagIds:u.query.tagids||"",page:1}),t=l(null),r=l([]),a=l(!1),o=l(!1),d=l(!1),p=async()=>{if(!a.value){a.value=!0,d.value=!1;try{const n=await g("/api-student/music/sheet/my",{params:e});r.value=[...r.value,...n.data.rows],t.value=n.data,e.page=n.data.pageNo+1,o.value=n.data.pageNo>=n.data.totalPage}catch{d.value=!0}a.value=!1}};return v({reset:()=>{d.value=!1,r.value=[],e.page=1,o.value=!1,p()},FetchList:p}),()=>s(j,{loading:a.value,finished:o.value,"finished-text":r.value.length?"\u6CA1\u6709\u66F4\u591A\u4E86":"",onLoad:p,error:d.value},{default:()=>[r.value.length?r.value.map(n=>s(L,{data:n,onClick:()=>w(n),onFavorite:()=>c("favorite")},null)):!a.value&&s(x,{tips:"\u6682\u65E0\u5355\u66F2",classImgSize:"SMALL",btnStatus:!1},null)]})}}),P=f({name:"MusicList",emits:["favorite"],setup(i,{expose:v,emit:c}){const u=h(),e=y({search:u.query.search||"",musicTagIds:u.query.tagids||"",page:1}),t=l([]),r=l(null),a=l(!1),o=l(!1),d=l(!1),p=async()=>{if(!a.value){a.value=!0,d.value=!1;try{const m=await g("/api-student/music/sheet/favorite",{params:e});t.value=[...t.value,...m.data.rows],r.value=m.data,e.page=m.data.pageNo+1,o.value=m.data.pageNo>=m.data.totalPage}catch{d.value=!0}a.value=!1}},n=()=>{d.value=!1,t.value=[],e.page=1,o.value=!1,p()};return v({reset:n,FetchList:p}),()=>s(j,{loading:a.value,finished:o.value,"finished-text":t.value.length?"\u6CA1\u6709\u66F4\u591A\u4E86":"",onLoad:p,error:d.value},{default:()=>[t.value.length?t.value.map(m=>s(L,{data:m,onClick:()=>w(m),onFavorite:()=>{n(),c("favorite")}},null)):!a.value&&s(x,{tips:"\u6682\u65E0\u6536\u85CF\u5355\u66F2",classImgSize:"SMALL",btnStatus:!1},null)]})}}),T=f({name:"MusicList",setup(){const i=h(),v=y({search:i.query.search||"",musicTagIds:i.query.tagids||"",page:1}),c=l([]),u=l(null),e=l(!1),t=l(!1),r=l(!1),a=async()=>{if(!e.value){e.value=!0,r.value=!1;try{const o=await g("/api-student/music/album/favorite",{params:v});c.value=[...c.value,...o.data.rows],u.value=o.data,v.page=o.data.pageNo+1,t.value=o.data.pageNo>=o.data.totalPage}catch{r.value=!0}e.value=!1}};return()=>s(j,{loading:e.value,finished:t.value,"finished-text":c.value.length?"\u6CA1\u6709\u66F4\u591A\u4E86":"",onLoad:a,error:r.value},{default:()=>[c.value.length?c.value.map(o=>s(k,{data:o},null)):!e.value&&s(x,{tips:"\u6682\u65E0\u6536\u85CF\u4E13\u8F91",classImgSize:"SMALL",btnStatus:!1},null)]})}});const _="_personal_pjuhq_1";var z={personal:_},te=f({name:"MusicPersonal",setup(){localStorage.setItem("behaviorId",N());const i=l("personal"),v=l(),c=l(),u=l();return()=>s("div",{class:z.personal},[s(A,{ref:u,onFavorite:()=>{var e,t,r,a;i.value==="personal"?(t=(e=v.value)==null?void 0:e.reset)==null||t.call(e):i.value==="collection"&&((a=(r=c.value)==null?void 0:r.reset)==null||a.call(r))}},null),s(q,{color:"var(--van-primary)",background:"transparent",lineWidth:20,shrink:!0,active:i.value,"onUpdate:active":e=>i.value=e,onChange:e=>i.value=e},{default:()=>[s(b,{title:"\u6211\u7684\u5355\u66F2",name:"personal"},null),s(b,{title:"\u6536\u85CF\u5355\u66F2",name:"collection"},null),s(b,{title:"\u6536\u85CF\u4E13\u8F91",name:"album"},null)]}),i.value==="personal"&&s(M,{ref:v,onFavorite:()=>{var e,t;(t=(e=u.value)==null?void 0:e.reload)==null||t.call(e)}},null),i.value==="collection"&&s(P,{ref:c,onFavorite:()=>{var e,t;(t=(e=u.value)==null?void 0:e.reload)==null||t.call(e)}},null),i.value==="album"&&s(T,null,null)])}});export{te as default};
