index.316dcbfb.js 2.1 KB

1
  1. import{c as x}from"./index.bf78eddb.js";import g from"./index.6a15b873.js";import y from"./index.f9c3a0fb.js";import{m as o,s as S}from"./header.87694125.js";import{d as R,V as a,_ as L,ao as w,am as C,an as M,a as f}from"./vendor.75c233d7.js";import{g as T,m as k}from"./music.74f8382c.js";/* empty css *//* empty css */import"./index.a19b3ee8.js";/* empty css *//* empty css */import"./index.99ecdf56.js";import"./item.197ec189.js";/* empty css */import"./footer.5fdb8ada.js";import"./favorite.37fa42aa.js";import"./select-tag.2b7a1fa8.js";/* empty css *//* empty css *//* empty css */import"./index.926ca9c5.js";import"./item.aef92d4e.js";import"./init-user-icon.9c46bc7a.js";import"./index.6d770ae1.js";/* empty css */import"./browser.ebb85846.js";import"./icon_teacher.40b6f077.js";import"./index.module.a12d3897.js";import"./orderStatus.abddf121.js";import"./index.339fc024.js";/* empty css */var ne=R({name:"MusicSearch",emits:["confirm"],setup(){a(),localStorage.setItem("behaviorId",T());const l=L();w(),a(!1);const m=a(l.query.keyword||""),c=a(l.query.tagids||"");a([]),a([]);const v=a(!1),s=x("music-search",[]),r=a("songe"),p=e=>{var i,t;m.value=e;const n=s.value.indexOf(e);n>-1&&s.value.splice(n,1),e&&(s.value.unshift(e),s.value.length=Math.min(s.value.length,5));const h=r.value==="album"?d:u;console.log(e),(t=(i=h.value).onSearch)==null||t.call(i,e)},j=e=>{var i,t;const n=Object.values(e).flat().filter(Boolean).join(",");c.value=n,(t=(i=(r.value==="album"?d:u).value).onComfirm)==null||t.call(i,e),v.value=!1},d=a(null),u=a(null),b=e=>{r.value=e};return C(()=>{o.on("changeTab",b),o.on("search",p),o.on("confirm",j)}),M(()=>{o.off("changeTab",b),o.off("search",p),o.off("confirm",j)}),()=>f("div",{class:S.search},[r.value==="album"?f(g,{hideSearch:!0,ref:d,defauleParams:{search:m.value,tagids:c.value}},null):f(y,{hideSearch:!0,ref:u,onItemClick:e=>{k(e)},defauleParams:{search:m.value,tagids:c.value}},null)])}});export{ne as default};