1 |
- import{d as I,O as R,P as L,Q as M,U as C,j as i,w as P,S as r,bC as O}from"./index.e6d6174e.js";import{c as q}from"./index.684ca989.js";import x from"./index.25360818.js";import A from"./index.edde6e2e.js";import{m as s,s as k}from"./header.1ba9cf4a.js";import{g as G}from"./music.413b82d2.js";import{a as E,S as U}from"./hooks.00b5b341.js";import{M as V}from"./index.94d44218.js";import"./index.f904775d.js";import"./use-tab-status.e9ba8498.js";import"./index.9093bc60.js";import"./index.b4a53c6a.js";import"./index.54627972.js";import"./use-id.f239f36f.js";import"./use-refs.eb803454.js";import"./index.67c54471.js";import"./index.c42f80e3.js";import"./index.af99cf22.js";import"./index.17d70acf.js";import"./select-subject.f61520d8.js";import"./index.05f2b7dd.js";import"./index.045f03fd.js";import"./index.d8c651bf.js";import"./use-height.8140ea04.js";import"./index.275665ec.js";import"./bg-image.e9966434.js";import"./index.c3601b28.js";import"./icon-xin.18c43f84.js";import"./index.3d7e5752.js";import"./index.d92a5aca.js";import"./index.926ca9c5.js";import"./index.c67b3500.js";import"./index.e8449f92.js";import"./mitt.550594b0.js";var h={},B=I({name:"MusicSearch",props:{defauleParams:{type:Object,default:()=>({})}},emits:["confirm"],setup(m){R();const b=L(),f=M({albumList:[]}),u=async()=>{try{const{data:a}=await P.post("/api-student/music/album/list",{data:{...m.defauleParams,page:1,rows:3}});console.log(a),f.albumList=a.rows||[]}catch{}};return C(()=>{u()}),()=>i("div",{class:h.allSearch},[i("div",{class:h.albumSection},[i("div",{class:h.musicGrid},[i(V,{list:f.albumList,onGoto:a=>{b.push({name:"music-album-detail",params:{id:a.id}})}},null)])])])}}),je=I({name:"MusicSearch",emits:["confirm"],setup(){localStorage.setItem("behaviorId",G());const m=R(),b=L(),f=r(m.query.keyword||""),u=r(m.query.tagids||""),a=r(),T=r(!1),l=q("music-search",[]),t=r("all"),w=E(U.SEARCH);a.value=w.id;const g=e=>{var o,n;f.value=e;const c=l.value.indexOf(e);c>-1&&l.value.splice(c,1),e&&(l.value.unshift(e),l.value.length=Math.min(l.value.length,5)),(n=(o=(t.value==="album"?d:p).value).onSearch)==null||n.call(o,e)},S=e=>{var o,n;const c=Object.values(e).flat().filter(Boolean).join(",");u.value=c,(n=(o=(t.value==="album"?d:p).value).onComfirm)==null||n.call(o,e),T.value=!1},j=e=>{var v,o;a.value=e.id,(o=(v=(t.value==="album"?d:p).value).onComfirmSubject)==null||o.call(v,e)},d=r(null),p=r(null),y=e=>{console.log(e,"val"),t.value=e};return C(()=>{s.on("changeTab",y),s.on("search",g),s.on("confirm",S),s.on("confirmSubject",j),console.log(t.value,"activeTab.value")}),O(()=>{s.off("changeTab",y),s.off("search",g),s.off("confirm",S),s.off("confirmSubject",j)}),()=>i("div",{class:k.search},[t.value==="all"&&i(B,{defauleParams:{albumTagIds:u.value,subjectIds:a.value}},null),t.value==="album"&&i(x,{hideSearch:!0,ref:d,defauleParams:{albumTagIds:u.value,subjectIds:a.value}},null),t.value==="songe"&&i(A,{hideSearch:!0,ref:p,onItemClick:e=>{b.push({path:"/music-detail",query:{id:e.id,albumId:m.params.id}})},defauleParams:{musicTagIds:u.value,subjectIds:a.value}},null)])}});export{je as default};
|