import{d as Y,q as P,x as A,e as S,y as E,a as e,V as B,S as h,U as I,A as u,a2 as L,R as Q,F as b,K as C,D as H,a8 as U}from"./index-869d77fb.js";import{M as q}from"./index-3eb77ad0.js";import{M as k}from"./index-d315d9dc.js";import{c as x,b as z}from"./api-b637a269.js";import{L as F}from"./index-f12c44b8.js";import{C as T}from"./index-1c6c2ec0.js";import{I as f}from"./index-e76f2a88.js";import"./index-155c29c2.js";import"./index-0153d173.js";import"./use-tab-status-0ed30c24.js";const V="_hotMusicMore_qua5g_1",R="_woringHeader_qua5g_13",K="_leftArrow_qua5g_18",W="_title_qua5g_21",J="_searchContent_qua5g_44",D="_active_qua5g_63",N="_emptyGroup_qua5g_67",O="_musicList_qua5g_70",Z="_musicItem_qua5g_76",G="_musicImg_qua5g_79",X="_musicPlayIcon_qua5g_86",$="_musicContnet_qua5g_90",ss="_changeSubjectContainer_qua5g_106",es="_searchHead_qua5g_134",ts="_cancel_qua5g_146",as="_confirm_qua5g_147",cs="_subjectContainer_qua5g_157",ns="_subjectContainerTwo_qua5g_163",os="_subjectItem_qua5g_163",is="_arrow_qua5g_194",a={hotMusicMore:V,woringHeader:R,leftArrow:K,title:W,searchContent:J,active:D,emptyGroup:N,musicList:O,musicItem:Z,musicImg:G,musicPlayIcon:X,musicContnet:$,changeSubjectContainer:ss,searchHead:es,cancel:ts,confirm:as,subjectContainer:cs,subjectContainerTwo:ns,subjectItem:os,arrow:is},us="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAAXNSR0IArs4c6QAABQlJREFUaEPVml9MW1UYwL/vnpb+oYBBQJg4uZOFBRM1bC5TQ9TgiG7qA3FmaExc3Hww/nsyZA8+zGQuiz5pYuKfhMRtMGOMPizb3JYsYQ4yXubDFrfAgIJbRw0KLaW3vfd85rS9rNy2tL33UtKbNIH2nu87v/v9PedcBBuuIFHV0ny8jSpIBo0aUcJ6IPQCcXdCPEpRQIoQpyAwDGAMJzw1zhv1iCGr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fYwAGLiTVgeMMWAobrql2u6jW0c74+ctBbEdafTsHJMHUxbIyD5ZAtotQaRH1ob3brYhjdpRyATAyTQLZEunwrVEIeuopevvtdtYyPz/xbYRs9ZKnJtj8kAgRyuRskCdE4L7WrWh7XU2txJ2NHPn/mXyYIB1J/J8mr+L/xlBrKuBj74lr1EzZ0c7LQBO3s3shVorYfxAS/zyg+41bKftWNAML7ANP9xhr+gV2CfBfE+jdun52hItaOxYUn5zu+LpWxFobvfw8TcaS7ykFFYo60W9ACj7bRUBUdYbWwIgubUY7UPAkhxkFNu+iIOPVbcWhcCy3tzVn0hZb6/rEGV9wJEOUbZHTOnuVLaHfDpEWR+z6hBlfdCdnq/L9lUDY9Ep25c9slXPxOs2kXgbYYGv2xBOeLz2vG7zP6ScsSREZIhmAAAAAElFTkSuQmCC",Cs=Y({name:"hot-music-more",setup(){const v=P(),s=A({background:"transparent",loading:!1,finished:!1,searchPopup:!1,musics:[],types:[],subjectList:[],sMSCI:"",sMII:""}),n=A({page:1,rows:20,status:1,keyword:"",musicSheetCategoriesId:"",musicalInstrumentId:""}),d=async()=>{var t;s.loading=!0;try{const c=await x({...n});c.code===200&&Array.isArray((t=c==null?void 0:c.data)==null?void 0:t.rows)?(s.musics=[...s.musics,...c.data.rows],s.finished=!c.data.next,n.page=c.data.current+1):s.finished=!0}catch(c){}s.loading=!1},_=async()=>{var t;try{let c=((t=C.user.data)==null?void 0:t.subjectId)||"";c=c.split(",");const o=c[0]||"",p=await H.post("/edu-app/subject/list",{enableFlag:!0,delFlag:0,page:1,subjectId:o||"",rows:999});if(o){const i=p.data||[];let r=[];i.forEach(l=>{const m=l.instruments||[];Number(o)===l.id&&m.length>0&&m.forEach((g,j)=>{r.push({text:g.name,value:g.id,className:j===0?"selected":""})})}),r.length>0&&(s.subjectList=[{text:"全部",value:""},...r])}}catch(c){}},w=async()=>{var t,c;try{let o=((t=C.user.data)==null?void 0:t.subjectId)||"";o=o.split(",");const p=o[0]||"",i=await z({page:1,rows:999,subjectId:p});if(i.code===200&&Array.isArray((c=i==null?void 0:i.data)==null?void 0:c.rows)){const r=[];i.data.rows.forEach(l=>{r.push({value:l.id,text:l.name})}),s.types=r}}catch(o){console.log("🚀 ~ error:",o)}},y=t=>{let c=`${U()}/instrument?id=${t==null?void 0:t.id}&showGuide=true`;I({api:"openAccompanyWebView",content:{url:c,orientation:0,isHideTitle:!0,statusBarTextColor:!1,isOpenLight:!0,c_orientation:0}})},M=S(()=>s.subjectList.length>2||s.types.length>0);return E(async()=>{s.loading=!0,await _(),await w(),d()}),()=>e("div",{class:[a.hotMusicMore,h().isTablet?a.hotMusicMoreTablet:""]},[e(q,{position:"top"},{default:()=>[e(B,{border:!1,background:"transparent"},{content:()=>e("div",{class:a.woringHeader},[e("i",{onClick:()=>{h().isApp?I({api:"goBack"}):v.back()},class:["van-badge__wrapper van-icon van-icon-arrow-left van-nav-bar__arrow",a.leftArrow]},null),e("span",{class:a.title},[e("i",null,null)])])}),e(k,{background:"transparent",onSearch:t=>{n.keyword=t,n.page=1,s.musics=[],s.finished=!1,d()}},{left:()=>M.value&&e("div",{class:[a.searchContent,s.searchPopup&&a.active],onClick:()=>{s.sMSCI=n.musicSheetCategoriesId,s.sMII=n.musicalInstrumentId,s.searchPopup=!0}},[e("span",null,[u("筛选")]),e("i",null,null)])})]}),e(F,{loading:s.loading,finished:s.finished,finishedText:" ",onLoad:d,immediateCheck:!1},{default:()=>[s.musics.length>0&&e("div",{class:a.musicList},[s.musics.map(t=>e(T,{class:a.musicItem,border:!1,center:!0,onClick:()=>y(t)},{icon:()=>e(f,{class:a.musicImg,src:t.titleImg},null),title:()=>e("div",{class:a.musicContnet},[e("h2",null,[t.musicSheetName]),t.composer&&e("p",null,[t.composer])]),"right-icon":()=>e(f,{class:a.musicPlayIcon,src:us},null)}))])]}),!s.loading&&s.musics.length===0&&e("div",{class:a.emptyGroup},[e(L,{description:"暂无曲谱"},null)]),e(Q,{position:"bottom",round:!0,show:s.searchPopup,"onUpdate:show":t=>s.searchPopup=t},{default:()=>[e("div",{class:a.searchContainer},[e("div",{class:a.searchHead},[e("span",{class:a.cancel,onClick:()=>s.searchPopup=!1},[u("取消")]),e("span",null,[u("筛选")]),e("span",{class:a.confirm,onClick:()=>{n.musicSheetCategoriesId=s.sMSCI,n.musicalInstrumentId=s.sMII,s.searchPopup=!1,n.page=1,s.musics=[],s.finished=!1,d()}},[u("确定")])]),e("div",{class:a.changeSubjectContainer},[s.subjectList.length>2&&e(b,null,[e("div",{class:a.title},[u("乐器")]),e("div",{class:a.subjectContainer},[s.subjectList.map(t=>e("div",{class:[a.subjectItem,t.value===s.sMII&&a.active],onClick:()=>{s.sMII=t.value}},[t.text]))])]),s.types.length>0&&e(b,null,[e("div",{class:a.title},[u("曲谱教材")]),e("div",{class:[a.subjectContainer,a.subjectContainerTwo]},[e("div",{class:[a.subjectItem,s.sMSCI===""&&a.active],onClick:()=>{s.sMSCI=""}},[u("全部")]),s.types.map(t=>e("div",{class:[a.subjectItem,t.value===s.sMSCI&&a.active],onClick:()=>{s.sMSCI=t.value}},[t.text]))])])])])]})])}});export{Cs as default};