index.a3bb1a6d.js 13 KB

1
  1. var ne=Object.defineProperty,oe=Object.defineProperties;var re=Object.getOwnPropertyDescriptors;var U=Object.getOwnPropertySymbols;var ie=Object.prototype.hasOwnProperty,le=Object.prototype.propertyIsEnumerable;var F=(e,t,s)=>t in e?ne(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,A=(e,t)=>{for(var s in t||(t={}))ie.call(t,s)&&F(e,s,t[s]);if(U)for(var s of U(t))le.call(t,s)&&F(e,s,t[s]);return e},R=(e,t)=>oe(e,re(t));import{a as J,h as E,F as ce,l as Y,S as de,c as ue,L as pe,C as ve,N as he}from"./index.7de565cb.js";import{d as N,p as L,M as fe,ah as me,W as q,av as ge,al as we,c as o,N as D,L as S,ae as _e,aB as ye,$ as z,z as be,V as xe,aq as Ie,as as Ce,P as Q,T as Se,I as G,aZ as Ae,X as Z,O as T,Q as W,a0 as je,a1 as $,aC as Oe,D as Pe,a as ke,r as H,s as l,i as C,A as j,C as Be,b as Le,t as O,b5 as Ne,f as X,aH as Ve,q as Re}from"./base.d7a641ab.js";import{g as Me,s as a}from"./state.401ef5ef.js";import{C as De,V as Te}from"./vip.3614badc.js";import{M as Ue}from"./music.b35eb5be.js";import{E as Fe}from"./index.6829aadf.js";var[ee,P]=D("dropdown-menu"),te=Symbol(ee),Ee={overlay:S,zIndex:[Number,String],activeColor:String,closeOnClickOutside:S,closeOnClickOverlay:S,duration:{type:[Number,String],default:.2},direction:{type:String,default:"down"}},Ye=N({name:ee,props:Ee,setup(e,{slots:t}){var s=L(),n=L(),i=L(0),{children:d,linkChildren:p}=fe(te),m=me(s),g=q(()=>d.some(r=>r.state.showWrapper)),y=q(()=>{if(g.value&&_e(e.zIndex))return{zIndex:+e.zIndex+1}}),b=()=>{e.closeOnClickOutside&&d.forEach(r=>{r.toggle(!1)})},_=()=>{if(n.value){var r=ye(n);e.direction==="down"?i.value=r.bottom:i.value=window.innerHeight-r.top}},x=()=>{g.value&&_()},c=r=>{d.forEach((u,v)=>{v===r?(_(),u.toggle()):u.state.showPopup&&u.toggle(!1,{immediate:!0})})},f=(r,u)=>{var{showPopup:v}=r.state,{disabled:w,titleClass:I}=r;return o("div",{role:"button",tabindex:w?-1:0,class:P("item",{disabled:w}),onClick:()=>{w||c(u)}},[o("span",{class:[P("title",{down:v===(e.direction==="down"),active:v}),I],style:{color:v?e.activeColor:""}},[o("div",{class:"van-ellipsis"},[r.renderTitle()])])])};return p({props:e,offset:i}),ge(s,b),we("scroll",x,{target:m}),()=>o("div",{ref:s,class:P()},[o("div",{ref:n,style:y.value,class:P("bar",{opened:g.value})},[d.map(f)]),t.default==null?void 0:t.default()])}}),[qe,k]=D("dropdown-item"),ze=N({name:qe,props:{title:String,disabled:Boolean,teleport:[String,Object],lazyRender:S,modelValue:z,titleClass:z,options:{type:Array,default:()=>[]}},emits:["open","opened","close","closed","change","update:modelValue"],setup(e,{emit:t,slots:s}){var n=be({showPopup:!1,transition:!0,showWrapper:!1}),{parent:i}=xe(te);if(!!i){var d=r=>()=>t(r),p=d("open"),m=d("close"),g=d("opened"),y=()=>{n.showWrapper=!1,t("closed")},b=r=>{e.teleport&&r.stopPropagation()},_=(r=!n.showPopup,u={})=>{r!==n.showPopup&&(n.showPopup=r,n.transition=!u.immediate,r&&(n.showWrapper=!0))},x=()=>{if(s.title)return s.title();if(e.title)return e.title;var r=e.options.find(u=>u.value===e.modelValue);return r?r.text:""},c=r=>{var{activeColor:u}=i.props,v=r.value===e.modelValue,w=()=>{n.showPopup=!1,r.value!==e.modelValue&&(t("update:modelValue",r.value),t("change",r.value))};return o(J,{clickable:!0,key:r.value,icon:r.icon,title:r.text,class:k("option",{active:v}),style:{color:v?u:""},onClick:w},{default:()=>[v&&o(G,{class:k("icon"),color:u,name:"success"},null)]})},f=()=>{var{offset:r}=i,{zIndex:u,overlay:v,duration:w,direction:I,closeOnClickOverlay:ae}=i.props,V=Ae(u);return I==="down"?V.top=r.value+"px":V.bottom=r.value+"px",Ie(o("div",{style:V,class:k([I]),onClick:b},[o(Q,{show:n.showPopup,"onUpdate:show":se=>n.showPopup=se,class:k("content"),overlay:v,position:I==="down"?"top":"bottom",duration:n.transition?w:0,lazyRender:e.lazyRender,overlayStyle:{position:"absolute"},closeOnClickOverlay:ae,onOpen:p,onClose:m,onOpened:g,onClosed:y},{default:()=>[e.options.map(c),s.default==null?void 0:s.default()]})]),[[Ce,n.showWrapper]])};return Z({state:n,toggle:_,renderTitle:x}),()=>e.teleport?o(Se,{to:e.teleport},{default:()=>[f()]}):f()}}}),M=T(ze),K=T(Ye),[We,B,$e]=D("search"),He=N({name:We,props:W({},E,{label:String,clearable:S,actionText:String,background:String,showAction:Boolean,shape:{type:String,default:"square"},leftIcon:{type:String,default:"search"}}),emits:["search","cancel","update:modelValue"],setup(e,{emit:t,slots:s,attrs:n}){var i=L(),d=()=>{s.action||(t("update:modelValue",""),t("cancel"))},p=c=>{var f=13;c.keyCode===f&&(Oe(c),t("search",e.modelValue))},m=()=>{if(s.label||e.label)return o("div",{class:B("label")},[s.label?s.label():e.label])},g=()=>{if(e.showAction){var c=e.actionText||$e("cancel");return o("div",{class:B("action"),role:"button",tabindex:0,onClick:d},[s.action?s.action():c])}},y=()=>{var c;return(c=i.value)==null?void 0:c.blur()},b=()=>{var c;return(c=i.value)==null?void 0:c.focus()},_=Object.keys(E),x=()=>{var c=W({},n,$(e,_)),f=r=>t("update:modelValue",r);return o(ce,je({ref:i,type:"search",border:!1,onKeypress:p},c,{"onUpdate:modelValue":f}),$(s,["left-icon","right-icon"]))};return Z({focus:b,blur:y}),()=>o("div",{class:B({"show-action":e.showAction}),style:{background:e.background}},[s.left==null?void 0:s.left(),o("div",{class:B("content",e.shape)},[m(),x()]),g()])}}),Xe=T(He),Ke="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAqCAMAAAD26OlUAAAAdVBMVEUAAAAAwrYAwbQAw7QBwrUBwbYBwbYAwrYBwbUCwrYBwrYAwrcBwrYBwbUBwbUBwrUCwrUAw7cAwbgAwrcAwbUAxLsBwbUAwrYAwrUAwLQBwbQBwbUBwrYCwrYCwrYAw7YAwLUAwbUAv7gAv7cBwrYAysoBwbV4Ka+yAAAAJnRSTlMAQhMG8fv3guaojTnr3s/ImmtQRi0P1Xp2KPO+uKCTYllWJB65BHQbZOYAAAEHSURBVDjL7ZLLEoIwDEUphSIg74fiW9H+/yeaOIUpDWXYuOOu4M5pmpvG2fQnuc0KiN0SX0qRBvUylslR4cvOBVLXqbRxoSL2nvooluqFFYc4j18PfjXbnwTt4uH3LrC2OwNmyPXaQR+MyFIw1p0jGIKO9Ib9TRyegPUkILoVTZcTEDvitJszeV/MaHgdeK0JNmB6hleDl5KrcWzG1EqwLgRMwX1MrVwNkkbMpm3jkzMC1hJ0150rPhWf3x2hFTjY9ud1wn05cnUv1qM3q5CoJGBdXeZqJb14jix8achGVnudaSM76UZiwHYFxzwqOFXzzM9teokYH5P3jkXG8r6dVerYx9m0Rl+8riWqpDNy7wAAAABJRU5ErkJggg==";const Je="_accompany_jdvsx_1",Qe="_playIcon_jdvsx_23",Ge="_extra_jdvsx_34",Ze="_song_jdvsx_42",et="_playing_jdvsx_45",tt="_iconMusic_jdvsx_49",at="_spin_jdvsx_1",st="_active_jdvsx_53",nt="_vipTip_jdvsx_56",ot="_strong_jdvsx_63",rt="_search_jdvsx_67",it="_search_btn_jdvsx_143",lt="_item_jdvsx_153",ct="_title_jdvsx_156",dt="_iconSearch_jdvsx_163",ut="_hidden_jdvsx_194",pt="_searchSelect_jdvsx_198",vt="_tags_jdvsx_201",ht="_icon_jdvsx_49",ft="_notice_jdvsx_232";var h={accompany:Je,"van-tab":"_van-tab_jdvsx_17","van-tab--active":"_van-tab--active_jdvsx_20",playIcon:Qe,extra:Ge,song:Ze,"van-cell":"_van-cell_jdvsx_42",playing:et,iconMusic:tt,spin:at,active:st,vipTip:nt,strong:ot,search:rt,"van-field__left-icon":"_van-field__left-icon_jdvsx_71","van-search__content":"_van-search__content_jdvsx_75","van-search__action":"_van-search__action_jdvsx_81",search_btn:it,item:lt,title:ct,iconSearch:dt,"van-icon__image":"_van-icon__image_jdvsx_167","icon-status":"_icon-status_jdvsx_177","audio-container":"_audio-container_jdvsx_185",hidden:ut,searchSelect:pt,tags:vt,icon:ht,notice:ft};const mt=Re.parse(location.search);function gt(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!Ve(e)}var St=N({name:"music-list",data(){return{show:!0,isFirstLoad:!1,userinfo:null,isApp:Pe().isApp,tempLevelId:0,chooseShow:!1,partNames:[],selectedPartName:"",selectedPartIndex:0,activeRow:null}},async mounted(){await this.initList()},methods:{async initList(){ke(["_trackEvent","\u4E91\u6559\u7EC3","\u5207\u6362\u9875\u9762","\u5217\u8868\u9875\u9762"]);const e=Me();for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&(a[t]=e[t]);a.parentId=this.$route.params.id||1,await this.FetchLevel(),await this.FetchList()},async FetchLevel(){try{const e=sessionStorage.getItem("musicScoreList"),t=e?JSON.parse(e):[];let s=[];for(let n of t)n.id==a.parentId&&(s=n.sysMusicScoreCategoriesList||[]);if(a.levelOptions=[...s.map(n=>({value:n.id,text:n.name,childs:n.sysMusicScoreCategoriesList}))],a.levelOptions.length&&!a.levelId){a.levelId=a.levelOptions[0].value;const n=Y.exports.find(a.levelOptions,{value:a.levelId});n&&(n.childs?(console.log(n,"showInfo"),a.typeOptions=[{value:0,text:"\u5168\u90E8"},...n.childs.map(i=>({value:i.id,text:i.name}))]):a.typeOptions=null)}}catch{}},async FetchCats(){try{const e=await H.get("/sysMusicScoreAccompaniment/querySubjectIds",{params:{categoriesId:this.$route.params.id||1}});l.subjectOptions=[{value:0,text:"\u5168\u90E8\u58F0\u90E8"},...e.data.filter(t=>!!t).map(t=>({value:t.id,text:t.name}))]}catch{}},async FetchList(){if(a.error=!1,a.loading)return;a.loading=!0,console.log(l.subjectOptions),C()!=="/api-student"&&await this.FetchCats(),C()==="/api-student"&&(l.subjectOptions=[...l.extSubjectIds.filter(t=>!!t).map(t=>({value:t.id,text:t.name}))]);const e=l.subjectOptions.map(t=>t.value).filter(t=>t>0);console.log(e,l.subjectId),e.includes(5)&&e.push(6),e.includes(l.subjectId)||(l.subjectId=0),console.log(l.subjectOptions);try{a.subjectId=l.subjectId;let t=a.params,s=this.$route.params.id,n=((a.levelId||a.typeId)===0?void 0:a.typeId||a.levelId)||s,i=l.subjectId===0?void 0:l.subjectId;C();const d=await H.get("/sysMusicScore/queryPage2",{params:R(A({},t),{clientType:"SMART_PRACTICE",subjectId:i,categoriesId:n,search:a.search})}),{data:p}=d;if(a.list.length>0&&p.pageNo==1)return;a.list=[...a.list,...p.rows],t.page>=Math.ceil(p.total/t.rows)&&(a.finished=!0),a.params.page=p.nextPage,a.list.length<=0&&(this.show=!1)}catch{a.error=!0}a.loading=!1},async getPartNames(e){const t=[];j({type:"loading",overlay:!0});try{const s=await Be.get(e,{mode:"cors"}),n=new DOMParser().parseFromString(s,"text/xml");for(const i of n.getElementsByTagName("part-name"))i.textContent&&t.push(i.textContent);j.clear()}catch{j.clear(),j("\u8BFB\u53D6\u5206\u8C31\u4FE1\u606F\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5")}return t},openDetail(){var i,d,p;const e=this.activeRow,t=(i=e.rankIds)==null?void 0:i.split(","),s=String((p=(d=l.user)==null?void 0:d.student)==null?void 0:p.memberRankSettingId);if(e.rankIds&&l.user&&!t.includes(s)&&C()==="/api-student"){Le.vipShow=!0;return}if(mt.mode==="select"){this.isApp&&O({api:"onAccompanySelectResult",content:{id:e.id,name:e.name,partIndex:this.selectedPartIndex}});return}const n="/detail/"+e.id+"?part-index="+this.selectedPartIndex;if(this.isApp)O({api:"openAccompanyWebView",content:{url:location.origin+"/accompany/#"+n,orientation:0,isHideTitle:!0,statusBarTextColor:!1,isOpenLight:!0}});else{const m=Ne("#"+n,A({},this.$route.query));location.replace(m)}},async toDetail(e){this.activeRow=e,this.selectedPartName="",this.selectedPartIndex=0;const t=await this.getPartNames(e.xmlUrl);this.partNames=t,t.length>1?this.chooseShow=!0:(this.selectedPartName=t[0],this.openDetail())},onSelectedPartName(e){this.selectedPartIndex=e,this.chooseShow=!1,this.openDetail()},onPayVideo(e,t){e.stopPropagation(),O({api:"recordHomeworkVideo",content:R(A({},t),{partIndex:this.selectedPartIndex})})},openRecordingWebview(e,t){e.stopPropagation(),O({api:"recordHomeworkVideo",content:{id:t.id,partIndex:this.selectedPartIndex}})},onSearch(){a.params.page=1,a.list=[],this.show=!0,a.finished=!1,this.FetchList()},subjectChange(e){l.subjectId=e,this.onSearch()},onClickLeft(){this.$router.replace("/")}},render(){let e;return o("div",{class:h.accompany},[o(Q,{show:this.chooseShow,teleport:"body",closeable:!0,style:{borderRadius:"8px"},onClickOverlay:()=>this.chooseShow=!1,onClickCloseIcon:()=>this.chooseShow=!1},{default:()=>[o(De,{partNames:this.partNames,onSelectedPartName:this.onSelectedPartName},null)]}),o(de,null,{default:()=>[a.typeOptions||a.levelOptions&&a.levelOptions.length>0?o(K,{activeColor:"#01C1B5"},{default:()=>[a.levelOptions&&a.levelOptions.length>0?o(M,{modelValue:a.levelId,options:a.levelOptions,onChange:t=>{a.levelId=t,a.typeId=0;const s=Y.exports.find(a.levelOptions,{value:t});s&&(s.childs?a.typeOptions=[{value:0,text:"\u5168\u90E8"},...s.childs.map(n=>({value:n.id,text:n.name}))]:a.typeOptions=null),this.onSearch()}},null):null,a.typeOptions?o(M,{class:h.searchSelect,"get-container":"#app",modelValue:a.typeId,options:a.typeOptions,onChange:t=>{a.typeId=t,this.onSearch()}},null):null]}):null,o(Xe,{class:[h.search],placeholder:"\u8BF7\u8F93\u5165\u641C\u7D22\u5173\u952E\u8BCD",modelValue:a.search,background:"#F8F9FC","onUpdate:model-value":t=>a.search=t,showAction:!0,onSearch:this.onSearch},{"left-icon":()=>o("img",{class:h.iconSearch,src:Ke},null),label:()=>C()=="/api-student"&&l.subjectOptions&&l.subjectOptions.length===1?null:o(K,{activeColor:"#01C1B5",onClick:t=>{t.preventDefault()}},{default:()=>[o(M,{class:h.searchSelect,"get-container":"#app",modelValue:l.subjectId,options:l.subjectOptions,onChange:t=>{l.subjectId=t,this.onSearch()}},null)]}),action:()=>o("span",{class:h.search_btn,onClick:this.onSearch},[X("\u641C\u7D22")])})]}),o("div",{class:ue(h.accompanyList,h.song)},[this.show?o(pe,{loading:a.loading,finishedText:"\u52A0\u8F7D\u5B8C\u6BD5",error:a.error,offset:100,finished:a.finished,immediateCheck:!1,onLoad:this.FetchList},{default:()=>[o(ve,null,gt(e=a.list.map(t=>o(J,{size:"large",onClick:()=>this.toDetail(t)},{icon:()=>o("div",{class:h["icon-status"]},[o(G,{class:h.iconMusic,name:Ue},null),t.rankIds?o("div",{class:h.icon},[o("img",{src:Te},null)]):null]),title:()=>o(he,{background:"none",color:"#444",style:{paddingLeft:(t.rankIds?"4PX":"15PX")+"!important"},text:t.name,key:"notactive"},null)})))?e:{default:()=>[e]})],error:()=>o("span",{onClick:this.FetchList},[X("\u52A0\u8F7D\u5931\u8D25\uFF0C\u8BF7\u70B9\u51FB\u91CD\u8BD5")])}):o(Fe,{description:"\u6682\u65E0\u6570\u636E"},null)])])}});export{St as default};