import{d as b,P as y,S as s,w as T,g as h,j as a,F as q,be as x,O as w,Q as L,a2 as A,C as _,U as M}from"./index.dddc82f0.js";import"./index.34856828.js";import"./index.adf16db2.js";import{T as R,a as C}from"./index.ed371894.js";import{b as j}from"./index.68cdb872.js";import{C as I}from"./index.1b2b9343.js";import{S as E}from"./index.e59b37af.js";import{L as S}from"./index.c2e06d7f.js";import{M as N}from"./index.2e540f68.js";import{b as F}from"./bg-image.e9966434.js";import{g as P}from"./music.496caace.js";import{u as H}from"./hooks.c672aede.js";import{T as k}from"./index.4456e29b.js";import{C as z}from"./index.0dbccfa2.js";import{C as D}from"./index.23fcc6da.js";import{I as O}from"./index.0dc7ad6f.js";import"./use-id.c1f6218b.js";import"./use-tab-status.5b63872e.js";import"./use-refs.28021c76.js";import"./icon-xin2.4ab2a52d.js";import"./index.bba3b0ec.js";import"./index.5eeab7c7.js";import"./use-height.cdb76f46.js";const U="_personal_ojpxq_1",V="_bgImg_ojpxq_42",W="_pTitle_ojpxq_50",K="_practice_ojpxq_55",Q="_personalSong_ojpxq_56",$="_musicGrid_ojpxq_65",B="_tennatCellGroup_ojpxq_68",J="_tenantLogo_ojpxq_80",X="_tenantCoverImg_ojpxq_86",Y="_tenantContent_ojpxq_93";var d={personal:U,bgImg:V,pTitle:W,practice:K,personalSong:Q,musicGrid:$,tennatCellGroup:B,tenantLogo:J,tenantCoverImg:X,tenantContent:Y},Z=b({name:"Practice",emits:["favorite"],setup(o,{expose:p,emit:c}){const r=y(),t=s(0),{isLoading:l,state:n,execute:u}=j(i=>T.get("/music/sheet/practice",{prefix:h.platformType==="TEACHER"?"/api-teacher":"/api-student",params:{rows:(i==null?void 0:i.rows)||3}}),null);return p({reload:u}),()=>{var e;const i=((e=n.value)==null?void 0:e.data.rows)||[];return t.value===0&&(t.value=i.length),a(q,null,[t.value>0&&a(q,null,[a(I,{titleClass:d.pTitle,title:"\u6700\u8FD1\u7EC3\u4E60",border:!1},null),a("div",{class:d.practice},[a(E,{showTitleImg:!0,list:i,onDetail:v=>{const g=location.origin+location.pathname+"#/music-detail?id="+v.id;x(g,()=>{r.push({path:"/music-detail",query:{id:v.id}})})}},null)])])])}}}),aa=b({name:"MusicList",emits:["favorite"],props:{gift:{type:Number,default:0}},setup(o,{expose:p,emit:c}){const r=w(),t=y(),l=L({search:r.query.search||"",musicTagIds:r.query.tagids||"",gift:o.gift,page:1}),n=s(null),u=s([]),i=s(!1),e=s(!1),v=s(!1),g=async()=>{if(!i.value){i.value=!0,v.value=!1;try{const m=await T("/music/sheet/my",{method:h.platformType==="TEACHER"?"POST":"GET",prefix:h.platformType==="TEACHER"?"/api-teacher":"/api-student",params:l,data:h.platformType==="TEACHER"?l:{}});u.value=[...u.value,...m.data.rows],n.value=m.data,l.page=m.data.pageNo+1,e.value=m.data.pageNo>=m.data.totalPage}catch{v.value=!0}i.value=!1}};return A(()=>o.gift,m=>{v.value=!1,u.value=[],l.page=1,e.value=!1,l.gift=m,g()}),p({reset:()=>{v.value=!1,u.value=[],l.page=1,e.value=!1,g()},FetchList:g}),()=>a(S,{loading:i.value,finished:e.value,"finished-text":u.value.length?"\u6CA1\u6709\u66F4\u591A\u4E86":"",onLoad:g,error:v.value},{default:()=>[u.value.length?a("div",{class:d.personalSong},[a(E,{showTitleImg:!0,list:u.value,onDetail:m=>{const f=location.origin+location.pathname+"#/music-detail?id="+m.id;x(f,()=>{t.push({path:"/music-detail",query:{id:m.id}})})}},null)]):!i.value&&a(_,{tips:"\u6682\u65E0\u5355\u66F2",classImgSize:"SMALL",btnStatus:!1},null)]})}}),ea=b({name:"MusicList",emits:["favorite"],setup(o,{expose:p,emit:c}){const r=w(),t=y(),l=L({search:r.query.search||"",musicTagIds:r.query.tagids||"",page:1}),n=s([]),u=s(null),i=s(!1),e=s(!1),v=s(!1),g=async()=>{if(!i.value){i.value=!0,v.value=!1;try{const f=await T("/music/sheet/favorite",{prefix:h.platformType==="TEACHER"?"/api-teacher":"/api-student",params:l});n.value=[...n.value,...f.data.rows],u.value=f.data,l.page=f.data.pageNo+1,e.value=f.data.pageNo>=f.data.totalPage}catch{v.value=!0}i.value=!1}};return p({reset:()=>{v.value=!1,n.value=[],l.page=1,e.value=!1,g()},FetchList:g}),()=>a(S,{loading:i.value,finished:e.value,"finished-text":n.value.length?"\u6CA1\u6709\u66F4\u591A\u4E86":"",onLoad:g,error:v.value},{default:()=>[n.value.length?a("div",{class:d.personalSong},[a(E,{showTitleImg:!0,list:n.value,onDetail:f=>{const G=location.origin+location.pathname+"#/music-detail?id="+f.id;x(G,()=>{t.push({path:"/music-detail",query:{id:f.id}})})}},null)]):!i.value&&a(_,{tips:"\u6682\u65E0\u6536\u85CF\u5355\u66F2",classImgSize:"SMALL",btnStatus:!1},null)]})}}),ta=b({name:"MusicList",setup(){const o=w(),p=y(),c=L({search:o.query.search||"",musicTagIds:o.query.tagids||"",page:1}),r=s([]),t=s(null),l=s(!1),n=s(!1),u=s(!1),i=async()=>{if(!l.value){l.value=!0,u.value=!1;try{const e=await T("/music/album/favorite",{prefix:h.platformType==="TEACHER"?"/api-teacher":"/api-student",params:c});r.value=[...r.value,...e.data.rows],t.value=e.data,c.page=e.data.pageNo+1,n.value=e.data.pageNo>=e.data.totalPage}catch{u.value=!0}l.value=!1}};return()=>a(S,{loading:l.value,finished:n.value,"finished-text":r.value.length?"\u6CA1\u6709\u66F4\u591A\u4E86":"",onLoad:i,error:u.value},{default:()=>[r.value.length?a("div",{class:d.musicGrid},[a(N,{list:t.value.rows,onGoto:e=>{p.push({name:"music-album-detail",params:{id:e.id}})}},null)]):!l.value&&a(_,{tips:"\u6682\u65E0\u6536\u85CF\u4E13\u8F91",classImgSize:"SMALL",btnStatus:!1},null)]})}}),la=b({name:"MusicList",props:{gift:{type:Number,default:0}},setup(o){w();const p=y(),c=L({page:1,gift:o.gift}),r=s([]),t=s(null),l=s(!1),n=s(!1),u=s(!1),i=async()=>{if(!l.value){l.value=!0,u.value=!1;try{const e=await T("/music/album/purchased",{prefix:h.platformType==="TEACHER"?"/api-teacher":"/api-student",params:c});r.value=[...r.value,...e.data.rows],t.value=e.data,c.page=e.data.pageNo+1,n.value=e.data.pageNo>=e.data.totalPage}catch{u.value=!0}l.value=!1}};return A(()=>o.gift,e=>{u.value=!1,r.value=[],c.page=1,n.value=!1,c.gift=e,i()}),()=>a(S,{loading:l.value,finished:n.value,"finished-text":r.value.length?"\u6CA1\u6709\u66F4\u591A\u4E86":"",onLoad:i,error:u.value},{default:()=>[r.value.length?a("div",{class:d.musicGrid},[a(N,{isHiddenTag:!0,list:t.value.rows,onGoto:e=>{p.push({name:"music-album-detail",params:{id:e.id}})}},null)]):!l.value&&a(_,{tips:"\u6682\u65E0\u4E13\u8F91",classImgSize:"SMALL",btnStatus:!1},null)]})}}),sa=b({name:"tenant-album",setup(){const o=y(),p=L({page:1,rows:20}),c=s([]),r=s(null),t=s(!1),l=s(!1),n=s(!1),u=async()=>{if(!t.value){t.value=!0,n.value=!1;try{const e=await T.post("/userTenantAlbumRecord/page",{prefix:h.platformType==="TEACHER"?"/api-teacher":"/api-student",data:p});c.value=[...c.value,...e.data.rows],r.value=e.data,console.log(r.value),p.page=e.data.pageNo+1,l.value=e.data.pageNo>=e.data.totalPage}catch{n.value=!0}t.value=!1}},i=e=>{o.push({path:"/train-tool",query:{albumId:e.id,buy:"1"}})};return()=>a(S,{loading:t.value,finished:l.value,"finished-text":c.value.length?" ":"",onLoad:u,error:n.value},{default:()=>[c.value.length?c.value.map(e=>a(D,{class:d.tennatCellGroup,border:!1,onClick:()=>i(e)},{default:()=>[a(I,{isLink:!0,clickable:!1},{icon:()=>a("img",{src:e.tenantImg,class:d.tenantLogo},null),title:()=>a("div",{class:d.tenantName},[e.tenantName])}),a(I,null,{icon:()=>a(O,{src:e.coverImg,class:d.tenantCoverImg},null),title:()=>a("div",{class:d.tenantContent},[a("h2",null,[e.name]),a("p",{class:"van-multi-ellipsis--l2"},[e.describe])])})]})):!t.value&&a(_,{tips:"\u6682\u65E0\u8BAD\u7EC3\u6559\u7A0B",classImgSize:"SMALL",btnStatus:!1},null)]})}}),Ea=b({name:"MusicPersonal",setup(){localStorage.setItem("behaviorId",P());const o=s("train-course"),p=s(),c=s(),r=s();return M(()=>{H("\u6211\u7684\u4E50\u8C31")}),()=>a("div",{class:d.personal},[a(k,{position:"top"},{default:()=>[a(z,{background:"transparent",isFixed:!1,border:!1,color:"#131415"},null)]}),a("img",{class:d.bgImg,src:F},null),a(Z,{ref:r,onFavorite:()=>{var t,l,n,u;o.value==="personal"?(l=(t=p.value)==null?void 0:t.reset)==null||l.call(t):o.value==="collection"&&((u=(n=c.value)==null?void 0:n.reset)==null||u.call(n))}},null),a(R,{color:"var(--van-primary)",background:"transparent",lineWidth:20,shrink:!0,active:o.value,"onUpdate:active":t=>o.value=t,onChange:t=>o.value=t},{default:()=>[a(C,{title:"\u8BAD\u7EC3\u6559\u7A0B",name:"train-course"},null),a(C,{title:"\u6211\u7684\u5355\u66F2",name:"personal"},null),a(C,{title:"\u6211\u7684\u4E13\u8F91",name:"personal-album"},null),a(C,{title:"\u6536\u85CF\u5355\u66F2",name:"collection"},null),a(C,{title:"\u6536\u85CF\u4E13\u8F91",name:"album"},null)]}),o.value==="train-course"&&a(sa,null,null),(o.value==="personal"||o.value==="personal-gift")&&a(aa,{ref:p,gift:o.value==="personal-gift"?1:0,onFavorite:()=>{var t,l;(l=(t=r.value)==null?void 0:t.reload)==null||l.call(t)}},null),(o.value==="personal-album"||o.value==="album-gift")&&a(la,{gift:o.value==="album-gift"?1:0},null),o.value==="collection"&&a(ea,{ref:c,onFavorite:()=>{var t,l;(l=(t=r.value)==null?void 0:t.reload)==null||l.call(t)}},null),o.value==="album"&&a(ta,null,null)])}});export{Ea as default};