index.3b82acc0.js 2.6 KB

1
  1. import{c as y}from"./index.46520b6f.js";import C from"./index.32c5a307.js";import T from"./index.b225e885.js";import{m as o,s as x}from"./header.4c2361e3.js";import{d as L,P as M,Q as k,U as a,V as q,bC as w,i as v}from"./index.6b776f4b.js";import{g as O}from"./music.35746cdc.js";import{a as P,S as V}from"./hooks.ad006126.js";import"./index.998c3386.js";import"./index.9b1da5d2.js";import"./use-tab-status.ad41a764.js";import"./index.570314c1.js";import"./index.21339447.js";import"./use-id.40b6af6b.js";import"./use-refs.a68d4385.js";import"./index.1c64afe2.js";import"./index.7486196c.js";import"./index.ef17e812.js";import"./select-subject.8730d66c.js";import"./index.beb9a25a.js";import"./index.d9a76507.js";import"./index.db6936ba.js";import"./index.7cc0b0e7.js";import"./icon-xin.df8ab2d7.js";import"./select-tag.12a89705.js";import"./index.7b4b6592.js";import"./index.bebc33d1.js";import"./index.926ca9c5.js";import"./index.6b2308b1.js";import"./index.module.7b815a85.js";import"./index.7d6320b9.js";import"./icon_uploader.9f387137.js";import"./icon_album.fa329df6.js";import"./icon_album_active.ce98b2a8.js";import"./icon_exquisite.69e33c80.js";import"./icon_music_active.3b316ab8.js";import"./icon-play.bc9e7aab.js";import"./index.33f0ddb9.js";import"./index.f0306d29.js";import"./use-height.c83159bc.js";import"./index.c3591af3.js";var Re=L({name:"MusicSearch",emits:["confirm"],setup(){localStorage.setItem("behaviorId",O());const f=M(),j=k(),d=a(f.query.keyword||""),i=a(f.query.tagids||""),c=a(),R=a(!1),r=y("music-search",[]),m=a("songe"),I=P(V.SEARCH);c.value=I.id;const b=e=>{var t,u;d.value=e;const s=r.value.indexOf(e);s>-1&&r.value.splice(s,1),e&&(r.value.unshift(e),r.value.length=Math.min(r.value.length,5)),(u=(t=(m.value==="album"?n:l).value).onSearch)==null||u.call(t,e)},h=e=>{var t,u;const s=Object.values(e).flat().filter(Boolean).join(",");i.value=s,(u=(t=(m.value==="album"?n:l).value).onComfirm)==null||u.call(t,e),R.value=!1},g=e=>{var p,t;c.value=e.id,(t=(p=(m.value==="album"?n:l).value).onComfirmSubject)==null||t.call(p,e)},n=a(null),l=a(null),S=e=>{m.value=e};return q(()=>{o.on("changeTab",S),o.on("search",b),o.on("confirm",h),o.on("confirmSubject",g)}),w(()=>{o.off("changeTab",S),o.off("search",b),o.off("confirm",h),o.off("confirmSubject",g)}),()=>v("div",{class:x.search},[m.value==="album"?v(C,{hideSearch:!0,ref:n,defauleParams:{search:d.value,tagids:i.value,albumTagIds:i.value,subjectIds:c.value}},null):v(T,{hideSearch:!0,ref:l,onItemClick:e=>{j.push({path:"/music-detail",query:{id:e.id,albumId:f.params.id}})},defauleParams:{search:d.value,tagids:i.value,musicTagIds:i.value,subjectIds:c.value}},null)])}});export{Re as default};