1 |
- import{_ as Ae,a as De,b as Be,c as Ne,d as Re,e as Le,f as Oe}from"./icon_uploader.9f387137.js";import{_ as Pe}from"./icon-xin.df8ab2d7.js";import{i as Ue,_ as qe}from"./icon_album.fa329df6.js";import{_ as je}from"./icon_album_active.ce98b2a8.js";import{_ as Ve}from"./icon_exquisite.69e33c80.js";import{_ as $e}from"./icon_music_active.3b316ab8.js";import{d as Me,S as He,Q as ze,V as c,U as ce,a4 as Xe,W as Ge,Z as re,bC as We,X as P,j as e,B as i,F as T,T as D,O as I,f as Je,g as f,E as U,by as Ke,aT as B,Y as me,w as y,D as q}from"./index.c8a33855.js";import{C as Qe}from"./index.00003e8f.js";import{C as N}from"./index.89b19a2f.js";import{C as Ye}from"./index.11af3b47.js";import{I as h}from"./index.5da3180f.js";import{R as Ze,a as j}from"./index.e07e0d98.js";import{S as et}from"./index.e91b3eaf.js";import{T as tt}from"./index.d9b7361c.js";import"./index.08e52374.js";import"./index.f3a3d845.js";import{V as de}from"./vue3-lottie.es.b5449fbc.js";import{g as at,m as ot}from"./music.dcb2254f.js";import{C as st}from"./index.b70ef5ba.js";import{o as p}from"./orderStatus.20a61b2d.js";import{i as nt}from"./icon_share.dff37aef.js";import{i as ut,a as lt,A as pe,e as it,b as ct,c as rt,d as mt,D as dt,s as pt,f as ft,g as _t}from"./download.523da10a.js";import{C as vt}from"./index.5b3a9da8.js";import{i as gt}from"./icon_teacher.40b6f077.js";import{a as V,i as $}from"./icon_checkbox_default.2fe5d57e.js";import{P as yt}from"./plyr.623e6d1e.js";import{g as M}from"./instruments.c85ba412.js";import{P as ht}from"./index.dbd58d80.js";import"./index.a0b72ee6.js";import"./use-height.f274d759.js";import"./index.3dff5bed.js";import"./code-down-load.d2c622e1.js";import"./logo.bcac726b.js";import"./browser.8379baf6.js";import"./html2canvas.esm.3d083717.js";const Ct="_base_96ukw_1",bt="_detail_96ukw_4",wt="_shareBtn_96ukw_22",It="_bgImg_96ukw_34",kt="_bgContent_96ukw_43",St="_musicContent_96ukw_52",Tt="_musicTitle_96ukw_67",Et="_musicImg_96ukw_71",xt="_finch_96ukw_74",Ft="_finchLoad_96ukw_78",At="_collectCell_96ukw_96",Dt="_videoOperation_96ukw_103",Bt="_audition_96ukw_110",Nt="_collect_96ukw_96",Rt="_userInfo_96ukw_136",Lt="_collectSection_96ukw_156",Ot="_lookAlbum_96ukw_175",Pt="_bg_96ukw_34",Ut="_musicContainer_96ukw_201",qt="_shareMate_96ukw_208",jt="_icon_96ukw_218",Vt="_info_96ukw_223",$t="_tagDiscount_96ukw_239",Mt="_shareVip_96ukw_252",Ht="_buttonDiscount_96ukw_294",zt="_pImg_96ukw_307",Xt="_musicInfo_96ukw_314",Gt="_coomposer_96ukw_319",Wt="_tag_96ukw_239",Jt="_download_96ukw_353",Kt="_exquisiteFlag_96ukw_364",Qt="_songAlbum_96ukw_369",Yt="_colSticky_96ukw_379",Zt="_priceSection_96ukw_384",ea="_price_96ukw_384",ta="_buyBtn_96ukw_398",aa="_primry_96ukw_412",oa="_member_96ukw_415",sa="_functionSection_96ukw_418",na="_empty_96ukw_421",ua="_emptyImg_96ukw_429",la="_staffContainer_96ukw_432",ia="_staffTitle_96ukw_435",ca="_staffImg_96ukw_441",ra="_name_96ukw_445",ma="_boxStyle_96ukw_451",da="_active_96ukw_457";var a={base:Ct,detail:bt,shareBtn:wt,bgImg:It,bgContent:kt,musicContent:St,musicTitle:Tt,musicImg:Et,finch:xt,finchLoad:Ft,collectCell:At,videoOperation:Dt,audition:Bt,collect:Nt,userInfo:Rt,collectSection:Lt,lookAlbum:Ot,bg:Pt,musicContainer:Ut,shareMate:qt,icon:jt,info:Vt,tagDiscount:$t,shareVip:Mt,buttonDiscount:Ht,pImg:zt,musicInfo:Xt,coomposer:Gt,tag:Wt,download:Jt,exquisiteFlag:Kt,songAlbum:Qt,colSticky:Yt,priceSection:Zt,price:ea,buyBtn:ta,primry:aa,member:oa,functionSection:sa,empty:na,emptyImg:ua,staffContainer:la,staffTitle:ia,staffImg:ca,name:ra,boxStyle:ma,active:da};const fe=k=>{const C=`../component/images/${k}`;return{"../component/images/collection.png":Ae,"../component/images/collection_active.png":De,"../component/images/icon-xin.png":Pe,"../component/images/icon_ai.png":Be,"../component/images/icon_album.png":qe,"../component/images/icon_album_active.png":je,"../component/images/icon_author.png":Ne,"../component/images/icon_download.png":Re,"../component/images/icon_exquisite.png":Ve,"../component/images/icon_music_active.png":$e,"../component/images/icon_share.png":Le,"../component/images/icon_uploader.png":Oe}[C].default};var Wa=Me({name:"MusicDetail",setup(){localStorage.setItem("behaviorId",at());const k=He(),C=ze(),b=c(!1),_e=Number(C.query.activityId)||0,ve=c(_e),H=c(!1),z=c(null),X=c(null),G=c("0"),o=c(null),A=c("");let _=[];const W=c([]),J=c([]),K=c([]);c("");const R=c(!1),d=ce({status:!1,radio:"staff"}),Q={FREE:{color:"#01B84F",text:"\u514D\u8D39"},VIP:{color:"#CD863E",text:"\u4F1A\u5458"},CHARGE:{color:"#3591CE",text:"\u70B9\u64AD"}},L=t=>{d.radio=t,d.status=!1};Xe(()=>d.radio,t=>{t=="first"?_=W.value:t=="fixed"?_=J.value:_=K.value});const ge=async t=>{var u;if(!b.value){b.value=!0,H.value=!1;try{const n=await y.get(`/music/sheet/detail/${C.query.id}`,{prefix:f.platformType==="TEACHER"?"/api-teacher":"/api-student"});o.value=n.data,console.log(o.value.notation,"musicDetail");const r=n.data.background;A.value=r&&r.length>0?r[0].audioFileUrl:"",_=n.data.musicImg?n.data.musicImg.split(","):[],W.value=n.data.firstTone?n.data.firstTone.split(","):[],J.value=n.data.fixedTone?n.data.fixedTone.split(","):[],K.value=n.data.musicImg?n.data.musicImg.split(","):[],me(()=>{Te()})}catch{H.value=!0}((u=o.value)==null?void 0:u.musicSheetType)!=="CONCERT"&&(b.value=!1)}},E=c(null),Y=c(null),x=c(0),ye=async()=>{var n;const t=["play-large","play","progress","captions","duration"];E.value=new yt(Y.value,{controls:t});const u=await y.get("/api-student/sysConfig/queryByParamNameList",{params:{paramNames:"music_sheet_free_rate"}});x.value=((n=u.data[0])==null?void 0:n.paramValue)||0,E.value.on("timeupdate",()=>{const r=E.value,v=r.duration*x.value/100||0;r.currentTime>=v&&!w.value.play&&r.stop()})},Z=t=>{var u;console.log(t),((u=t.data)==null?void 0:u.api)==="musicStaffRender"&&(b.value=t.data.loading)};Ge(async()=>{await ge();const{height:t}=re(z),u=re(X);G.value=t+u.height,A.value&&ye(),window.addEventListener("message",Z)}),We(()=>{window.removeEventListener("message",Z)});const he=async()=>{var t,u,n;try{await y.post("/music/sheet/favorite/"+((t=o.value)==null?void 0:t.id),{prefix:f.platformType==="TEACHER"?"/api-teacher":"/api-student"}),o.value.favorite=(u=o.value)!=null&&u.favorite?0:1,o.value.favoriteCount=(n=o.value)!=null&&n.favorite?o.value.favoriteCount+1:o.value.favoriteCount-1<0?0:o.value.favoriteCount-1,setTimeout(()=>{var r;D((r=o.value)!=null&&r.favorite?"\u6536\u85CF\u6210\u529F":"\u53D6\u6D88\u6536\u85CF\u6210\u529F")},100)}catch{}},Ce=async()=>{var t;try{const u=await y.post("/api-teacher/courseCourseware/submit",{data:{musicSheetId:o.value.id,clientType:"TEACHER",userId:(t=f.user.data)==null?void 0:t.userId}});console.log(u),setTimeout(()=>{o.value.coursewareId=u.data.id||"",D("\u6DFB\u52A0\u6210\u529F"),o.value.coursewareStatus=1},100)}catch{}},be=async()=>{q.confirm({title:"\u63D0\u793A",message:"\u60A8\u662F\u5426\u786E\u5B9A\u79FB\u9664\u8BFE\u4EF6",confirmButtonColor:"#269a93",cancelButtonText:"\u53D6\u6D88",confirmButtonText:"\u786E\u5B9A"}).then(async()=>{try{await y.post("/api-teacher/courseCourseware/remove/"+o.value.coursewareId,{data:{}}),setTimeout(()=>{D("\u79FB\u9664\u6210\u529F"),o.value.coursewareStatus=0},100)}catch{}})},we=async()=>{const t=o.value;p.orderObject.orderType="MUSIC",p.orderObject.orderName=t.musicSheetName,p.orderObject.orderDesc=t.musicSheetName,p.orderObject.actualPrice=t.musicPrice,p.orderObject.recomUserId=C.query.recomUserId||0,p.orderObject.activityId=C.query.activityId||0,p.orderObject.orderNo="",p.orderObject.orderList=[{orderType:"MUSIC",goodsName:t.musicSheetName,actualPrice:t.musicPrice,...t}];const n=(await y.post("/api-student/userOrder/getPendingOrder",{data:{goodType:"MUSIC",bizId:t.id}})).data;n?q.confirm({title:"\u63D0\u793A",message:"\u60A8\u6709\u4E00\u4E2A\u672A\u652F\u4ED8\u7684\u8BA2\u5355\uFF0C\u662F\u5426\u7EE7\u7EED\u652F\u4ED8\uFF1F",confirmButtonColor:"#269a93",cancelButtonText:"\u53D6\u6D88\u8BA2\u5355",confirmButtonText:"\u7EE7\u7EED\u652F\u4ED8"}).then(async()=>{p.orderObject.orderNo=n.orderNo,p.orderObject.actualPrice=n.actualPrice,p.orderObject.discountPrice=n.discountPrice,ee()}).catch(()=>{q.close(),Ie(n.orderNo)}):ee()},ee=()=>{const t=o.value;k.push({path:"/orderDetail",query:{orderType:"MUSIC",musicId:t.id}})},Ie=async t=>{try{await y.post("/api-student/userOrder/orderCancel",{data:{orderNo:t}})}catch{}},ke=P(()=>{var u;let t=(u=o.value)==null?void 0:u.paymentType;return typeof t=="string"?(t=t.split(","),t):[]}),w=P(()=>{const t=o.value;return{play:!!t.play,free:t==null?void 0:t.paymentType.includes("FREE"),charge:t==null?void 0:t.paymentType.includes("CHARGE"),vip:t==null?void 0:t.paymentType.includes("VIP"),buy:(t==null?void 0:t.orderStatus)==="PAID"}}),O=c(!1),te=c(""),ae=c(0),Se=async()=>{var t,u,n,r;try{const v=await y.post("/api-teacher/open/musicShareProfit",{data:{bizId:(t=o.value)==null?void 0:t.id,userId:(u=f.user.data)==null?void 0:u.userId}});let S=location.origin+`/teacher/#/shareMusic?id=${(n=o.value)==null?void 0:n.id}&recomUserId=${(r=f.user.data)==null?void 0:r.userId}&userType=${f.platformType}`;v.data.discount===1&&(S+=`&activityId=${v.data.activityId}`),ae.value=v.data.discount||0,console.log(S),te.value=S,O.value=!0;return}catch{}},l=ce({open:!1,iframeSrc:"",musicXml:"",instrumentName:"",iframeRef:null,partIndex:0,partList:[]}),Te=()=>{var t,u,n;l.iframeSrc=`${location.origin}${location.pathname}osmd/index.html`,l.musicXml=((t=o.value)==null?void 0:t.xmlFileUrl)||"",l.partList=((u=o.value)==null?void 0:u.background)||[],l.instrumentName=M((n=l.partList[l.partIndex])==null?void 0:n.track)},Ee=()=>{const t=document.getElementById("staffIframeRef");t&&t.contentWindow.renderXml&&t.contentWindow.renderXml(l.musicXml,l.partIndex)},xe=()=>{var u;const t=document.getElementById("staffIframeRef");t&&t.contentWindow.renderXml&&(t.contentWindow.resetRender(l.partIndex),l.instrumentName=M((u=l.partList[l.partIndex])==null?void 0:u.track))},Fe=P(()=>l.partList.map((t,u)=>{const n=M(t.track);return{text:t.track+(n?`(${n})`:""),value:u}}));return()=>{var t,u,n,r,v,S,oe,se,ne,ue,le;return e("div",{class:a.detail},[e(et,{position:"top"},{default:()=>{var s;return[e("div",{ref:z},[e(Qe,{background:"transparent",border:!1,isFixed:!1,color:"#fff",title:(s=o.value)==null?void 0:s.musicSheetName,backIconColor:"white"},{right:()=>e("div",{class:a.shareBtn,style:{color:"#fff"},onClick:Se},[e(h,{src:nt},null),i("\u5206\u4EAB")])})])]}}),e("img",{class:a.bgImg,src:(t=o.value)==null?void 0:t.titleImg},null),e("div",{class:a.bgContent},null),e("div",{class:a.musicContainer,style:{marginTop:"16px",height:`calc(100vh - ${G.value+16+"px"})`}},[e(N,{border:!1,center:!0,class:a.musicInfo},{icon:()=>{var s;return e(h,{class:a.pImg,src:(s=o.value)==null?void 0:s.titleImg},null)},title:()=>{var s,m,g,F;return e("div",{class:a.info},[e("h4",{class:"van-ellipsis"},[(s=o.value)==null?void 0:s.musicSheetName]),e("p",{style:{display:"flex"}},[ke.value.map(ie=>e(tt,{style:{color:Q[ie].color},class:a.tag,type:"success",plain:!0},{default:()=>[Q[ie].text]})),((m=o.value)==null?void 0:m.exquisiteFlag)===1&&e(h,{class:a.exquisiteFlag,src:fe("icon_exquisite.png")},null),((g=o.value)==null?void 0:g.albumNums)>0&&e(h,{class:a.songAlbum,src:fe("icon_album_active.png")},null),e("span",{class:a.coomposer},[(F=o.value)==null?void 0:F.composer])])])},value:()=>{var s,m,g;return e(T,null,[e("div",{class:"van-cell__value",style:{display:((s=o.value)==null?void 0:s.musicSheetType)==="SINGLE"?"":"none"}},[(m=o.value)!=null&&m.notation?e("span",{class:a.download,onClick:()=>{d.status=!0}},[e("img",{src:ut},null),e("span",null,[i("\u8F6C\u8C31")])]):null,e("span",{class:a.download,onClick:()=>{_.length>0?R.value=!0:D("\u6682\u65E0\u56FE\u7247")}},[e("img",{src:lt},null),e("span",null,[i("\u4E0B\u8F7D\u66F2\u8C31")])])]),e("span",{style:{display:((g=o.value)==null?void 0:g.musicSheetType)==="CONCERT"?"":"none"},class:a.download,onClick:()=>{l.open=!0}},[e(I,{style:{background:"rgba(246,246,246,1)",borderRadius:"50%",padding:"4px"},size:"20px",name:"exchange"},null),e("span",null,[i("\u5207\u6362\u4E50\u5668")])])])}}),e("div",{class:a.musicContent},[e("p",{class:a.musicTitle},[((u=o.value)!=null&&u.musicSheetName?(n=o.value)==null?void 0:n.musicSheetName:"")+(l.instrumentName?`(${l.instrumentName})`:"")]),((r=o.value)==null?void 0:r.musicSheetType)==="CONCERT"?e(T,null,[b.value&&e(T,null,[e(de,{animationData:pe,class:a.finch},null),e("p",{class:a.finchLoad},[i("\u52A0\u8F7D\u4E2D...")])]),e("iframe",{id:"staffIframeRef",src:l.iframeSrc,onLoad:Ee},null)]):e(T,null,[_.length>0?e("img",{src:_[0],alt:"",class:a.musicImg},null):b.value?e(T,null,[e(de,{animationData:pe,class:a.finch},null),e("p",{class:a.finchLoad},[i("\u52A0\u8F7D\u4E2D...")])]):e("div",{class:a.empty},[e(h,{src:it,class:a.emptyImg},null),e("p",{class:a.emptyTip},[i("\u6682\u65E0\u4E50\u8C31\u9884\u89C8\u56FE")])])]),e("div",{class:a.videoOperation},[A.value&&e(T,null,[!w.value.play&&x.value!=100&&x.value!=0&&e("div",{class:[a.audition]},[e("img",{src:ct},null),e("span",null,[i("\u6BCF\u9996\u66F2\u76EE\u53EF\u8BD5\u542C"),x.value,i("%")])]),e("div",{class:[a.audio,a.collectCell]},[e("audio",{id:"player",controls:!0,ref:Y},[e("source",{src:A.value,type:"audio/mp3"},null)])])]),e("div",{class:[a.collect,a.collectCell]},[e("div",{class:[a.userInfo],onClick:()=>{var s,m;Je().isApp&&((s=o.value)==null?void 0:s.sourceType)==="TEACHER"&&f.platformType==="STUDENT"&&k.push({path:"/teacherHome",query:{teacherId:(m=o.value)==null?void 0:m.userId,tabs:"music"}})}},[e("img",{src:((v=o.value)==null?void 0:v.userAvatar)||gt},null),e("span",null,[(S=o.value)==null?void 0:S.userName])]),e("div",{class:a.functionSection},[e("div",{class:[a.collectSection],onClick:()=>he()},[e("span",null,[(oe=o.value)==null?void 0:oe.favoriteCount,i("\u4EBA\u6536\u85CF")]),e("img",{src:(se=o.value)!=null&&se.favorite?rt:mt},null)]),f.platformType==="TEACHER"&&e("div",{class:[a.collectSection],onClick:()=>{var s;(s=o.value)!=null&&s.coursewareStatus?be():Ce()}},[e("span",null,[(ne=o.value)!=null&&ne.coursewareStatus?"\u79FB\u51FA\u8BFE\u4EF6":"\u6DFB\u52A0\u5230\u8BFE\u4EF6"]),(ue=o.value)!=null&&ue.coursewareStatus?e(I,{name:"clear"},null):e(I,{name:"add",size:18},null)])])])])]),e("div",{class:[a.lookAlbum,a.collectCell],onClick:()=>{var s,m;k.push({path:"/look-album-list",query:{id:(s=o.value)==null?void 0:s.id,musicSubject:(m=o.value)==null?void 0:m.musicSubject}})}},[e("div",null,[e("img",{src:Ue},null),e("span",null,[i("\u8FDB\u5165\u66F2\u76EE\u6240\u5728\u4E13\u8F91\u5217\u8868")])]),e(I,{name:"arrow",size:16,color:"#666"},null)])]),((le=o.value)==null?void 0:le.id)&&e(st,{position:"bottom",background:"white"},{default:()=>{var s;return[e("div",{ref:X},[w.value.play?e(U,{round:!0,block:!0,type:"primary",color:"linear-gradient(180deg, #59E5D5 0%, #2DC7AA 100%)",onClick:()=>{E.value&&E.value.stop(),ot(o.value,()=>{},{"part-index":l.partIndex||0})}},{default:()=>[i("\u7ACB\u5373\u7EC3\u4E60")]}):e("div",{class:a.colSticky},[w.value.charge&&e("div",{class:a.priceSection},[e("span",null,[i("\u70B9\u64AD\u4EF7\uFF1A")]),e("span",{class:a.price},[e("i",null,[i("\xA5")]),Ke((s=o.value)==null?void 0:s.musicPrice)])]),e("div",{class:[a.buyBtn]},[w.value.charge&&e(U,{round:!0,type:"primary",color:"linear-gradient(180deg, #59E5D5 0%, #2DC7AA 100%)",class:a.primary,onClick:we},{default:()=>[i("\u7ACB\u5373\u70B9\u64AD")]}),w.value.vip&&e(U,{round:!0,block:!w.value.charge,type:"primary",color:"linear-gradient(180deg, #F7BD8D 0%, #CD8806 100%)",class:a.memeber,onClick:()=>{k.push({path:"/memberCenter",query:{...C.query}})}},{default:()=>[ve.value>0&&e("div",{class:[a.buttonDiscount]},[i("\u4E13\u5C5E\u4F18\u60E0")]),i("\u5F00\u901A\u4F1A\u5458")]})])])])]}}),e(B,{show:O.value,"onUpdate:show":s=>O.value=s,style:{background:"transparent"},teleport:"body"},{default:()=>{var s;return[e(vt,{teacherId:(s=f.user.data)==null?void 0:s.userId,shareUrl:te.value,shareType:"music"},{default:()=>{var m,g,F;return[e("div",{class:a.shareMate},[ae.value===1&&e("div",{class:a.tagDiscount},[i("\u4E13\u5C5E\u4F18\u60E0")]),e("img",{class:a.icon,crossorigin:"anonymous",src:((m=o.value)==null?void 0:m.titleImg)+`@base@tag=imgScale&h=80&w=80&m=1?t=${+new Date}`},null),e("div",{class:a.info},[e("h4",{class:"van-multi-ellipsis--l2"},[(g=o.value)==null?void 0:g.musicSheetName]),e("p",null,[i("\u4F5C\u66F2\u4EBA\uFF1A"),(F=o.value)==null?void 0:F.composer])])])]}})]}}),e(B,{show:R.value,"onUpdate:show":s=>R.value=s,position:"bottom",round:!0},{default:()=>[e(dt,{imgList:JSON.parse(JSON.stringify(_)),musicSheetName:o.value.musicSheetName},null)]}),e(B,{show:d.status,"onUpdate:show":s=>d.status=s,teleport:"body",closeable:!0,style:{width:"80%"},round:!0},{default:()=>[e("div",{class:a.staffContainer},[e("div",{class:a.staffTitle},[i("\u9009\u62E9\u8F6C\u6362\u66F2\u8C31")]),e(Ze,{modelValue:d.radio,"onUpdate:modelValue":s=>d.radio=s},{default:()=>[e(Ye,{border:!1},{default:()=>[e(N,{center:!0,border:!1,class:d.radio==="staff"?a.active:"",onClick:()=>L("staff")},{icon:()=>e(h,{src:pt,class:a.staffImg},null),title:()=>e("span",{class:a.name},[i("\u4E94\u7EBF\u8C31")]),value:()=>e(j,{name:"staff"},{icon:s=>e(I,{class:a.boxStyle,size:16,name:s.checked?V:$},null)})}),e(N,{center:!0,border:!1,class:d.radio==="first"?a.active:"",onClick:()=>L("first")},{icon:()=>e(h,{src:ft,class:a.staffImg},null),title:()=>e("span",{class:a.name},[i("\u7B80\u8C31-\u9996\u8C03")]),value:()=>e(j,{name:"first"},{icon:s=>e(I,{class:a.boxStyle,size:16,name:s.checked?V:$},null)})}),e(N,{center:!0,border:!1,class:d.radio==="fixed"?a.active:"",onClick:()=>L("fixed")},{icon:()=>e(h,{src:_t,class:a.staffImg},null),title:()=>e("span",{class:a.name},[i("\u7B80\u8C31-\u56FA\u5B9A\u8C03")]),value:()=>e(j,{name:"fixed"},{icon:s=>e(I,{class:a.boxStyle,size:16,name:s.checked?V:$},null)})})]})]})])]}),e(B,{teleport:"body",position:"bottom",round:!0,show:l.open,"onUpdate:show":s=>l.open=s},{default:()=>[e(ht,{columns:Fe.value,onConfirm:s=>{l.open=!1,l.partIndex=s.value,me(()=>{xe()})},onCancel:()=>l.open=!1},null)]})])}}});export{Wa as default,fe as getAssetsHomeFile};
|