1 |
- import{d as Z,O as ee,S as l,Q as te,y as se,a2 as ae,U as oe,X as $,V as le,j as e,F as D,z as u,M as S,B as ue,aR as K,w as Q,g as ne,f as ie}from"./index.e6d6174e.js";import{C as ce}from"./index.045f03fd.js";import{C as x}from"./index.af99cf22.js";import{C as re}from"./index.4aea64de.js";import{I as _}from"./index.67c54471.js";import{R as me,a as T}from"./index.cbc70232.js";import"./index.d92a5aca.js";import{S as fe}from"./index.9093bc60.js";import{T as de}from"./index.05f2b7dd.js";import{V as _e}from"./vue3-lottie.es.c81d4d12.js";import{g as pe}from"./music.ce788382.js";import{C as ve}from"./index.b0eda115.js";import{i as he}from"./icon_album.fa329df6.js";import{i as ge,a as Ce,A as ye,e as be,b as Ie,c as je,d as Se,D as xe,s as we,f as Fe,g as Ee}from"./download.40922bf6.js";import{i as ke}from"./icon_teacher.40b6f077.js";import{a as A,i as B}from"./icon_checkbox_default.2fe5d57e.js";import{P as De}from"./plyr.623e6d1e.js";import{i as Te}from"./icon_exquisite.69e33c80.js";import{i as Ae}from"./icon_album_active.ce98b2a8.js";import{w as Be}from"./wx_bg.cce2a6c0.js";import{i as Ne,s as Le}from"./share.57719e8d.js";import"./index.d8c651bf.js";import"./use-height.8140ea04.js";import"./index.b4a53c6a.js";const Ve="_base_1urjh_1",qe="_detail_1urjh_4",Re="_shareBtn_1urjh_21",Pe="_bgImg_1urjh_33",Ue="_bgContent_1urjh_42",Oe="_musicContent_1urjh_51",ze="_musicTitle_1urjh_66",Me="_musicImg_1urjh_70",Ge="_finch_1urjh_73",Je="_finchLoad_1urjh_77",He="_collectCell_1urjh_92",$e="_videoOperation_1urjh_99",Ke="_audition_1urjh_106",Qe="_collect_1urjh_92",Xe="_userInfo_1urjh_132",We="_collectSection_1urjh_152",Ye="_lookAlbum_1urjh_171",Ze="_bg_1urjh_33",et="_musicContainer_1urjh_197",tt="_shareMate_1urjh_204",st="_icon_1urjh_214",at="_info_1urjh_219",ot="_tagDiscount_1urjh_235",lt="_shareVip_1urjh_248",ut="_buttonDiscount_1urjh_290",nt="_pImg_1urjh_303",it="_musicInfo_1urjh_310",ct="_coomposer_1urjh_315",rt="_tag_1urjh_235",mt="_download_1urjh_349",ft="_exquisiteFlag_1urjh_360",dt="_songAlbum_1urjh_365",_t="_colSticky_1urjh_375",pt="_priceSection_1urjh_380",vt="_price_1urjh_380",ht="_buyBtn_1urjh_394",gt="_primry_1urjh_408",Ct="_member_1urjh_411",yt="_functionSection_1urjh_414",bt="_empty_1urjh_417",It="_emptyImg_1urjh_425",jt="_staffContainer_1urjh_428",St="_staffTitle_1urjh_431",xt="_staffImg_1urjh_437",wt="_name_1urjh_441",Ft="_boxStyle_1urjh_447",Et="_active_1urjh_453";var t={base:Ve,detail:qe,shareBtn:Re,bgImg:Pe,bgContent:Ue,musicContent:Oe,musicTitle:ze,musicImg:Me,finch:Ge,finchLoad:Je,collectCell:He,videoOperation:$e,audition:Ke,collect:Qe,userInfo:Xe,collectSection:We,lookAlbum:Ye,bg:Ze,musicContainer:et,shareMate:tt,icon:st,info:at,tagDiscount:ot,shareVip:lt,buttonDiscount:ut,pImg:nt,musicInfo:it,coomposer:ct,tag:rt,download:mt,exquisiteFlag:ft,songAlbum:dt,colSticky:_t,priceSection:pt,price:vt,buyBtn:ht,primry:gt,member:Ct,functionSection:yt,empty:bt,emptyImg:It,staffContainer:jt,staffTitle:St,staffImg:xt,name:wt,boxStyle:Ft,active:Et},Zt=Z({name:"MusicDetail",setup(){localStorage.setItem("behaviorId",pe());const N=ee(),I=l(!1),L=l(!1),V=l(null),q=l(null),R=l("0"),s=l(null),h=l(""),w=l(!1);let f=[];const P=l([]),U=l([]),O=l([]);l("");const z=l(!1),i=te({status:!1,radio:"staff"}),X=`${location.origin}/student/#/music-detail?${se.stringify(N.query)}`,M=l(X),G={FREE:{color:"#01B84F",text:"\u514D\u8D39"},VIP:{color:"#CD863E",text:"\u4F1A\u5458"},CHARGE:{color:"#3591CE",text:"\u70B9\u64AD"}},F=o=>{i.radio=o,i.status=!1};ae(()=>i.radio,o=>{o=="first"?f=P.value:o=="fixed"?f=U.value:f=O.value});const W=async o=>{var n,r,c,d,m,C,y,a;if(!I.value){I.value=!0,L.value=!1;try{const p=N.query,b=await Q.post("/open/musicShareProfit",{prefix:"/api-teacher",requestType:"json",data:{bizId:p.id,userId:p.recomUserId}}),v=b.data.musicSheet.background;h.value=v&&v.length>0?v[0].audioFileUrl:"",console.log(h.value),s.value=b.data.musicSheet,f=(n=s.value)!=null&&n.musicImg?(r=s.value)==null?void 0:r.musicImg.split(","):[],P.value=(c=s.value)!=null&&c.firstTone?(d=s.value)==null?void 0:d.firstTone.split(","):[],U.value=(m=s.value)!=null&&m.fixedTone?(C=s.value)==null?void 0:C.fixedTone.split(","):[],O.value=(y=s.value)!=null&&y.musicImg?(a=s.value)==null?void 0:a.musicImg.split(","):[]}catch{L.value=!0}I.value=!1}},E=l(null),J=l(null),k=l(0),Y=async()=>{var r;const o=await Q.get(ne.platformApi+"/sysConfig/queryByParamNameList",{params:{paramNames:"music_sheet_free_rate"}});k.value=((r=o.data[0])==null?void 0:r.paramValue)||0;const n=["play","progress","duration"];E.value=new De(J.value,{controls:n}),E.value.on("timeupdate",()=>{var m;const c=E.value,d=c.duration*k.value/100||0;c.currentTime>=d&&((m=s.value)==null?void 0:m.orderStatus)!=="PAID"&&!j.value.includes("FREE")&&c.pause()})};oe(async()=>{Ne(M.value),await W();const{height:o}=$(V),n=$(q);R.value=o+n.height,h.value&&Y()});const j=le(()=>{var n;let o=(n=s.value)==null?void 0:n.paymentType;return typeof o=="string"?(o=o.split(","),o):[]}),g=()=>{if(ie().weixin){w.value=!0;return}Le(M.value),setTimeout(()=>{window.location.href=location.origin+"/student/#/download"},3e3)};return()=>{var o,n,r,c,d,m,C,y;return e("div",{class:t.detail},[e(fe,{position:"top"},{default:()=>[e("div",{ref:V},[e(ce,{background:"transparent",border:!1,isFixed:!1,color:"#fff",backIconColor:"white"},null)])]}),e("img",{class:t.bgImg,src:(o=s.value)==null?void 0:o.titleImg},null),e("div",{class:t.bgContent},null),e("div",{class:t.musicContainer,style:{marginTop:"16px",height:`calc(100vh - ${R.value+16+"px"})`}},[e(x,{border:!1,center:!0,class:t.musicInfo},{icon:()=>{var a;return e(_,{class:t.pImg,src:(a=s.value)==null?void 0:a.titleImg},null)},title:()=>{var a,p,b,v;return e("div",{class:t.info},[e("h4",{class:"van-ellipsis"},[(a=s.value)==null?void 0:a.musicSheetName]),e("p",{style:{display:"flex"}},[j.value.map(H=>e(de,{style:{color:G[H].color},class:t.tag,type:"success",plain:!0},{default:()=>[G[H].text]})),((p=s.value)==null?void 0:p.exquisiteFlag)===1&&e(_,{class:t.exquisiteFlag,src:Te},null),((b=s.value)==null?void 0:b.albumNums)>0&&e(_,{class:t.songAlbum,src:Ae},null),e("span",{style:{paddingTop:"2px",paddingLeft:"6px"}},[(v=s.value)==null?void 0:v.composer])])])},value:()=>{var a;return e(D,null,[(a=s.value)!=null&&a.notation?e("span",{class:t.download,onClick:()=>g()},[e("img",{src:ge},null),e("span",null,[u("\u8F6C\u8C31")])]):null,e("span",{class:t.download,onClick:()=>g()},[e("img",{src:Ce},null),e("span",null,[u("\u4E0B\u8F7D\u66F2\u8C31")])])])}}),e("div",{class:t.musicContent},[e("p",{class:t.musicTitle},[(n=s.value)==null?void 0:n.musicSheetName]),f.length>0?e("img",{src:f[0],alt:"",class:t.musicImg},null):I.value?e(D,null,[e(_e,{animationData:ye,class:t.finch},null),e("p",{class:t.finchLoad},[u("\u52A0\u8F7D\u4E2D...")])]):e("div",{class:t.empty},[e(_,{src:be,class:t.emptyImg},null),e("p",{class:t.emptyTip},[u("\u6682\u65E0\u4E50\u8C31\u9884\u89C8\u56FE")])]),e("div",{class:t.videoOperation},[h.value&&e(D,null,[(j.value.includes("CHARGE")||j.value.includes("VIP"))&&((r=s.value)==null?void 0:r.orderStatus)!=="PAID"&&e("div",{class:[t.audition]},[e("img",{src:Ie},null),e("span",null,[u("\u6BCF\u9996\u66F2\u76EE\u53EF\u8BD5\u542C"),k.value,u("%")])]),e("div",{class:[t.audio,t.collectCell]},[e("audio",{id:"player",controls:!0,ref:J},[e("source",{src:h.value,type:"audio/mp3"},null)])])]),e("div",{class:[t.collect,t.collectCell]},[e("div",{class:[t.userInfo]},[e("img",{src:((c=s.value)==null?void 0:c.userAvatar)||ke},null),e("span",null,[(d=s.value)==null?void 0:d.userName])]),e("div",{class:[t.collectSection],onClick:()=>g()},[e("span",null,[(m=s.value)==null?void 0:m.favoriteCount,u("\u4EBA\u6536\u85CF")]),e("img",{src:(C=s.value)!=null&&C.favorite?je:Se},null)])])])]),e("div",{class:[t.lookAlbum,t.collectCell],onClick:()=>{g()}},[e("div",null,[e("img",{src:he},null),e("span",null,[u("\u8FDB\u5165\u66F2\u76EE\u6240\u5728\u4E13\u8F91\u5217\u8868")])]),e(S,{name:"arrow",size:16,color:"#666"},null)])]),((y=s.value)==null?void 0:y.id)&&e(ve,{position:"bottom",background:"white"},{default:()=>[e("div",{ref:q},[e(ue,{round:!0,block:!0,type:"primary",color:"linear-gradient(180deg, #59E5D5 0%, #2DC7AA 100%)",onClick:()=>g()},{default:()=>[u("\u4E0B\u8F7D\u9177\u4E50\u79C0\u8FDB\u5165\u8BE6\u60C5")]})])]}),e(K,{show:z.value,"onUpdate:show":a=>z.value=a,position:"bottom",round:!0},{default:()=>[e(xe,{imgList:JSON.parse(JSON.stringify(f)),musicSheetName:s.value.musicSheetName},null)]}),e(K,{show:i.status,"onUpdate:show":a=>i.status=a,teleport:"body",closeable:!0,style:{width:"80%"},round:!0},{default:()=>[e("div",{class:t.staffContainer},[e("div",{class:t.staffTitle},[u("\u9009\u62E9\u8F6C\u6362\u66F2\u8C31")]),e(me,{modelValue:i.radio,"onUpdate:modelValue":a=>i.radio=a},{default:()=>[e(re,{border:!1},{default:()=>[e(x,{center:!0,border:!1,class:i.radio==="staff"?t.active:"",onClick:()=>F("staff")},{icon:()=>e(_,{src:we,class:t.staffImg},null),title:()=>e("span",{class:t.name},[u("\u4E94\u7EBF\u8C31")]),value:()=>e(T,{name:"staff"},{icon:a=>e(S,{class:t.boxStyle,size:16,name:a.checked?A:B},null)})}),e(x,{center:!0,border:!1,class:i.radio==="first"?t.active:"",onClick:()=>F("first")},{icon:()=>e(_,{src:Fe,class:t.staffImg},null),title:()=>e("span",{class:t.name},[u("\u7B80\u8C31-\u9996\u8C03")]),value:()=>e(T,{name:"first"},{icon:a=>e(S,{class:t.boxStyle,size:16,name:a.checked?A:B},null)})}),e(x,{center:!0,border:!1,class:i.radio==="fixed"?t.active:"",onClick:()=>F("fixed")},{icon:()=>e(_,{src:Ee,class:t.staffImg},null),title:()=>e("span",{class:t.name},[u("\u7B80\u8C31-\u56FA\u5B9A\u8C03")]),value:()=>e(T,{name:"fixed"},{icon:a=>e(S,{class:t.boxStyle,size:16,name:a.checked?A:B},null)})})]})]})])]}),w.value&&e("div",{class:t.wxpopup,onClick:()=>{w.value=!1}},[e("img",{src:Be,alt:""},null)])])}}});export{Zt as default};
|