1 |
- import{d as B,S as d,f as N,n as C,g as J,P as W,O as V,bD as K,a2 as P,Q as R,U as L,j as s,M as y,z as E,R as O,aR as z,C as F,Z as Y,W as D,w as G}from"./index.cf487d9e.js";import{T as Z}from"./index.f3f705ee.js";import"./index.801123b8.js";import"./index.c6b3d658.js";import{T as j,a as b}from"./index.e0acffb1.js";import{E as Q}from"./index.b6ce06cf.js";import{S as X}from"./index.d4b11cb0.js";import{c as $,e as ee}from"./index.dffaafe3.js";import{c as se}from"./index.926ca9c5.js";import{g as ae}from"./music.070d0add.js";import{S as te}from"./select-subject.38c2fc8b.js";import{a as v,S as w}from"./hooks.d9eb54a1.js";import{T as oe}from"./index.0656d807.js";import{C as ne}from"./index.36fcf68d.js";const le="_search_1hixq_1",ce="_sticky_1hixq_10",re="_searchCancel_1hixq_16",ie="_title_1hixq_27",ue="_keywordTitle_1hixq_33",he="_t_1hixq_27",pe="_remove_1hixq_46",me="_keywords_1hixq_49",de="_content_1hixq_55",fe="_searchKeyword_1hixq_60",ge="_arrowMore_1hixq_71",be="_label_1hixq_82",_e="_bgImg_1hixq_111",ve="_tagTabs_1hixq_119",we="_hotMusic_1hixq_142",Ae="_swipeItem_1hixq_145",Se="_swipeChild_1hixq_145",ke="_swipeTitle_1hixq_162",ye="_swipeContent_1hixq_169",Ce="_swipe_1hixq_145",Te="_num_1hixq_183",xe="_hot_1hixq_142",Ie="_swipeTop_1hixq_205",qe="_searchResult_1hixq_211",Re="_searchGroups_1hixq_223",Ee="_searchItem_1hixq_232",je="_rName_1hixq_237",Ne="_iconSearch_1hixq_246";var a={search:le,sticky:ce,searchCancel:re,title:ie,keywordTitle:ue,t:he,remove:pe,keywords:me,content:de,searchKeyword:fe,arrowMore:ge,label:be,bgImg:_e,tagTabs:ve,hotMusic:we,swipeItem:Ae,swipeChild:Se,swipeTitle:ke,swipeContent:ye,swipe:Ce,num:Te,hot:xe,swipeTop:Ie,searchResult:qe,searchGroups:Re,searchItem:Ee,rName:je,iconSearch:Ne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ajTJzw3tgUgAbHn0CBAVywIolnV6ynbNgDTJzNTd2Ckk4BLBtDRKhT/tgKslU9/AG4VwDAHjWgLAAAAAElFTkSuQmCC";function He(p){return typeof p=="function"||Object.prototype.toString.call(p)==="[object Object]"&&!Y(p)}const A=new Q,Be=d(),T=(p,m)=>{N().isApp?C({api:"openWebView",content:{url:p,orientation:1,isHideTitle:!1}}):m&&m()};var Je=B({name:"MusicSearchHeader",setup(){const p=v(w.SEARCH);if(!p.id){const e=J.user.data,c=e.subjectId?Number(e.subjectId.split(",")[0]):"",t=e.subjectName?e.subjectName.split(",")[0]:"";c&&v(w.SEARCH,JSON.stringify({id:c,name:t}),"set")}localStorage.setItem("behaviorId",ae());const m=W(),n=V(),f=d(!1),l=d(""),S=d(""),r=$("music-search",[]),i=d("all");n.path==="/music-songbook/result"&&(l.value=n.query.search,S.value="",i.value="all"),K((e,c)=>{var u,g;const t=v(w.SEARCH);if(o.name=t.name||"\u5168\u90E8\u58F0\u90E8",o.id=t.id,n.path==="/music-songbook/search"){l.value="",S.value="",i.value="all";try{(g=(u=Be.value)==null?void 0:u.resetTags)==null||g.call(u)}catch(H){console.log(H)}}return e.path==="/music-songbook/result"&&(l.value=e.query.search,console.log(l.value,"value",n.query),S.value="",i.value="all"),!0}),P(i,e=>{A.emit("changeTab",e,l.value)});const _=d([]),U=ee(async e=>{try{const{data:c}=await G.post("/api-student/music/sheet/search",{hideLoading:!0,data:{subjectId:p.id,name:e,rows:10}}),t=c.musicNames||[];t.forEach((u,g)=>{g<10&&(u.name=u.name.replace(e,`<span>${e}</span>`))}),_.value=t,f.value=!!l.value}catch{}},300),x=e=>{console.log("object :>> ",e),l.value=e;const c=r.value.indexOf(e);c>-1&&r.value.splice(c,1),e&&(r.value.unshift(e),r.value.length=Math.min(r.value.length,10),n.path==="/music-songbook/search"&&k()),n.path!=="/music-songbook/result"?(m.replace({path:"/music-songbook/result",query:{search:e}}),f.value=!1,_.value=[]):(f.value=!1,A.emit("search",e))},M=e=>{o.name=e.name,o.id=e.id,v(w.SEARCH,JSON.stringify({id:e.id,name:e.name}),"set"),o.show=!1,A.emit("confirmSubject",o)},I=v(w.SEARCH),o=R({show:!1,name:I.name||"\u5168\u90E8\u58F0\u90E8",id:I.id||""}),q=d([]),h=R({line:0,arrowStatus:!1}),k=()=>{D(()=>{if(!r.value||!r.value.length)return;let e=-1;h.line=0,q.value.forEach((t,u)=>{try{t.$el.style.display="block",u===0?(h.line=1,e=t.$el.offsetLeft):t.$el.offsetLeft===e&&u!=0&&(h.line+=1),h.arrowStatus?t.$el.style.display="block":h.line>2?t.$el.style.display="none":t.$el.style.display="block"}catch(g){console.log(g,"Error")}})})};return n.path==="/music-songbook/search"&&k(),L(()=>{C({api:"backIconChange",content:{backIconHide:!0}})}),()=>s("div",{class:a.search},[s("div",{class:a.sticky},[s(oe,{position:"top"},{default:()=>[s(ne,{isFixed:!1,background:"transparent",title:" "},null),s(X,{modelValue:l.value,background:"transparent",showAction:!0,onInput:e=>{l.value=e,e?U(e):(_.value=[],f.value=!1,n.path==="/music-songbook/result"&&m.replace("/music-songbook/search"))},onSearch:e=>{!e||(l.value=e,console.log(e,"val"),x(e))},type:"tenant"},{left:()=>s("div",{class:a.label,onClick:()=>o.show=!0},[o.name,s(y,{classPrefix:"iconfont",name:"down",size:12,color:"#333"},null)]),action:()=>s("span",{class:a.searchCancel,onClick:()=>{N().isApp?C({api:"back"}):m.back()}},[E("\u53D6\u6D88")])}),n.path==="/music-songbook/result"&&!f.value&&s(j,{color:"var(--van-primary)",background:"transparent",lineWidth:20,shrink:!0,class:a.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("img",{class:a.bgImg,src:Ue},null)]),r.value.length>0&&n.path==="/music-songbook/search"&&s("div",{class:a.keywordSection},[s("div",{class:a.keywordTitle},[s("span",{class:a.t},[E("\u641C\u7D22\u5386\u53F2")]),s(y,{class:a.remove,name:"delete-o",onClick:()=>r.value=[]},null)]),s("div",{class:se(a.keywords)},[s("div",{class:a.content},[r.value.map((e,c)=>s(Z,{ref:t=>q.value[c]=t,round:!0,class:[a.searchKeyword,"van-ellipsis"],key:e,onClick:()=>{l.value=e,x(e)}},He(e)?e:{default:()=>[e]})),h.line>2&&s("span",{class:[a.arrowMore],onClick:()=>{h.arrowStatus=!h.arrowStatus,k()}},[s(y,{name:h.arrowStatus?"arrow-up":"arrow-down"},null)])])])]),n.path==="/music-songbook/search"&&s(j,{color:"var(--van-primary)",background:"transparent",lineWidth:20,shrink:!0,class:a.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(O,null,null),s(z,{show:o.show,position:"bottom",round:!0,closeable:!0,"safe-area-inset-bottom":!0,onClose:()=>o.show=!1,onClosed:()=>o.show=!1},{default:()=>[s(te,{searchParams:o,onComfirm:M},null)]}),s("div",{class:[a.searchResult],style:{display:f.value?"block":"none"}},[s("div",{class:a.searchGroups},[_.value.map(e=>s("div",{class:a.searchItem,onClick:()=>{e.type==="ALBUM"?T(`${location.origin}/tenant/#/music-album-detail/${e.id}`,()=>{m.push({path:"/music-album-detail/"+e.id})}):T(`${location.origin}/tenant/#/music-detail?id=${e.id}`,()=>{m.push({path:"/music-detail",query:{id:e.id}})})}},[s("img",{src:Me,class:a.iconSearch},null),s("span",{class:a.rName,innerHTML:e.name},null)])),_.value.length<=0&&s(F,{tips:"\u6682\u65E0\u641C\u7D22\u7ED3\u679C",btnStatus:!1},null)])])])}}),$e=Object.freeze(Object.defineProperty({__proto__:null,mitter:A,openWebViewOrWeb:T,default:Je},Symbol.toStringTag,{value:"Module"}));export{$e as h,A as m,T as o,a as s};
|