;(function(){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);});};}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;}System.register(['./vendor-legacy.031e1374.js','./index-legacy.f25f109a5.js','./index-legacy.f25f109a6.js','./index-legacy.edec5e29.js','./index-legacy.1cd7b6bb.js','./item-legacy.a4c36c80.js','./select-tag-legacy.8087e2bf.js','./index.module-legacy.c95c0685.js','./music-legacy.9bfa98dd.js','./index-legacy.f25f109a2.js','./index-legacy.f25f109a3.js','./index-legacy.f25f109a4.js','./index-legacy.f25f109a10.js','./index-legacy.6e10cd37.js','./init-user-icon-legacy.6fbc494f.js','./favorite-legacy.403f54ea.js','./index-legacy.104980d7.js','./index-legacy.f25f109a13.js','./index-legacy.f25f109a14.js','./orderStatus-legacy.071c8548.js','./index-legacy.c75fe8a2.js'],function(exports){'use strict';var defineComponent,useRoute,reactive,ref,createVNode,Fragment,List,Sticky,Popup,ColSearch,state,ColResult,request,Item,SelectTag,styles,getRandomKey,musicBuy;return{setters:[function(module){defineComponent=module.d;useRoute=module._;reactive=module.h;ref=module.V;createVNode=module.a;Fragment=module.F;List=module.w;Sticky=module.S;Popup=module.P;},function(){},function(){},function(module){ColSearch=module.C;},function(module){state=module.s;ColResult=module.C;request=module.r;},function(module){Item=module.I;},function(module){SelectTag=module.S;},function(module){styles=module.s;},function(module){getRandomKey=module.g;musicBuy=module.m;},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){}],execute:function execute(){var noop=function noop(){};var MusicList=exports('default',defineComponent({name:'MusicList',props:{hideSearch:{type:Boolean,default:false},defauleParams:{type:Object,default:function _default(){return{};}},onItemClick:{type:Function,default:noop},teacherId:{type:String||Number,default:''}},setup:function setup(_ref,_ref2){var hideSearch=_ref.hideSearch,defauleParams=_ref.defauleParams,onItemClick=_ref.onItemClick,teacherId=_ref.teacherId;var expose=_ref2.expose;localStorage.setItem('behaviorId',getRandomKey());var route=useRoute();// const router = useRouter()
var tempParams={};if(state.version){tempParams.version=state.version||'';// 处理ios审核版本
tempParams.platform='ios-student';}var params=reactive(_objectSpread(_objectSpread({search:route.query.search||'',musicTagIds:route.query.tagids||'',page:1},tempParams),defauleParams));var data=ref(null);var loading=ref(false);var finished=ref(false);var isError=ref(false);var tagVisibility=ref(false);var onSearch=function onSearch(value){params.page=1;params.search=value;data.value=null;FetchList();};var FetchList=/*#__PURE__*/function(){var _ref3=_asyncToGenerator(/*#__PURE__*/regeneratorRuntime.mark(function _callee(){var res,_data$value,result;return regeneratorRuntime.wrap(function _callee$(_context){while(1){switch(_context.prev=_context.next){case 0:if(!loading.value){_context.next=2;break;}return _context.abrupt("return");case 2:loading.value=true;isError.value=false;_context.prev=4;_context.next=7;return request.post('/api-student/music/sheet/list',{data:_objectSpread(_objectSpread({},params),{},{idAndName:params.search,createBy:teacherId})});case 7:res=_context.sent;if(data.value){result=(((_data$value=data.value)===null||_data$value===void 0?void 0:_data$value.rows)||[]).concat(res.data.rows||[]);data.value.rows=result;}data.value=data.value||res.data;params.page=res.data.pageNo+1;finished.value=res.data.pageNo>=res.data.totalPage;_context.next=17;break;case 14:_context.prev=14;_context.t0=_context["catch"](4);isError.value=true;case 17:loading.value=false;case 18:case"end":return _context.stop();}}},_callee,null,[[4,14]]);}));return function FetchList(){return _ref3.apply(this,arguments);};}();var onComfirm=function onComfirm(tags){var d=Object.values(tags).flat().filter(Boolean).join(',');params.musicTagIds=d;params.page=1;data.value=null;FetchList();tagVisibility.value=false;};expose({onSearch:onSearch,onComfirm:onComfirm});return function(){return createVNode(Fragment,null,[createVNode(List,{"loading":loading.value,"finished":finished.value,"finished-text":data.value&&data.value.rows.length?'没有更多了':'',"onLoad":FetchList,"error":isError.value},{default:function _default(){return[!hideSearch&&createVNode(Sticky,{"class":styles.sticky},{default:function _default(){return[createVNode(ColSearch,{"showAction":true,"onSearch":onSearch,"onFilter":function onFilter(){return tagVisibility.value=true;},"filterDot":!!params.musicTagIds},null)];}}),data.value&&data.value.rows.length?data.value.rows.map(function(item){return createVNode(Item,{"data":item,"onClick":function onClick(){if(onItemClick===noop){musicBuy(item);}else{onItemClick===null||onItemClick===void 0?void 0:onItemClick(item);}}},null);}):!loading.value&&createVNode(ColResult,{"tips":"暂无曲目","classImgSize":"SMALL","btnStatus":false},null)];}}),createVNode(Popup,{"show":tagVisibility.value,"round":true,"closeable":true,"position":"bottom","style":{height:'60%'},"teleport":"body","onUpdate:show":function onUpdateShow(val){return tagVisibility.value=val;}},{default:function _default(){return[createVNode(SelectTag,{"onConfirm":onComfirm,"onCancel":function onCancel(){},"defaultValue":route.query.tagids},null)];}})]);};}}));}};});})();
