index-legacy.7b89ed7f.js 4.7 KB

1
  1. ;(function(){System.register(['./index-legacy.ec61b788.js','./index-legacy.6146aa34.js','./index-legacy.55c01a28.js','./header-legacy.7dae1f10.js','./vendor-legacy.d9b05f74.js','./music-legacy.3265e322.js','./hooks-legacy.dad5cef7.js','./index-legacy.f25f109a3.js','./index-legacy.f25f109a6.js','./index-legacy.1e436992.js','./index-legacy.f25f109a.js','./index-legacy.f25f109a5.js','./index-legacy.6e6cc3d4.js','./item-legacy.0955c52a.js','./index-legacy.f25f109a2.js','./select-tag-legacy.74a5fad8.js','./index-legacy.f25f109a10.js','./index-legacy.f25f109a13.js','./index-legacy.f25f109a14.js','./index-legacy.6e10cd37.js','./select-subject-legacy.cd8bd163.js','./index.module-legacy.9051c853.js','./index-legacy.31afdb8b.js','./index-legacy.f25f109a4.js','./index-legacy.ee2bf8ca.js','./index-legacy.637f3556.js','./code-down-load-legacy.59850e4c.js','./logo-legacy.cf4b3bd2.js','./browser-legacy.5a92c2a9.js','./icon_teacher-legacy.e765b7f7.js','./music-icon-legacy.a161f8f1.js','./orderStatus-legacy.04f9f42f.js','./index-legacy.c75fe8a2.js','./index-legacy.637f35562.js'],function(exports){'use strict';var useLocalStorage,Album,MusicList,mitter,styles,defineComponent,useRoute,useRouter,ref,onMounted,onUnmounted,createVNode,getRandomKey,musicBuy,useSubjectId,SubjectEnum;return{setters:[function(module){useLocalStorage=module.c;},function(module){Album=module["default"];},function(module){MusicList=module["default"];},function(module){mitter=module.m;styles=module.s;},function(module){defineComponent=module.d;useRoute=module.u;useRouter=module.k;ref=module.l;onMounted=module.m;onUnmounted=module.aC;createVNode=module.a;},function(module){getRandomKey=module.g;musicBuy=module.m;},function(module){useSubjectId=module.a;SubjectEnum=module.S;},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(){},function(){},function(){}],execute:function execute(){var index=exports('default',defineComponent({name:'MusicSearch',emits:['confirm'],setup:function setup(){localStorage.setItem('behaviorId',getRandomKey());var route=useRoute();useRouter();var keyword=ref(route.query.keyword||'');var tagids=ref(route.query.tagids||'');var subject=ref();var tagVisibility=ref(false);var words=useLocalStorage('music-search',[]);var activeTab=ref('songe');var getSubject=useSubjectId(SubjectEnum.SEARCH);subject.value=getSubject.id;var onSearch=function onSearch(val){var _activeRef$value$onSe,_activeRef$value;keyword.value=val;var indexOf=words.value.indexOf(val);if(indexOf>-1){words.value.splice(indexOf,1);}if(val){words.value.unshift(val);words.value.length=Math.min(words.value.length,5);}var activeRef=activeTab.value==='album'?albumList:musicList;(_activeRef$value$onSe=(_activeRef$value=activeRef.value).onSearch)===null||_activeRef$value$onSe===void 0?void 0:_activeRef$value$onSe.call(_activeRef$value,val);};var onComfirm=function onComfirm(tags){var _activeRef$value$onCo,_activeRef$value2;var data=Object.values(tags).flat().filter(Boolean).join(',');tagids.value=data;var activeRef=activeTab.value==='album'?albumList:musicList;(_activeRef$value$onCo=(_activeRef$value2=activeRef.value).onComfirm)===null||_activeRef$value$onCo===void 0?void 0:_activeRef$value$onCo.call(_activeRef$value2,tags);tagVisibility.value=false;};var onConfirmSubject=function onConfirmSubject(item){var _activeRef$value$onCo2,_activeRef$value3;subject.value=item.id;var activeRef=activeTab.value==='album'?albumList:musicList;(_activeRef$value$onCo2=(_activeRef$value3=activeRef.value).onComfirmSubject)===null||_activeRef$value$onCo2===void 0?void 0:_activeRef$value$onCo2.call(_activeRef$value3,item);};var albumList=ref(null);var musicList=ref(null);var changeTab=function changeTab(val){activeTab.value=val;};onMounted(function(){mitter.on('changeTab',changeTab);mitter.on('search',onSearch);mitter.on('confirm',onComfirm);mitter.on('confirmSubject',onConfirmSubject);});onUnmounted(function(){mitter.off('changeTab',changeTab);mitter.off('search',onSearch);mitter.off('confirm',onComfirm);mitter.off('confirmSubject',onConfirmSubject);});return function(){return createVNode("div",{"class":styles.search},[activeTab.value==='album'?createVNode(Album,{"hideSearch":true,"ref":albumList,"defauleParams":{search:keyword.value,tagids:tagids.value,albumTagIds:tagids.value,subjectIds:subject.value}},null):createVNode(MusicList,{"hideSearch":true,"ref":musicList,"onItemClick":function onItemClick(item){musicBuy(item);},"defauleParams":{search:keyword.value,tagids:tagids.value,musicTagIds:tagids.value,subjectIds:subject.value}},null)]);};}}));}};});})();