music-list-legacy.ed8007de.js 6.2 KB

1
  1. !function(){function e(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function n(n){for(var r=1;r<arguments.length;r++){var i=null!=arguments[r]?arguments[r]:{};r%2?e(Object(i),!0).forEach((function(e){t(n,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):e(Object(i)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))}))}return n}function t(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function r(e,n,t,r,i,a,u){try{var o=e[a](u),c=o.value}catch(s){return void t(s)}o.done?n(c):Promise.resolve(c).then(r,i)}function i(e){return function(){var n=this,t=arguments;return new Promise((function(i,a){var u=e.apply(n,t);function o(e){r(u,i,a,o,c,"next",e)}function c(e){r(u,i,a,o,c,"throw",e)}o(void 0)}))}}System.register(["./index-legacy.c1f63540.js","./index-legacy.4596d3ae.js","./index.module-legacy.cb3d08ee.js","./index-legacy.7e71b67e.js","./index-legacy.bc03baf4.js","./index-legacy.02ac8dff.js","./index-legacy.3d6462c3.js","./index-legacy.2318e5fa.js","./index-legacy.8a8e9c42.js","./index-legacy.45603cb6.js","./use-tab-status-legacy.77a01b2b.js"],(function(e){"use strict";var t,r,a,u,o,c,s,l,f,d,p,g,v,m,h,y,b,x,j,w,O,k,C,S,A,P;return{setters:[function(e){t=e.d,r=e.ah,a=e.ag,u=e.R,o=e.r,c=e.y,s=e.$,l=e.c,f=e.aj,d=e.a5,p=e.ak,g=e.al,v=e.m,m=e.g,h=e._,y=e.e},function(e){b=e.O},function(e){x=e.g,j=e.s},function(e){w=e.O},function(e){O=e.O},function(e){k=e.D,C=e.a},function(e){S=e.L},function(e){A=e.C},function(e){P=e.C},function(){},function(){}],execute:function(){e("default",t({name:"accompany-music-list",props:{musicTree:{type:Array,default:function(){return[]}}},setup:function(e,t){var L=r();a();var R=x("icon-music.svg"),T=u({}),V=o({loading:!1,finished:!1,refreshing:!1,musicTree:[],pagenation:{page:1,rows:20},value1:null,value2:null,PopoverOpen:!1,list:[],keyword:""}),D=function(){var e=i(regeneratorRuntime.mark((function e(){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,v.get(m.platformApi+"/musicSheetCategories/queryTree?enable=true");case 3:n=e.sent,Array.isArray(null==n?void 0:n.data)&&(V.musicTree=n.data),h((function(){z()})),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(0),console.log(e.t0);case 11:case"end":return e.stop()}}),e,null,[[0,8]])})));return function(){return e.apply(this,arguments)}}(),U=function(){var e=i(regeneratorRuntime.mark((function e(){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,v.get("/api-student/student/member");case 3:n=e.sent,T.value=n.data||{},e.next=9;break;case 7:e.prev=7,e.t0=e.catch(0);case 9:case"end":return e.stop()}}),e,null,[[0,7]])})));return function(){return e.apply(this,arguments)}}(),q=c((function(){var e=V.musicTree.find((function(e){return e.id==L.query.categorieid}));return Array.isArray(null==e?void 0:e.musicSheetCategoriesList)?e.musicSheetCategoriesList.map((function(e){return V.value1||(V.value1=e.id,V.value2=null),{text:e.name,value:e.id}})):[]})),E=c((function(){var e=V.musicTree.find((function(e){return e.id==L.query.categorieid}));if(Array.isArray(null==e?void 0:e.musicSheetCategoriesList)){var n=e.musicSheetCategoriesList.find((function(e){return e.id==V.value1}));if(Array.isArray(null==n?void 0:n.musicSheetCategoriesList))return[{text:"全部",value:null}].concat(n.musicSheetCategoriesList.map((function(e){return{text:e.name,value:e.id}})))}return[{text:"全部",value:null}]})),z=function(){var e=i(regeneratorRuntime.mark((function e(){var t,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!V.loading){e.next=2;break}return e.abrupt("return");case 2:return V.loading=!0,e.prev=3,e.next=6,v.post(m.platformApi+"/musicSheet/page",{data:n(n({},V.pagenation),{},{keyword:V.keyword,musicSheetCategoriesId:V.value2||V.value1}),hideLoading:!0});case 6:r=e.sent,Array.isArray(null==r||null===(t=r.data)||void 0===t?void 0:t.rows)?(V.list=[].concat(V.list,r.data.rows),V.pagenation.page+=1,V.finished=!r.data.rows.length):V.finished=!0,e.next=13;break;case 10:e.prev=10,e.t0=e.catch(3),V.finished=!0;case 13:V.loading=!1,V.refreshing=!1;case 15:case"end":return e.stop()}}),e,null,[[3,10]])})));return function(){return e.apply(this,arguments)}}(),H=function(){V.pagenation.page=1,V.list=[],V.finished=!1,V.list=[],z()};return s((function(){U(),D()})),function(){var e;return l("div",{class:j["accompany-music-list"]},[l(w,{mode:"sticky",class:j.heade,onGetHeight:function(e){document.documentElement.style.setProperty("--header-height",e+"px")}},{default:function(){return[l(f,{border:!1},null),l("div",null,[l(k,{activeColor:"var(--van-primary)"},{default:function(){return[l(C,{modelValue:V.value1,"onUpdate:modelValue":function(e){return V.value1=e},options:q.value,onChange:function(e){V.value2=null,H()}},null),l(C,{modelValue:V.value2,"onUpdate:modelValue":function(e){return V.value2=e},options:E.value,onChange:function(){return H()}},null)]}}),l("div",{class:j.filter},[l(O,{style:{width:"100%"},background:"transparent",onSearch:function(e){V.keyword=e,H()}},null)])])]}}),l(b,{modelValue:V.refreshing,"onUpdate:modelValue":function(e){return V.refreshing=e},onRefresh:H,style:"min-height: calc(100vh - var(--header-height))"},{default:function(){return[l(S,{"loading-text":" ",immediateCheck:!1,loading:V.loading,finished:V.finished,"onUpdate:finished":function(e){return V.finished=e},finishedText:" ",onLoad:function(){z()}},{default:function(){return[l(A,{inset:!0},(n=e=V.list.map((function(e){return l(P,{size:"large",center:!0,title:e.musicSheetName,isLink:!0,onClick:function(){return function(e){var n="".concat(location.origin,"/orchestra-music-score/?id=").concat(e.id);y({api:"openAccompanyWebView",content:{url:n,orientation:0,isHideTitle:!0,statusBarTextColor:!1,isOpenLight:!0}})}(e)}},{icon:function(){return l(d,{style:{marginRight:"12px"},size:40,name:R},null)}})})),"function"==typeof n||"[object Object]"===Object.prototype.toString.call(n)&&!g(n)?e:{default:function(){return[e]}}))];var n}}),!V.loading&&!V.list.length&&l(p,{tips:"暂无曲谱"},null)]}})])}}}))}}}))}();