search-result-legacy.0b3207ef.js 6.4 KB

1
  1. !function(){function e(e,n){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);n&&(c=c.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),a.push.apply(a,c)}return a}function n(n){for(var c=1;c<arguments.length;c++){var t=null!=arguments[c]?arguments[c]:{};c%2?e(Object(t),!0).forEach((function(e){a(n,e,t[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):e(Object(t)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(t,e))}))}return n}function a(e,n,a){return n in e?Object.defineProperty(e,n,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[n]=a,e}function c(e,n,a,c,t,i,u){try{var l=e[i](u),s=l.value}catch(o){return void a(o)}l.done?n(s):Promise.resolve(s).then(c,t)}System.register(["./ResizeObserver.es-legacy.8d60aee1.js","./index-legacy.bbc2b10e.js","./index-legacy.012a1d7c.js","./header-legacy.f5429bda.js","./music-legacy.f8020082.js","./hooks-legacy.f81762aa.js","./all-search.module-legacy.af0cb82c.js","./index-legacy.26bfaa3e.js","./index-legacy.044698fd.js","./index-legacy.c07bb851.js","./use-tab-status-legacy.1f35f332.js","./index-legacy.6a5df59c.js","./index-legacy.7e047c4c.js","./index-legacy.183eabe8.js","./use-id-legacy.54528695.js","./use-refs-legacy.82f31dee.js","./index-legacy.4a75d877.js","./index-legacy.c1f587d0.js","./index-legacy.610f0a70.js","./index-legacy.897f3849.js","./index-legacy.78ce4f6b.js","./select-subject-legacy.d1d95eac.js","./index-legacy.a85d660d.js","./index-legacy.87bcd48f.js","./index-legacy.4f8bc5f4.js","./bg-image-legacy.44e2b3db.js","./index-legacy.b6bb491f.js","./icon-xin2-legacy.d521c9ab.js","./index-legacy.571708b1.js","./index-legacy.6e10cd37.js","./index-legacy.5e551733.js","./index-legacy.4e5c868b.js","./index-legacy.af745e4d.js","./index-legacy.34b0986d.js"],(function(e){"use strict";var a,t,i,u,l,s,o,r,f,d,m,b,v,g,h,j,y,p,x,P,S,O,w;return{setters:[function(e){a=e.d,t=e.P,i=e.Q,u=e.S,l=e.U,s=e.V,o=e.bi,r=e.j,f=e.A,d=e.N,m=e.C,b=e.y},function(e){v=e.d},function(e){g=e.default},function(e){h=e.m,j=e.o,y=e.s},function(e){p=e.g},function(e){x=e.a,P=e.S},function(e){S=e.s},function(e){O=e.M},function(e){w=e.default},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){}],execute:function(){var T=a({name:"MusicSearch",props:{defauleParams:{type:Object,default:function(){return{}}}},emits:["confirm"],setup:function(e){t();var a=i(),v=u({albumList:[],loading:!1,defauleParams:e.defauleParams}),g=function(){var e,a=(e=regeneratorRuntime.mark((function e(){var a,c;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return v.loading=!0,e.prev=1,e.next=4,b.post("/api-student/music/album/list",{data:n(n({},v.defauleParams),{},{page:1,rows:3})});case 4:a=e.sent,c=a.data,v.albumList=c.rows||[],e.next=11;break;case 9:e.prev=9,e.t0=e.catch(1);case 11:v.loading=!1;case 12:case"end":return e.stop()}}),e,null,[[1,9]])})),function(){var n=this,a=arguments;return new Promise((function(t,i){var u=e.apply(n,a);function l(e){c(u,t,i,l,s,"next",e)}function s(e){c(u,t,i,l,s,"throw",e)}l(void 0)}))});return function(){return a.apply(this,arguments)}}(),y=l(null),p=function(e){var n,a;v.defauleParams.idAndName=e,g(),null===(n=(a=y.value).onSearch)||void 0===n||n.call(a,e)};return s((function(){g(),h.on("search",p)})),o((function(){h.off("search",p)})),function(){return r("div",{class:S.allSearch},[v.albumList.length>0&&r("div",{class:[S.albumSection,S.searchAllTitle]},[r("div",{class:S.albumTitle},[r("span",null,[f("专辑")]),r("span",{class:S.more,onClick:function(){j("".concat(location.origin,"/tenant/#/music-album"),(function(){a.push({path:"/music-album"})}))}},[f("更多 "),r(d,{name:"arrow"},null)])]),r("div",{class:S.musicGrid},[r(O,{showLight:!0,lightText:v.defauleParams.idAndName,list:v.albumList,onGoto:function(e){j("".concat(location.origin,"/tenant/#/music-album-detail/").concat(e.id),(function(){a.push({name:"music-album-detail",params:{id:e.id}})}))}},null),v.albumList.length<=0&&!v.loading&&r(m,{tips:"暂无专辑",btnStatus:!1,classImgSize:"SMALL"},null)])]),r("div",{class:[S.albumSection,S.searchAllTitle,S.musicGroup]},[r("div",{class:S.albumTitle},[f("单曲")]),r(w,{hideSearch:!0,ref:y,onItemClick:function(e){j("".concat(location.origin,"/tenant/#/music-detail?id=").concat(e.id),(function(){a.push({path:"/music-detail",query:{id:e.id}})}))},showLight:!0,lightText:v.defauleParams.idAndName,defauleParams:n(n({},e.defauleParams),{},{idAndName:e.defauleParams.search})},null)])])}}});e("default",a({name:"MusicSearch",emits:["confirm"],setup:function(){localStorage.setItem("behaviorId",p());var e=t(),n=i(),a=l(e.query.search||""),c=l(e.query.tagids||""),u=l(),f=l(!1),d=v("music-search",[]),m=l("all"),b=x(P.SEARCH);u.value=b.id;var j=function(e){if("all"!==m.value){var n,c;a.value=e;var t=d.value.indexOf(e);t>-1&&d.value.splice(t,1),e&&(d.value.unshift(e),d.value.length=Math.min(d.value.length,10)),null===(n=("album"===m.value?I:A).value)||void 0===n||null===(c=n.onSearch)||void 0===c||c.call(n,e)}},S=function(e){var n,a,t=Object.values(e).flat().filter(Boolean).join(",");c.value=t,null===(n=(a=("album"===m.value?I:A).value).onComfirm)||void 0===n||n.call(a,e),f.value=!1},O=function(e){var n,a;u.value=e.id,null===(n=(a=("album"===m.value?I:A).value).onComfirmSubject)||void 0===n||n.call(a,e)},I=l(null),A=l(null),L=function(e,n){a.value=n,m.value=e};return s((function(){h.on("changeTab",L),h.on("search",j),h.on("confirm",S),h.on("confirmSubject",O)})),o((function(){h.off("changeTab",L),h.off("search",j),h.off("confirm",S),h.off("confirmSubject",O)})),function(){return r("div",{class:y.search},["all"===m.value&&r(T,{defauleParams:{idAndName:a.value,albumTagIds:c.value,subjectIds:u.value}},null),"album"===m.value&&r("div",{class:"mt12"},[r(g,{hideSearch:!0,showLight:!0,lightText:a.value,ref:I,defauleParams:{search:a.value,albumTagIds:c.value,subjectIds:u.value}},null)]),"songe"===m.value&&r("div",{class:[y.musicGroup]},[r(w,{hideSearch:!0,showLight:!0,lightText:a.value,defauleParams:{idAndName:a.value,albumTagIds:c.value,subjectIds:u.value},ref:A,onItemClick:function(a){n.push({path:"/music-detail",query:{id:a.id,albumId:e.params.id}})}},null)])])}}}))}}}))}();