index-legacy.46f0c05c.js 10 KB

123456789
  1. ;(function(){var _excluded=["search","subject"];function _toConsumableArray(arr){return _arrayWithoutHoles(arr)||_iterableToArray(arr)||_unsupportedIterableToArray(arr)||_nonIterableSpread();}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(o,minLen){if(!o)return;if(typeof o==="string")return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if(n==="Object"&&o.constructor)n=o.constructor.name;if(n==="Map"||n==="Set")return Array.from(o);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen);}function _iterableToArray(iter){if(typeof Symbol!=="undefined"&&iter[Symbol.iterator]!=null||iter["@@iterator"]!=null)return Array.from(iter);}function _arrayWithoutHoles(arr){if(Array.isArray(arr))return _arrayLikeToArray(arr);}function _arrayLikeToArray(arr,len){if(len==null||len>arr.length)len=arr.length;for(var i=0,arr2=new Array(len);i<len;i++){arr2[i]=arr[i];}return arr2;}function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);enumerableOnly&&(symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable;})),keys.push.apply(keys,symbols);}return keys;}function _objectSpread(target){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};i%2?ownKeys(Object(source),!0).forEach(function(key){_defineProperty(target,key,source[key]);}):Object.getOwnPropertyDescriptors?Object.defineProperties(target,Object.getOwnPropertyDescriptors(source)):ownKeys(Object(source)).forEach(function(key){Object.defineProperty(target,key,Object.getOwnPropertyDescriptor(source,key));});}return target;}function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}function _objectWithoutProperties(source,excluded){if(source==null)return{};var target=_objectWithoutPropertiesLoose(source,excluded);var key,i;if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i<sourceSymbolKeys.length;i++){key=sourceSymbolKeys[i];if(excluded.indexOf(key)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key];}}return target;}function _objectWithoutPropertiesLoose(source,excluded){if(source==null)return{};var target={};var sourceKeys=Object.keys(source);var key,i;for(i=0;i<sourceKeys.length;i++){key=sourceKeys[i];if(excluded.indexOf(key)>=0)continue;target[key]=source[key];}return target;}function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg);var value=info.value;}catch(error){reject(error);return;}if(info.done){resolve(value);}else{Promise.resolve(value).then(_next,_throw);}}function _asyncToGenerator(fn){return function(){var self=this,args=arguments;return new Promise(function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value);}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err);}_next(undefined);});};}System.register(['./moreArrow-legacy.72510c53.js','./index-legacy.417e5f91.js','./index-legacy.4164c601.js','./index-legacy.f4fd80d0.js','./scrollbar.min-legacy.4327ecf2.js','./index-legacy.35a24f3e.js','./index-legacy.c44e09be.js','./index-legacy.a2df0082.js','./index-legacy.a19186b8.js','./vendor-legacy.0948049f.js','./index-legacy.ebf547ae.js','./player-legacy.c7d3b4b9.js','./icon-legacy.aed5a5b3.js','./music-legacy.146bf361.js','./icon_album_active-legacy.72d719cb.js'],function(exports){'use strict';var arrow,albumItem,styles,videoDetailItem,musicLIstItem,hotSearch,silder,state,request,searchInput,useSubjectId,SubjectEnum,banner,Pagination,defineComponent,useRoute,reactive,onMounted,createVNode,Fragment,ColEmpty;return{setters:[function(module){arrow=module.a;},function(module){albumItem=module.a;styles=module.s;},function(module){videoDetailItem=module.v;},function(module){musicLIstItem=module.m;},function(module){hotSearch=module.h;},function(module){silder=module.b;state=module.c;request=module.r;},function(module){searchInput=module.s;useSubjectId=module.u;SubjectEnum=module.S;},function(module){banner=module.b;},function(module){Pagination=module.P;},function(module){defineComponent=module.d;useRoute=module.u;reactive=module.r;onMounted=module.o;createVNode=module.c;Fragment=module.F;},function(module){ColEmpty=module.C;},function(){},function(){},function(){},function(){}],execute:function execute(){var index=exports('default',defineComponent({name:'musicLibrary',components:{albumItem:albumItem,videoDetailItem:videoDetailItem,musicLIstItem:musicLIstItem,hotSearch:hotSearch,silder:silder,searchInput:searchInput,pagination:Pagination,ColEmpty:ColEmpty,banner:banner},setup:function setup(){var _state$user$data;var route=useRoute();var subjectId=0;var subjectIds=((_state$user$data=state.user.data)===null||_state$user$data===void 0?void 0:_state$user$data.subjectId)||'';if(subjectIds){subjectId=Number(subjectIds.split(',')[0]);}// 判断是否在默认的声部
  2. var subjects=useSubjectId(SubjectEnum.SEARCH);subjectId=subjects.id||subjectId;var state$1=reactive({albumList:[],musicList:[],tagTree:[],hideSearch:true,isshowData:false,pageInfo:{// 分页规则
  3. limit:20,// 限制显示条数
  4. page:1,// 当前页
  5. total:0,// 总条数
  6. page_size:[5,10,20,40,50]// 选择限制显示条数
  7. },searchs:{musicTagIds:route.query.musicTagIds||'',search:route.query.search||'',subject:subjectId||''}});var getMusicList=/*#__PURE__*/function(){var _ref=_asyncToGenerator(/*#__PURE__*/regeneratorRuntime.mark(function _callee(){var _state$1$searchs,search,subject,more,res;return regeneratorRuntime.wrap(function _callee$(_context){while(1){switch(_context.prev=_context.next){case 0:_context.prev=0;_state$1$searchs=state$1.searchs,search=_state$1$searchs.search,subject=_state$1$searchs.subject,more=_objectWithoutProperties(_state$1$searchs,_excluded);_context.next=4;return request.post('/api-website/open/music/sheet/list',{data:_objectSpread(_objectSpread({auditStatus:'PASS'},more),{},{idAndName:search,subjectIds:subject,page:state$1.pageInfo.page,rows:state$1.pageInfo.limit,state:1})});case 4:res=_context.sent;// state.musicList = res.data.rows
  8. state$1.musicList=res.data.rows.map(function(n){if(typeof n.paymentType==='string')n.paymentType=n.paymentType.split(',');return n;});state$1.pageInfo.total=res.data.total;if(state$1.pageInfo.total==0){state$1.isshowData=true;}else{state$1.isshowData=false;}_context.next=13;break;case 10:_context.prev=10;_context.t0=_context["catch"](0);console.log(_context.t0);case 13:case"end":return _context.stop();}}},_callee,null,[[0,10]]);}));return function getMusicList(){return _ref.apply(this,arguments);};}();var getTagTree=/*#__PURE__*/function(){var _ref2=_asyncToGenerator(/*#__PURE__*/regeneratorRuntime.mark(function _callee2(){var res,tree;return regeneratorRuntime.wrap(function _callee2$(_context2){while(1){switch(_context2.prev=_context2.next){case 0:_context2.prev=0;_context2.next=3;return request.get('/api-website/open/MusicTag/tree',{params:{type:'MUSIC'}});case 3:res=_context2.sent;tree=res.data||[];state$1.tagTree=[{name:'全部',id:'',isCheck:true}].concat(_toConsumableArray(tree));if(state$1.searchs.musicTagIds){state$1.tagTree.forEach(function(tag){tag.isCheck=false;if(tag.id==state$1.searchs.musicTagIds){tag.isCheck=true;}});}_context2.next=12;break;case 9:_context2.prev=9;_context2.t0=_context2["catch"](0);console.log(_context2.t0);case 12:case"end":return _context2.stop();}}},_callee2,null,[[0,9]]);}));return function getTagTree(){return _ref2.apply(this,arguments);};}();var searchRust=function searchRust(val){// const smallTag = (val || ([] as any)).filter(tag => tag < 0)
  9. var maxTag=(val||[]).filter(function(tag){return tag>0;});state$1.searchs.musicTagIds=maxTag.join(',');startSearch(state$1.searchs);};var startSearch=function startSearch(val){state$1.searchs=_objectSpread(_objectSpread({},state$1.searchs),val);getMusicList();};onMounted(function(){getTagTree();getMusicList();});return function(){return createVNode("div",null,[createVNode(banner,null,null),createVNode("div",{"class":"bg-white"},[createVNode("div",{"class":styles.w1200},[createVNode("div",{"class":styles.section,"style":"padding-bottom: 0;"},[createVNode("div",{"class":styles.tagList},[createVNode("div",{"class":[styles.tagContainer,state$1.hideSearch&&styles.hide]},[state$1.tagTree.map(function(tag){return createVNode("span",{"class":[styles.tagItem,tag.isCheck&&styles.active],"onClick":function onClick(){state$1.tagTree.forEach(function(item){item.isCheck=false;});tag.isCheck=true;startSearch({musicTagIds:tag.id});}},[tag.name]);})]),createVNode("div",{"class":styles.wrapRight,"onClick":function onClick(){state$1.hideSearch=!state$1.hideSearch;}},[createVNode("span",null,[state$1.hideSearch?'更多':'收起']),createVNode("img",{"class":[styles.arrow,!state$1.hideSearch&&styles.active],"src":arrow,"alt":""},null)])]),createVNode(searchInput,{"isWhile":false,"type":"search","showSearch":true,"placeholder":"搜索你想练习的专辑","searchVal":_objectSpread({},state$1.searchs),"onStartSearch":function onStartSearch(val){state$1.pageInfo.page=1;startSearch(val);}},null),createVNode("div",{"class":styles.hotSearch},[createVNode(hotSearch,{"onSearchRust":function onSearchRust(val){return searchRust(val);},"onHotTag":function onHotTag(val){state$1.searchs.search=val;getMusicList();},"type":'',"isChiose":true},null)]),state$1.musicList&&state$1.musicList.length>0&&createVNode(Fragment,null,[createVNode("div",{"class":[styles.section,styles.pb40],"style":"padding-top: 0"},[createVNode("div",{"class":styles.musicList},[state$1.musicList.map(function(item){return createVNode(musicLIstItem,{"item":item},null);})])])]),state$1.isshowData&&createVNode(ColEmpty,null,null),createVNode(Pagination,{"total":state$1.pageInfo.total,"page":state$1.pageInfo.page,"onUpdate:page":function onUpdatePage($event){return state$1.pageInfo.page=$event;},"limit":state$1.pageInfo.limit,"onUpdate:limit":function onUpdateLimit($event){return state$1.pageInfo.limit=$event;},"pageSizes":state$1.pageInfo.page_size,"pagination":getMusicList},null)])])]),createVNode(silder,null,null)]);};}}));}};});})();