import{d as f,P as g,S as n,j as a,bf as h,F as S,x as C,g as y,U as T}from"./index.3bfa6a0e.js";import"./index.6bd4dfa5.js";import"./index.e9acc943.js";import{T as I,a as i}from"./index.cd00eeaf.js";import{c as P}from"./index.b1671445.js";import{C as x}from"./index.79997a38.js";import{s as d,P as A,A as F,C as w,a as k}from"./album-my.0c7a7379.js";import{S as E}from"./index.0090270e.js";import{g as M}from"./music.20bd83e9.js";import{u as R}from"./hooks.435f47d5.js";import{C as V}from"./index.645e7ddc.js";import"./use-id.7c44c16f.js";import"./use-tab-status.c0d730a9.js";import"./use-refs.7efc98f2.js";import"./index.4a8093e5.js";import"./index.0a290e73.js";import"./index.d7aedf5c.js";import"./index.8711ee78.js";import"./index.0fd5538f.js";import"./icon-xin.62588855.js";import"./icon_uploader.ff962490.js";import"./icon_album.ed729d4a.js";import"./icon_album_active.469423f9.js";import"./icon_exquisite.4b18ad76.js";import"./icon_music_active.1e7b47ef.js";import"./icon-play.bc9e7aab.js";var q=f({name:"Practice",emits:["favorite"],setup(p,{expose:t,emit:m}){const u=g(),r=n(0),{isLoading:e,state:l,execute:s}=P(o=>C.get("/music/sheet/practice",{prefix:y.platformType==="TEACHER"?"/api-teacher":"/api-student",params:{rows:(o==null?void 0:o.rows)||3}}),null);return t({reload:s}),()=>{var c;const o=((c=l.value)==null?void 0:c.data.rows)||[];return r.value===0&&(r.value=o.length),a(S,null,[r.value>0&&a(x,{title:"\u6700\u8FD1\u7EC3\u4E60",border:!1},null),a("div",{class:d.practice},[a(E,{list:o,onDetail:v=>{const b=location.origin+location.pathname+"#/music-detail?id="+v.id;h(b,()=>{u.push({path:"/music-detail",query:{id:v.id}})})}},null)])])}}}),ie=f({name:"MusicPersonal",setup(){localStorage.setItem("behaviorId",M());const p=sessionStorage.getItem("music-personal-tab-value");sessionStorage.removeItem("music-personal-tab-value");const t=n(p||"personal");sessionStorage.setItem("music-personal-tab-value",t.value);const m=n(),u=n(),r=n();return T(()=>{R("\u6211\u7684\u4E50\u8C31")}),()=>a("div",{class:d.personal},[a(V,null,null),a(q,{ref:r,onFavorite:()=>{var e,l,s,o;t.value==="personal"?(l=(e=m.value)==null?void 0:e.reset)==null||l.call(e):t.value==="collection"&&((o=(s=u.value)==null?void 0:s.reset)==null||o.call(s))}},null),a(I,{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(i,{title:"\u6211\u7684\u5355\u66F2",name:"personal"},null),a(i,{title:"\u6211\u7684\u4E13\u8F91",name:"personal-album"},null),a(i,{title:"\u6536\u85CF\u5355\u66F2",name:"collection"},null),a(i,{title:"\u6536\u85CF\u4E13\u8F91",name:"album"},null),a(i,{title:"\u8D60\u9001\u5355\u66F2",name:"personal-gift"},null),a(i,{title:"\u8D60\u9001\u4E13\u8F91",name:"album-gift"},null)]}),(t.value==="personal"||t.value==="personal-gift")&&a(A,{ref:m,gift:t.value==="personal-gift"?1:0,onFavorite:()=>{var e,l;(l=(e=r.value)==null?void 0:e.reload)==null||l.call(e)}},null),(t.value==="personal-album"||t.value==="album-gift")&&a(F,{gift:t.value==="album-gift"?1:0},null),t.value==="collection"&&a(w,{ref:u,onFavorite:()=>{var e,l;(l=(e=r.value)==null?void 0:e.reload)==null||l.call(e)}},null),t.value==="album"&&a(k,null,null)])}});export{ie as default};
