index.88d87a67.js 1.1 KB

1
  1. import{d as l,ah as d,ag as p,r as g,Z as m,$ as u,c as e,aj as h,L as y,m as v,g as f}from"./index.1c621181.js";import{s as c,g as b}from"./index.module.c5e86b95.js";import{I as x}from"./index.4c221cbe.js";var L=l({name:"accompany",setup(I,A){const s=d(),n=p(),t=g({childPath:"",svgs:[],musicTreeActive:""}),i=async()=>{try{const a=await v.get(f.platformApi+"/musicSheetCategories/queryTree?enable=true");Array.isArray(a==null?void 0:a.data)&&(t.svgs=a.data.map((o,C)=>({...o,id:o.id,icon:o.coverImg,btnIcon:b("b2.svg"),color:"#9881FF",title:o.name,subtitle:"",btnText:"GO >"})),console.log("\u{1F680} ~ data.svgs",t.svgs))}catch(a){console.log(a)}r()},r=()=>{const a=(s==null?void 0:s.path)||"accompany";t.childPath=a.replace(/\//g,"")||"accompany",console.log("\u{1F680} ~ route.path",t.childPath)};return m(()=>s.path,()=>{r()}),u(()=>{i()}),()=>e("div",{class:c.accompany},[e(h,null,null),e("div",{class:c.accompanyCategory},[t.svgs.map(a=>e("div",{class:c.container,onClick:()=>{n.push({path:"/musicList",query:{categorieid:a.id}})}},[e(x,{src:a.icon,width:"100%",height:"100%"},{loading:()=>e(y,{type:"spinner",size:"20"},null)})]))])])}});export{L as default};