1 |
- import{d as _,bc as k,W as a,a4 as S,i as t,ak as g,L as w,ab as C}from"./index.9a8e7555.js";import{S as x}from"./index.e9655eaa.js";import{T}from"./index.eefac611.js";import"./index.77775083.js";import{T as R,a as y}from"./index.737b20db.js";import{C as L}from"./index.c7f6a96c.js";import{c as j}from"./index.e57ccea0.js";import M from"./index.ea80c8ce.js";import O from"./index.745fa3cb.js";import{c as K}from"./index.926ca9c5.js";import{S as V}from"./select-tag.e6f4be6d.js";import{m as I}from"./music.5c2aaffd.js";import"./use-id.62bab9ae.js";import"./use-tab-status.41627c38.js";import"./use-refs.167314c3.js";import"./index.3b6c3426.js";import"./index.cb5d8493.js";import"./index.87809eea.js";import"./item.b5cd73d5.js";import"./index.7f9087a9.js";import"./footer.3523936a.js";import"./favorite.9bdf4305.js";import"./index.17575d3a.js";import"./index.df465582.js";import"./index.4abed682.js";import"./init-user-icon.d5c3c464.js";import"./orderStatus.e7cb2458.js";/* empty css *//* empty css */const N="_search_1ihx9_1",P="_sticky_1ihx9_9",U="_title_1ihx9_15",A="_keywords_1ihx9_21",B="_content_1ihx9_28",W="_searchKeyword_1ihx9_34",q="_remove_1ihx9_41";var i={search:N,sticky:P,title:U,keywords:A,content:B,searchKeyword:W,remove:q};function D(l){return typeof l=="function"||Object.prototype.toString.call(l)==="[object Object]"&&!g(l)}var be=_({name:"MusicSearch",setup(){const l=k();a(!1);const u=a(""),m=a("");a([]),a([]);const v=a(!1),r=j("music-search",[]),s=a("album"),h=e=>{var n,c;u.value=e;const o=r.value.indexOf(e);o>-1&&r.value.splice(o,1),e&&(r.value.unshift(e),r.value.length=Math.min(r.value.length,5)),(c=(n=(s.value==="album"?p:f).value).onSearch)==null||c.call(n,e)},b=e=>{var n,c;const o=Object.values(e).flat().filter(Boolean).join(",");m.value=o,(c=(n=(s.value==="album"?p:f).value).onComfirm)==null||c.call(n,e),v.value=!1},p=a(null),f=a(null);return S(()=>{var o,d;(d=(o=(s.value==="album"?p:f).value).onSearch)==null||d.call(o,"")}),()=>t("div",{class:i.search},[t(x,{class:i.sticky},{default:()=>[t(L,{modelValue:u.value,showAction:!0,autofocus:!0,onSearch:h,onFilter:()=>v.value=!0,filterDot:!!m.value},null),t(R,{color:"var(--van-primary)",background:"transparent",lineWidth:20,shrink:!0,active:s.value,"onUpdate:active":e=>s.value=e,onChange:e=>s.value=e},{default:()=>[t(y,{title:"\u4E13\u8F91",name:"album"},null),t(y,{title:"\u5355\u66F2",name:"songe"},null)]})]}),r.value.length>0&&t("div",{class:K(i.keywords,"van-hairline--bottom")},[t("div",{class:i.content},[r.value.map(e=>t(T,{round:!0,class:i.searchKeyword,key:e,onClick:()=>h(e)},D(e)?e:{default:()=>[e]}))]),t(w,{class:i.remove,name:"delete-o",onClick:()=>r.value=[]},null)]),s.value==="album"?t(M,{hideSearch:!0,ref:p,defauleParams:{search:u.value,tagids:m.value}},null):t(O,{hideSearch:!0,ref:f,onItemClick:e=>{I(e,o=>{l.push({path:o,query:{orderType:"MUSIC"}})})},defauleParams:{search:u.value,tagids:m.value}},null),t(C,{show:v.value,round:!0,closeable:!0,position:"bottom",style:{height:"60%"},teleport:"body","onUpdate:show":e=>v.value=e},{default:()=>[t(V,{onComfirm:b,onCancel:()=>{}},null)]})])}});export{be as default};
|