import{d as C,Q as T,U as s,j as a,bg as A,aS as F,A as b,B as I,F as w,y as h,g as y,V as x}from"./ResizeObserver.es.45df6c0f.js";import"./index.41214d91.js";import"./index.ba862406.js";import{T as P,a as n}from"./index.cbe24982.js";import{c as V}from"./index.f6378dda.js";import{C as k}from"./index.5034ef43.js";import{s as R}from"./song-empty.5c514691.js";import{s as u,P as B,A as D,C as H,a as M}from"./album-my.e8555445.js";import{S as N}from"./index.264de4ca.js";import{g as q}from"./music.9d852d08.js";import{u as U}from"./hooks.d8170117.js";import{C as W}from"./index.1a59558b.js";import"./use-id.41c465c4.js";import"./use-tab-status.b9a2b892.js";import"./use-refs.4c6f1efb.js";import"./index.3c3f214d.js";import"./index.8d3bde74.js";import"./index.73914520.js";import"./index.e11fdb7d.js";import"./icon-xin.a59bfaf1.js";import"./icon_uploader.93248775.js";import"./icon_album.9592f49b.js";import"./icon_album_active.25be6148.js";import"./icon_exquisite.858d352b.js";import"./icon_music_active.a468d335.js";import"./icon-play.bc9e7aab.js";var j=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}=V(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(w,null,[o.value>0&&a(k,{title:"\u6700\u8FD1\u7EC3\u4E60",border:!1},null),a("div",{class:u.practice},[a(N,{list:r,onDetail:c=>{if(c.play===1){l.value=c,e.value=!0;return}const S=location.origin+location.pathname+"#/music-detail?id="+c.id;A(S,()=>{m.push({path:"/music-detail",query:{id:c.id}})})}},null)]),a(F,{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(I,{round:!0,onClick:E},{default:()=>[b("\u6211\u77E5\u9053\u4E86")]})])])]})])}}}),fe=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 x(()=>{U("\u6211\u7684\u4E50\u8C31")}),()=>a("div",{class:u.personal},[a(W,null,null),a(j,{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(P,{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(H,{ref:m,onFavorite:()=>{var e,l;(l=(e=o.value)==null?void 0:e.reload)==null||l.call(e)}},null),t.value==="album"&&a(M,null,null)])}});export{fe as default};
