import{d as C,S as T,V as s,j as a,A,bf as F,aT as I,B as b,E as w,F as x,y as h,g as y,W as P}from"./ResizeObserver.es.62ab429c.js";import"./index.b0c6821a.js";import"./index.3d6f6bcd.js";import{T as V,a as n}from"./index.ffd89e39.js";import{c as k}from"./index.a6e5e68b.js";import{C as H}from"./index.d7a13e47.js";import{s as R}from"./song-empty.5c514691.js";import{s as u,P as B,A as D,C as M,a as N}from"./album-my.d6b8457e.js";import{S as W}from"./index.df4cff80.js";import{g as q}from"./music.56762674.js";import{a as j}from"./hooks.3b599d36.js";import{C as G}from"./index.786e83cc.js";import"./use-id.1bbe472d.js";import"./use-tab-status.a98984d2.js";import"./use-refs.259e72cb.js";import"./index.00698f4b.js";import"./index.281d2be5.js";import"./index.2a571689.js";import"./index.021584f9.js";import"./icon-xin.df8ab2d7.js";import"./icon_uploader.9f387137.js";import"./icon_album.fa329df6.js";import"./icon_album_active.ce98b2a8.js";import"./icon_exquisite.69e33c80.js";import"./icon_music_active.3b316ab8.js";import"./icon-play.bc9e7aab.js";var K=C({name:"Practice",emits:["favorite"],setup(f,{expose:t,emit:v}){const m=T(),o=s(0),e=s(!1),l=s({}),{isLoading:i,state:p,execute:d}=k(r=>h.get("/music/sheet/practice",{prefix:y.platformType==="TEACHER"?"/api-teacher":"/api-student",params:{rows:(r==null?void 0:r.rows)||3}}),null),E=async()=>{try{await h.get("/music/sheet/practice/del/"+l.value.id,{prefix:y.platformType==="TEACHER"?"/api-teacher":"/api-student"}),d(),e.value=!1}catch{}};return t({reload:d}),()=>{var g;const r=((g=p.value)==null?void 0:g.data.rows)||[];return o.value===0&&(o.value=r.length),a(x,null,[o.value>0&&a(H,{title:"\u6700\u8FD1\u7EC3\u4E60",border:!1},null),a("div",{class:u.practice},[a(W,{list:r,onDetail:c=>{if(c.play===1){l.value=c,e.value=!0;return}const S=A()+location.pathname+"#/music-detail?id="+c.id;F(S,()=>{m.push({path:"/music-detail",query:{id:c.id}})})}},null)]),a(I,{show:e.value,class:u.songEfficacy,round:!0,onClose:()=>e.value=!1},{default:()=>[a("div",{class:u.songContainer},[a("div",{class:u.title},[b("\u8BE5\u66F2\u76EE\u5DF2\u5931\u6548")]),a("img",{src:R},null),a("div",{class:u.btnGroup},[a(w,{round:!0,onClick:E},{default:()=>[b("\u6211\u77E5\u9053\u4E86")]})])])]})])}}}),de=C({name:"MusicPersonal",setup(){localStorage.setItem("behaviorId",q());const f=sessionStorage.getItem("music-personal-tab-value");sessionStorage.removeItem("music-personal-tab-value");const t=s(f||"personal");sessionStorage.setItem("music-personal-tab-value",t.value);const v=s(),m=s(),o=s();return P(()=>{j("\u6211\u7684\u4E50\u8C31")}),()=>a("div",{class:u.personal},[a(G,null,null),a(K,{ref:o,onFavorite:()=>{var e,l,i,p;t.value==="personal"?(l=(e=v.value)==null?void 0:e.reset)==null||l.call(e):t.value==="collection"&&((p=(i=m.value)==null?void 0:i.reset)==null||p.call(i))}},null),a(V,{color:"var(--van-primary)",background:"transparent",lineWidth:20,shrink:!0,active:t.value,"onUpdate:active":e=>t.value=e,onChange:e=>{t.value=e,sessionStorage.setItem("music-personal-tab-value",e)}},{default:()=>[a(n,{title:"\u6211\u7684\u5355\u66F2",name:"personal"},null),a(n,{title:"\u6211\u7684\u4E13\u8F91",name:"personal-album"},null),a(n,{title:"\u6536\u85CF\u5355\u66F2",name:"collection"},null),a(n,{title:"\u6536\u85CF\u4E13\u8F91",name:"album"},null),a(n,{title:"\u8D60\u9001\u5355\u66F2",name:"personal-gift"},null),a(n,{title:"\u8D60\u9001\u4E13\u8F91",name:"album-gift"},null)]}),(t.value==="personal"||t.value==="personal-gift")&&a(B,{ref:v,gift:t.value==="personal-gift"?1:0,onFavorite:()=>{var e,l;(l=(e=o.value)==null?void 0:e.reload)==null||l.call(e)}},null),(t.value==="personal-album"||t.value==="album-gift")&&a(D,{gift:t.value==="album-gift"?1:0},null),t.value==="collection"&&a(M,{ref:m,onFavorite:()=>{var e,l;(l=(e=o.value)==null?void 0:e.reload)==null||l.call(e)}},null),t.value==="album"&&a(N,null,null)])}});export{de as default};
