1 |
- import{c as R}from"./index.3db72433.js";import y from"./index.937bab07.js";import I from"./index.cd6cc18b.js";import{m as o,s as C}from"./header.ceee9546.js";import{d as T,u as k,k as w,l as t,m as L,aB as M,a as j}from"./vendor.0f683fb2.js";import{g as B,m as O}from"./music.cdfcdec2.js";import{u as q,S as A}from"./hooks.cbace03b.js";/* empty css *//* empty css */import"./index.30f2de60.js";/* empty css *//* empty css */import"./index.7abc2ed3.js";import"./item.75f93e95.js";/* empty css */import"./favorite.cb69f4f9.js";import"./select-tag.7a8c72d9.js";/* empty css *//* empty css *//* empty css */import"./index.926ca9c5.js";import"./select-subject.93f4e3d7.js";import"./item.1fc76922.js";import"./music-icon.c20abf48.js";import"./init-user-icon.6387573f.js";import"./index.0ed4851c.js";/* empty css */import"./code-down-load.5428854d.js";import"./logo.bcac726b.js";import"./browser.ebb85846.js";import"./icon_teacher.cb128c00.js";import"./index.module.da27480e.js";import"./orderStatus.601c0766.js";import"./index.339fc024.js";/* empty css */var pe=T({name:"MusicSearch",emits:["confirm"],setup(){localStorage.setItem("behaviorId",B());const b=k();w();const f=t(b.query.keyword||""),i=t(b.query.tagids||""),m=t(),g=t(!1),a=R("music-search",[]),c=t("songe"),S=q(A.SEARCH);m.value=S.id;const p=e=>{var s,n;f.value=e;const r=a.value.indexOf(e);r>-1&&a.value.splice(r,1),e&&(a.value.unshift(e),a.value.length=Math.min(a.value.length,5)),(n=(s=(c.value==="album"?u:d).value).onSearch)==null||n.call(s,e)},v=e=>{var s,n;const r=Object.values(e).flat().filter(Boolean).join(",");i.value=r,(n=(s=(c.value==="album"?u:d).value).onComfirm)==null||n.call(s,e),g.value=!1},h=e=>{var l,s;m.value=e.id,(s=(l=(c.value==="album"?u:d).value).onComfirmSubject)==null||s.call(l,e)},u=t(null),d=t(null),x=e=>{c.value=e};return L(()=>{o.on("changeTab",x),o.on("search",p),o.on("confirm",v),o.on("confirmSubject",h)}),M(()=>{o.off("changeTab",x),o.off("search",p),o.off("confirm",v),o.off("confirmSubject",h)}),()=>j("div",{class:C.search},[c.value==="album"?j(y,{hideSearch:!0,ref:u,defauleParams:{search:f.value,tagids:i.value,albumTagIds:i.value,subjectIds:m.value}},null):j(I,{hideSearch:!0,ref:d,onItemClick:e=>{O(e)},defauleParams:{search:f.value,tagids:i.value,musicTagIds:i.value,subjectIds:m.value}},null)])}});export{pe as default};
|