import{d as f,P as g,S as n,j as a,be as h,F as S,w as C,g as y,U as T}from"./index.4f40e5e1.js";import"./index.54ea2849.js";import"./index.39d21790.js";import{T as I,a as i}from"./index.c9ba21fe.js";import{c as P}from"./index.10256463.js";import{C as w}from"./index.c4fa4795.js";import{s as d,P as A,A as F,C as x,a as k}from"./album-my.b79994c6.js";import{S as E}from"./index.bd8a8ffa.js";import{g as M}from"./music.90e10e91.js";import{u as R}from"./hooks.eddecfbf.js";import{C as V}from"./index.41aa1fc7.js";import"./use-id.d72892eb.js";import"./use-tab-status.122f9fa5.js";import"./use-refs.29c07da0.js";import"./index.ec6e6a47.js";import"./index.3066f4e5.js";import"./index.9d505f65.js";import"./index.97fec1a5.js";import"./icon-xin.a2c1df9b.js";import"./icon_uploader.0991da14.js";import"./icon_album.8720f897.js";import"./icon_album_active.29797940.js";import"./icon_exquisite.33049cce.js";import"./icon_music_active.1b7b0778.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(w,{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)])])}}}),se=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(x,{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{se as default};
