import{d as h,O as y,P as L,Q as S,S as t,a2 as A,j as r,x as T,g as m,bf as _,C as E}from"./index.3bfa6a0e.js";import{L as w}from"./index.0a290e73.js";import{S as C}from"./index.0090270e.js";import{M}from"./index.d7aedf5c.js";const x="_personal_1yygr_1",q="_practice_1yygr_20",G="_personalSong_1yygr_21",R="_musicGrid_1yygr_30";var b={personal:x,practice:q,personalSong:G,musicGrid:R},F=h({name:"MusicList",emits:["favorite"],props:{gift:{type:Number,default:0}},setup(d,{expose:g,emit:v}){const l=y(),p=L(),e=S({search:l.query.search||"",musicTagIds:l.query.tagids||"",gift:d.gift,page:1}),i=t(null),s=t([]),u=t(!1),a=t(!1),c=t(!1),f=async()=>{if(!u.value){u.value=!0,c.value=!1;try{const o=await T("/music/sheet/my",{method:m.platformType==="TEACHER"?"POST":"GET",prefix:m.platformType==="TEACHER"?"/api-teacher":"/api-student",params:e,data:m.platformType==="TEACHER"?e:{}});s.value=[...s.value,...o.data.rows],i.value=o.data,e.page=o.data.pageNo+1,a.value=o.data.pageNo>=o.data.totalPage}catch{c.value=!0}u.value=!1}};return A(()=>d.gift,o=>{c.value=!1,s.value=[],e.page=1,a.value=!1,e.gift=o,f()}),g({reset:()=>{c.value=!1,s.value=[],e.page=1,a.value=!1,f()},FetchList:f}),()=>r(w,{loading:u.value,finished:a.value,"finished-text":s.value.length?"\u6CA1\u6709\u66F4\u591A\u4E86":"",onLoad:f,error:c.value},{default:()=>[s.value.length?r("div",{class:b.personalSong},[r(C,{list:s.value,onDetail:o=>{const n=location.origin+location.pathname+"#/music-detail?id="+o.id;_(n,()=>{p.push({path:"/music-detail",query:{id:o.id}})})}},null)]):!u.value&&r(E,{tips:"\u6682\u65E0\u5355\u66F2",classImgSize:"SMALL",btnStatus:!1},null)]})}}),D=h({name:"MusicList",emits:["favorite"],setup(d,{expose:g,emit:v}){const l=y(),p=L(),e=S({search:l.query.search||"",musicTagIds:l.query.tagids||"",page:1}),i=t([]),s=t(null),u=t(!1),a=t(!1),c=t(!1),f=async()=>{if(!u.value){u.value=!0,c.value=!1;try{const n=await T("/music/sheet/favorite",{prefix:m.platformType==="TEACHER"?"/api-teacher":"/api-student",params:e});i.value=[...i.value,...n.data.rows],s.value=n.data,e.page=n.data.pageNo+1,a.value=n.data.pageNo>=n.data.totalPage}catch{c.value=!0}u.value=!1}};return g({reset:()=>{c.value=!1,i.value=[],e.page=1,a.value=!1,f()},FetchList:f}),()=>r(w,{loading:u.value,finished:a.value,"finished-text":i.value.length?"\u6CA1\u6709\u66F4\u591A\u4E86":"",onLoad:f,error:c.value},{default:()=>[i.value.length?r("div",{class:b.personalSong},[r(C,{list:i.value,onDetail:n=>{const N=location.origin+location.pathname+"#/music-detail?id="+n.id;_(N,()=>{p.push({path:"/music-detail",query:{id:n.id}})})}},null)]):!u.value&&r(E,{tips:"\u6682\u65E0\u6536\u85CF\u5355\u66F2",classImgSize:"SMALL",btnStatus:!1},null)]})}}),O=h({name:"MusicList",setup(){const d=y(),g=L(),v=S({search:d.query.search||"",musicTagIds:d.query.tagids||"",page:1}),l=t([]),p=t(null),e=t(!1),i=t(!1),s=t(!1),u=async()=>{if(!e.value){e.value=!0,s.value=!1;try{const a=await T("/music/album/favorite",{prefix:m.platformType==="TEACHER"?"/api-teacher":"/api-student",params:v});l.value=[...l.value,...a.data.rows],p.value=a.data,v.page=a.data.pageNo+1,i.value=a.data.pageNo>=a.data.totalPage}catch{s.value=!0}e.value=!1}};return()=>r(w,{loading:e.value,finished:i.value,"finished-text":l.value.length?"\u6CA1\u6709\u66F4\u591A\u4E86":"",onLoad:u,error:s.value},{default:()=>[l.value.length?r("div",{class:b.musicGrid},[r(M,{list:p.value.rows,onGoto:a=>{g.push({name:"music-album-detail",params:{id:a.id}})}},null)]):!e.value&&r(E,{tips:"\u6682\u65E0\u6536\u85CF\u4E13\u8F91",classImgSize:"SMALL",btnStatus:!1},null)]})}}),V=h({name:"MusicList",props:{gift:{type:Number,default:0}},setup(d){y();const g=L(),v=S({page:1,gift:d.gift}),l=t([]),p=t(null),e=t(!1),i=t(!1),s=t(!1),u=async()=>{if(!e.value){e.value=!0,s.value=!1;try{const a=await T("/music/album/purchased",{prefix:m.platformType==="TEACHER"?"/api-teacher":"/api-student",params:v});l.value=[...l.value,...a.data.rows],p.value=a.data,v.page=a.data.pageNo+1,i.value=a.data.pageNo>=a.data.totalPage}catch{s.value=!0}e.value=!1}};return A(()=>d.gift,a=>{s.value=!1,l.value=[],v.page=1,i.value=!1,v.gift=a,u()}),()=>r(w,{loading:e.value,finished:i.value,"finished-text":l.value.length?"\u6CA1\u6709\u66F4\u591A\u4E86":"",onLoad:u,error:s.value},{default:()=>[l.value.length?r("div",{class:b.musicGrid},[r(M,{isHiddenTag:!0,list:p.value.rows,onGoto:a=>{g.push({name:"music-album-detail",params:{id:a.id}})}},null)]):!e.value&&r(E,{tips:"\u6682\u65E0\u4E13\u8F91",classImgSize:"SMALL",btnStatus:!1},null)]})}});export{V as A,D as C,F as P,O as a,b as s};
