| 1 |
- import{d as j,W as a,a6 as b,a as t,S as y,G as _,H as p,x as S,y as g,I as k,P as w}from"./vendor.0bc08753.js";/* empty css *//* empty css *//* empty css *//* empty css */import{S as C}from"./index.e2c9347f.js";import{c as R}from"./index.d447088f.js";import L from"./index.8b2eac7e.js";import O from"./index.8e659520.js";import{c as T}from"./index.926ca9c5.js";import{S as K}from"./select-tag.82c21162.js";/* empty css *//* empty css *//* empty css */import"./index.09583375.js";import"./item.3dc7fa1c.js";/* empty css */import"./footer.7cade25c.js";import"./favorite.9bdf4305.js";import"./index.54a6dc8c.js";/* empty css *//* empty css */import"./item.97d157c8.js";const M="_search_1ihx9_1",P="_sticky_1ihx9_9",V="_title_1ihx9_15",N="_keywords_1ihx9_21",A="_content_1ihx9_28",I="_searchKeyword_1ihx9_34",U="_remove_1ihx9_41";var r={search:M,sticky:P,title:V,keywords:N,content:A,searchKeyword:I,remove:U};function W(o){return typeof o=="function"||Object.prototype.toString.call(o)==="[object Object]"&&!g(o)}var le=j({name:"MusicSearch",setup(){a(!1);const o=a(""),u=a("");a([]),a([]);const d=a(!1),s=R("music-search",[]),i=a("album"),h=e=>{var c,l;o.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)),(l=(c=(i.value==="album"?m:v).value).onSearch)==null||l.call(c,e)},x=e=>{var c,l;const n=Object.values(e).flat().filter(Boolean).join(",");u.value=n,(l=(c=(i.value==="album"?m:v).value).onComfirm)==null||l.call(c,e),d.value=!1},m=a(null),v=a(null);return b(()=>{var n,f;(f=(n=(i.value==="album"?m:v).value).onSearch)==null||f.call(n,"")}),()=>t("div",{class:r.search},[t(y,{class:r.sticky},{default:()=>[t(C,{modelValue:o.value,showAction:!0,autofocus:!0,onSearch:h,onFilter:()=>d.value=!0,filterDot:!!u.value},null),t(_,{color:"var(--van-primary)",background:"transparent",lineWidth:20,shrink:!0,active:i.value,"onUpdate:active":e=>i.value=e,onChange:e=>i.value=e},{default:()=>[t(p,{title:"\u4E13\u8F91",name:"album"},null),t(p,{title:"\u5355\u66F2",name:"songe"},null)]})]}),s.value.length>0&&t("div",{class:T(r.keywords,"van-hairline--bottom")},[t("div",{class:r.content},[s.value.map(e=>t(S,{round:!0,class:r.searchKeyword,key:e,onClick:()=>h(e)},W(e)?e:{default:()=>[e]}))]),t(k,{class:r.remove,name:"delete-o",onClick:()=>s.value=[]},null)]),i.value==="album"?t(L,{hideSearch:!0,ref:m,defauleParams:{search:o.value,tagids:u.value}},null):t(O,{hideSearch:!0,ref:v,defauleParams:{search:o.value,tagids:u.value}},null),t(w,{show:d.value,round:!0,closeable:!0,position:"bottom",style:{height:"60%"},teleport:"body","onUpdate:show":e=>d.value=e},{default:()=>[t(K,{onComfirm:x,onCancel:()=>{}},null)]})])}});export{le as default};
|