1 |
- import{d as Z,P as ss,U as l,S as es,v as os,a3 as ts,V as as,Y as H,W as ls,j as s,F as T,A as n,N as x,B as ns,aS as K,y as W,g as is,f as cs}from"./ResizeObserver.es.f28023e0.js";import{C as us}from"./index.bd375ca9.js";import{C as w}from"./index.3b2e70c8.js";import{C as rs}from"./index.2a22730e.js";import{I as p}from"./index.7a1af785.js";import{R as ms,a as B}from"./index.697873a0.js";import"./index.49ee134a.js";import{S as ds}from"./index.b0753b8c.js";import{T as fs}from"./index.af901340.js";import{V as ps}from"./vue3-lottie.es.7c2a1ab2.js";import{g as _s}from"./music.96a1c334.js";import{C as vs}from"./index.8c937010.js";import{i as gs}from"./icon_album.eca1da54.js";import{i as Cs,a as ys,A as bs,e as hs,b as Is,c as Ss,d as xs,D as ws,s as Fs,f as Es,g as ks}from"./download.12ca5c67.js";import{i as Ds}from"./icon_teacher.40b6f077.js";import{a as N,i as q}from"./icon_checkbox_default.2fe5d57e.js";import{P as As}from"./plyr.min.0a479001.js";/* empty css */import{i as Ts}from"./icon_exquisite.7cf228c5.js";import{i as Bs}from"./icon_album_active.a67a159e.js";import{w as Ns}from"./wx_bg.cce2a6c0.js";import{i as qs,s as Ls}from"./share.630c329d.js";import"./index.9a41251d.js";import"./index.966d1893.js";const Vs="_base_11dos_1",Ps="_detail_11dos_4",Rs="_wxpopup_11dos_18",Us="_shareBtn_11dos_34",Os="_bgImg_11dos_46",zs="_bgContent_11dos_55",Ms="_musicContent_11dos_64",Gs="_musicTitle_11dos_79",Js="_musicImg_11dos_83",$s="_finch_11dos_86",js="_finchLoad_11dos_90",Hs="_collectCell_11dos_105",Ks="_videoOperation_11dos_112",Ws="_audition_11dos_119",Ys="_collect_11dos_105",Qs="_userInfo_11dos_145",Xs="_collectSection_11dos_165",Zs="_lookAlbum_11dos_184",se="_bg_11dos_46",ee="_musicContainer_11dos_210",oe="_shareMate_11dos_217",te="_icon_11dos_227",ae="_info_11dos_232",le="_tagDiscount_11dos_248",ne="_shareVip_11dos_261",ie="_buttonDiscount_11dos_303",ce="_pImg_11dos_316",ue="_musicInfo_11dos_323",re="_coomposer_11dos_328",me="_tag_11dos_248",de="_download_11dos_362",fe="_exquisiteFlag_11dos_373",pe="_songAlbum_11dos_378",_e="_colSticky_11dos_388",ve="_priceSection_11dos_393",ge="_price_11dos_393",Ce="_buyBtn_11dos_407",ye="_primry_11dos_421",be="_member_11dos_424",he="_functionSection_11dos_427",Ie="_empty_11dos_430",Se="_emptyImg_11dos_438",xe="_staffContainer_11dos_441",we="_staffTitle_11dos_444",Fe="_staffImg_11dos_450",Ee="_name_11dos_454",ke="_boxStyle_11dos_460",De="_active_11dos_466";var e={base:Vs,detail:Ps,wxpopup:Rs,shareBtn:Us,bgImg:Os,bgContent:zs,musicContent:Ms,musicTitle:Gs,musicImg:Js,finch:$s,finchLoad:js,collectCell:Hs,videoOperation:Ks,audition:Ws,collect:Ys,userInfo:Qs,collectSection:Xs,lookAlbum:Zs,bg:se,musicContainer:ee,shareMate:oe,icon:te,info:ae,tagDiscount:le,shareVip:ne,buttonDiscount:ie,pImg:ce,musicInfo:ue,coomposer:re,tag:me,download:de,exquisiteFlag:fe,songAlbum:pe,colSticky:_e,priceSection:ve,price:ge,buyBtn:Ce,primry:ye,member:be,functionSection:he,empty:Ie,emptyImg:Se,staffContainer:xe,staffTitle:we,staffImg:Fe,name:Ee,boxStyle:ke,active:De},so=Z({name:"MusicDetail",setup(){localStorage.setItem("behaviorId",_s());const F=ss(),I=l(!1),L=l(!1),V=l(null),P=l(null),R=l("0"),o=l(null),g=l(""),E=l(!1);let d=[];const U=l([]),O=l([]),z=l([]);l("");const M=l(!1),c=es({status:!1,radio:"staff"}),Y=`${location.origin}/${F.query.p=="tenant"?"tenant":"student"}/#/music-detail?${os.stringify(F.query)}`,G=l(Y),J={FREE:{color:"#01B84F",text:"\u514D\u8D39"},VIP:{color:"#CD863E",text:"\u4F1A\u5458"},CHARGE:{color:"#3591CE",text:"\u70B9\u64AD"}},k=a=>{c.radio=a,c.status=!1};ts(()=>c.radio,a=>{a=="first"?d=U.value:a=="fixed"?d=O.value:d=z.value});const Q=async a=>{var i,r,u,f,m,y,b,t;if(!I.value){I.value=!0,L.value=!1;try{const _=F.query,h=await W.post("/open/musicShareProfit",{prefix:"/api-teacher",requestType:"json",data:{bizId:_.id,userId:_.recomUserId}}),v=h.data.musicSheet.background;g.value=v&&v.length>0?v[0].audioFileUrl:"",console.log(g.value),o.value=h.data.musicSheet,d=(i=o.value)!=null&&i.musicImg?(r=o.value)==null?void 0:r.musicImg.split(","):[],U.value=(u=o.value)!=null&&u.firstTone?(f=o.value)==null?void 0:f.firstTone.split(","):[],O.value=(m=o.value)!=null&&m.fixedTone?(y=o.value)==null?void 0:y.fixedTone.split(","):[],z.value=(b=o.value)!=null&&b.musicImg?(t=o.value)==null?void 0:t.musicImg.split(","):[]}catch{L.value=!0}I.value=!1}},D=l(null),$=l(null),A=l(0),X=async()=>{var r;const a=await W.get(is.platformApi+"/sysConfig/queryByParamNameList",{params:{paramNames:"music_sheet_free_rate"}});A.value=((r=a.data[0])==null?void 0:r.paramValue)||0;const i=["play","progress","duration"];D.value=new As($.value,{controls:i}),D.value.on("timeupdate",()=>{var m;const u=D.value,f=u.duration*A.value/100||0;u.currentTime>=f&&((m=o.value)==null?void 0:m.orderStatus)!=="PAID"&&!S.value.includes("FREE")&&u.pause()})};as(async()=>{qs(G.value),await Q();const{height:a}=H(V),i=H(P);R.value=a+i.height,g.value&&X()});const S=ls(()=>{var i;let a=(i=o.value)==null?void 0:i.paymentType;return typeof a=="string"?(a=a.split(","),a):[]}),C=()=>{if(cs().weixin){E.value=!0;return}Ls(G.value),setTimeout(()=>{window.location.href=location.origin+"/student/#/download"},3e3)};return()=>{var a,i,r,u,f,m,y,b;return s("div",{class:e.detail},[s(ds,{position:"top"},{default:()=>[s("div",{ref:V},[s(us,{background:"transparent",border:!1,isFixed:!1,color:"#fff",backIconColor:"white"},null)])]}),s("img",{class:e.bgImg,src:(a=o.value)==null?void 0:a.titleImg},null),s("div",{class:e.bgContent},null),s("div",{class:e.musicContainer,style:{marginTop:"16px",height:`calc(100vh - ${R.value+16+"px"})`}},[s(w,{border:!1,center:!0,class:e.musicInfo},{icon:()=>{var t;return s(p,{class:e.pImg,src:(t=o.value)==null?void 0:t.titleImg},null)},title:()=>{var t,_,h,v;return s("div",{class:e.info},[s("h4",{class:"van-ellipsis"},[(t=o.value)==null?void 0:t.musicSheetName]),s("p",{style:{display:"flex"}},[S.value.map(j=>s(fs,{style:{color:J[j].color},class:e.tag,type:"success",plain:!0},{default:()=>[J[j].text]})),((_=o.value)==null?void 0:_.exquisiteFlag)===1&&s(p,{class:e.exquisiteFlag,src:Ts},null),((h=o.value)==null?void 0:h.albumNums)>0&&s(p,{class:e.songAlbum,src:Bs},null),s("span",{style:{paddingTop:"2px",paddingLeft:"6px"}},[(v=o.value)==null?void 0:v.composer])])])},value:()=>{var t;return s(T,null,[(t=o.value)!=null&&t.notation?s("span",{class:e.download,onClick:()=>C()},[s("img",{src:Cs},null),s("span",null,[n("\u8F6C\u8C31")])]):null,s("span",{class:e.download,onClick:()=>C()},[s("img",{src:ys},null),s("span",null,[n("\u4E0B\u8F7D\u66F2\u8C31")])])])}}),s("div",{class:e.musicContent},[s("p",{class:e.musicTitle},[(i=o.value)==null?void 0:i.musicSheetName]),d.length>0?s("img",{src:d[0],alt:"",class:e.musicImg},null):I.value?s(T,null,[s(ps,{animationData:bs,class:e.finch},null),s("p",{class:e.finchLoad},[n("\u52A0\u8F7D\u4E2D...")])]):s("div",{class:e.empty},[s(p,{src:hs,class:e.emptyImg},null),s("p",{class:e.emptyTip},[n("\u6682\u65E0\u4E50\u8C31\u9884\u89C8\u56FE")])]),s("div",{class:e.videoOperation},[g.value&&s(T,null,[(S.value.includes("CHARGE")||S.value.includes("VIP"))&&((r=o.value)==null?void 0:r.orderStatus)!=="PAID"&&s("div",{class:[e.audition]},[s("img",{src:Is},null),s("span",null,[n("\u6BCF\u9996\u66F2\u76EE\u53EF\u8BD5\u542C"),A.value,n("%")])]),s("div",{class:[e.audio,e.collectCell]},[s("audio",{id:"player",controls:!0,ref:$},[s("source",{src:g.value,type:"audio/mp3"},null)])])]),s("div",{class:[e.collect,e.collectCell]},[s("div",{class:[e.userInfo]},[s("img",{src:((u=o.value)==null?void 0:u.userAvatar)||Ds},null),s("span",null,[(f=o.value)==null?void 0:f.userName])]),s("div",{class:[e.collectSection],onClick:()=>C()},[s("span",null,[(m=o.value)==null?void 0:m.favoriteCount,n("\u4EBA\u6536\u85CF")]),s("img",{src:(y=o.value)!=null&&y.favorite?Ss:xs},null)])])])]),s("div",{class:[e.lookAlbum,e.collectCell],onClick:()=>{C()}},[s("div",null,[s("img",{src:gs},null),s("span",null,[n("\u8FDB\u5165\u66F2\u76EE\u6240\u5728\u4E13\u8F91\u5217\u8868")])]),s(x,{name:"arrow",size:16,color:"#666"},null)])]),((b=o.value)==null?void 0:b.id)&&s(vs,{position:"bottom",background:"white"},{default:()=>[s("div",{ref:P},[s(ns,{round:!0,block:!0,type:"primary",color:"linear-gradient(180deg, #59E5D5 0%, #2DC7AA 100%)",onClick:()=>C()},{default:()=>[n("\u4E0B\u8F7D\u9177\u4E50\u79C0\u8FDB\u5165\u8BE6\u60C5")]})])]}),s(K,{show:M.value,"onUpdate:show":t=>M.value=t,position:"bottom",round:!0},{default:()=>[s(ws,{imgList:JSON.parse(JSON.stringify(d)),musicSheetName:o.value.musicSheetName},null)]}),s(K,{show:c.status,"onUpdate:show":t=>c.status=t,teleport:"body",closeable:!0,style:{width:"80%"},round:!0},{default:()=>[s("div",{class:e.staffContainer},[s("div",{class:e.staffTitle},[n("\u9009\u62E9\u8F6C\u6362\u66F2\u8C31")]),s(ms,{modelValue:c.radio,"onUpdate:modelValue":t=>c.radio=t},{default:()=>[s(rs,{border:!1},{default:()=>[s(w,{center:!0,border:!1,class:c.radio==="staff"?e.active:"",onClick:()=>k("staff")},{icon:()=>s(p,{src:Fs,class:e.staffImg},null),title:()=>s("span",{class:e.name},[n("\u4E94\u7EBF\u8C31")]),value:()=>s(B,{name:"staff"},{icon:t=>s(x,{class:e.boxStyle,size:16,name:t.checked?N:q},null)})}),s(w,{center:!0,border:!1,class:c.radio==="first"?e.active:"",onClick:()=>k("first")},{icon:()=>s(p,{src:Es,class:e.staffImg},null),title:()=>s("span",{class:e.name},[n("\u7B80\u8C31-\u9996\u8C03")]),value:()=>s(B,{name:"first"},{icon:t=>s(x,{class:e.boxStyle,size:16,name:t.checked?N:q},null)})}),s(w,{center:!0,border:!1,class:c.radio==="fixed"?e.active:"",onClick:()=>k("fixed")},{icon:()=>s(p,{src:ks,class:e.staffImg},null),title:()=>s("span",{class:e.name},[n("\u7B80\u8C31-\u56FA\u5B9A\u8C03")]),value:()=>s(B,{name:"fixed"},{icon:t=>s(x,{class:e.boxStyle,size:16,name:t.checked?N:q},null)})})]})]})])]}),E.value&&s("div",{class:e.wxpopup,onClick:()=>{E.value=!1}},[s("img",{src:Ns,alt:""},null)])])}}});export{so as default};
|