| 1 |
- import{d as I,S as r,g as E,P as M,O as N,bD as O,a2 as $,Q as k,j as s,M as y,z as H,R as x,aR as A,Z as K,W as P}from"./index.e6d6174e.js";import{T as V}from"./index.05f2b7dd.js";import"./index.9093bc60.js";import"./index.b4a53c6a.js";import{T as L,a as b}from"./index.54627972.js";import{E as z}from"./index.b6ce06cf.js";import{S as D}from"./index.c42f80e3.js";import{c as J}from"./index.684ca989.js";import{c as U}from"./index.926ca9c5.js";import{g as W}from"./music.413b82d2.js";import{S as B}from"./select-subject.c57b8518.js";import{a as u,S as h}from"./hooks.00b5b341.js";import{T as F}from"./index.275665ec.js";const Q="_search_hcihy_1",Z="_sticky_hcihy_9",q="_title_hcihy_15",G="_keywordTitle_hcihy_21",X="_t_hcihy_15",Y="_remove_hcihy_33",ee="_keywords_hcihy_36",se="_content_hcihy_42",te="_searchKeyword_hcihy_47",ae="_arrowMore_hcihy_58",oe="_label_hcihy_69",ce="_bgImg_hcihy_98",le="_tagTabs_hcihy_106",ne="_hotMusic_hcihy_129",re="_swipeItem_hcihy_132",ie="_swipeChild_hcihy_132",ue="_swipeTitle_hcihy_149",he="_swipeContent_hcihy_156",me="_swipe_hcihy_132",de="_num_hcihy_170",_e="_hot_hcihy_129",pe="_swipeTop_hcihy_192",fe="_searchResult_hcihy_198";var t={search:Q,sticky:Z,title:q,keywordTitle:G,t:X,remove:Y,keywords:ee,content:se,searchKeyword:te,arrowMore:ae,label:oe,bgImg:ce,tagTabs:le,hotMusic:ne,swipeItem:re,swipeChild:ie,swipeTitle:ue,swipeContent:he,swipe:me,num:de,hot:_e,swipeTop:pe,searchResult:fe},ye="./assets/bg-image-search.c44b4a0f.png";function be(m){return typeof m=="function"||Object.prototype.toString.call(m)==="[object Object]"&&!K(m)}const _=new z,we=r();var ge=I({name:"MusicSearchHeader",setup(){if(!u(h.SEARCH).id){const e=E.user.data,a=e.subjectId?Number(e.subjectId.split(",")[0]):"",o=e.subjectName?e.subjectName.split(",")[0]:"";a&&u(h.SEARCH,JSON.stringify({id:a,name:o}),"set")}localStorage.setItem("behaviorId",W()),M();const p=N(),T=r(!1),f=r(""),C=r(""),l=J("music-search",[]),i=r("all");O(()=>{var a,o;const e=u(h.SEARCH);if(c.name=e.name||"\u5168\u90E8\u58F0\u90E8",c.id=e.id,p.path==="/music-songbook/search"){f.value="",C.value="",i.value="all";try{(o=(a=we.value)==null?void 0:a.resetTags)==null||o.call(a)}catch(d){console.log(d)}}return!0}),$(i,e=>{_.emit("changeTab",e)});const w=e=>{f.value=e;const a=l.value.indexOf(e);a>-1&&l.value.splice(a,1),e&&(l.value.unshift(e),console.log(l.value.length,"words.value.length"),l.value.length=Math.min(l.value.length,10)),_.emit("search",e)},j=e=>{c.name=e.name,c.id=e.id,u(h.SEARCH,JSON.stringify({id:e.id,name:e.name}),"set"),_.emit("confirmSubject",c),c.show=!1},g=u(h.SEARCH),c=k({show:!1,name:g.name||"\u5168\u90E8\u58F0\u90E8",id:g.id||""}),v=r([]),n=k({line:0,arrowStatus:!1}),S=()=>{P(()=>{if(!l.value||!l.value.length)return;let e=-1;n.line=0,v.value.forEach((o,d)=>{try{o.$el.style.display="block",d===0?(n.line=1,e=o.$el.offsetLeft):o.$el.offsetLeft===e&&d!=0&&(n.line+=1),n.arrowStatus?o.$el.style.display="block":n.line>2?o.$el.style.display="none":o.$el.style.display="block"}catch(R){console.log(R,"Error")}})})};return S(),()=>s("div",{class:t.search},[s("div",{class:t.sticky},[s(F,{position:"top"},{default:()=>[s(D,{modelValue:f.value,background:"transparent",onSearch:e=>{w(e)},type:"tenant"},{left:()=>s("div",{class:t.label,onClick:()=>c.show=!0},[c.name,s(y,{classPrefix:"iconfont",name:"down",size:12,color:"#333"},null)])})]}),s("img",{class:t.bgImg,src:ye},null)]),l.value.length>0&&p.path==="/music-songbook/search"&&s("div",{class:t.keywordSection},[s("div",{class:t.keywordTitle},[s("span",{class:t.t},[H("\u641C\u7D22\u5386\u53F2")]),s(y,{class:t.remove,name:"delete-o",onClick:()=>l.value=[]},null)]),s("div",{class:U(t.keywords)},[s("div",{class:t.content},[l.value.map((e,a)=>s(V,{ref:o=>v.value[a]=o,round:!0,class:[t.searchKeyword,"van-ellipsis"],key:e,onClick:()=>w(e)},be(e)?e:{default:()=>[e]})),n.line>2&&s("span",{class:[t.arrowMore],onClick:()=>{n.arrowStatus=!n.arrowStatus,S()}},[s(y,{name:n.arrowStatus?"arrow-up":"arrow-down"},null)])])])]),p.path==="/music-songbook/search"&&s(L,{color:"var(--van-primary)",background:"transparent",lineWidth:20,shrink:!0,class:t.tagTabs,active:i.value,"onUpdate:active":e=>i.value=e,onChange:e=>i.value=e},{default:()=>[s(b,{title:"\u7EFC\u5408",name:"all"},null),s(b,{title:"\u5355\u66F2",name:"songe"},null),s(b,{title:"\u4E13\u8F91",name:"album"},null)]}),s(x,null,null),s(A,{show:c.show,position:"bottom",round:!0,closeable:!0,"safe-area-inset-bottom":!0,onClose:()=>c.show=!1,onClosed:()=>c.show=!1},{default:()=>[s(B,{searchParams:c,onComfirm:j},null)]}),s("div",{class:[t.searchResult],style:{display:T.value?"block":"none"}},null)])}}),He=Object.freeze(Object.defineProperty({__proto__:null,mitter:_,default:ge},Symbol.toStringTag,{value:"Module"}));export{He as h,_ as m,t as s};
|