index-45e9afd1.js 9.8 KB

1
  1. import{d as U,aO as Q,x as p,r as f,e as D,w as m,y as S,a,I as u,Q as k,A as b,aN as d}from"./index-521a9826.js";import{b as h}from"./browser-504037ee.js";import{I as B}from"./index-25b5c9d0.js";import{S as F}from"./index-631128d0.js";import{C as L}from"./index-1ad6a58d.js";const T="_audioPlayer_r8rw7_1",G="_playerHeader_r8rw7_4",N="_musicInfo_r8rw7_10",V="_cover_r8rw7_14",P="_rotateImg_r8rw7_1",R="_imgRotate_r8rw7_26",K="_musicBg_r8rw7_29",M="_musicName_r8rw7_35",Y="_controls_r8rw7_47",O="_icon_r8rw7_47",I="_iconMenu_r8rw7_51",j="_playerFooter_r8rw7_54",H="_playerTimer_r8rw7_70",W="_songPopup_r8rw7_79",Z="_songContainer_r8rw7_83",J="_songTitle_r8rw7_92",x="_songCell_r8rw7_113",X="_active_r8rw7_119",z="_songName_r8rw7_122",q="_songImg_r8rw7_133",_="_iconSong_r8rw7_151",e={audioPlayer:T,playerHeader:G,musicInfo:N,cover:V,rotateImg:P,imgRotate:R,musicBg:K,musicName:M,controls:Y,icon:O,iconMenu:I,playerFooter:j,playerTimer:H,songPopup:W,songContainer:Z,songTitle:J,songCell:x,active:X,songName:z,songImg:q,iconSong:_},E=""+new URL("music_bg-7bc33289.png",import.meta.url).href,$="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAmCAYAAACsyDmTAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAJKADAAQAAAABAAAAJgAAAABQzrCcAAACi0lEQVRYCWNgGOzg////jA4eCQoNDQ1MA+FWZnRL9x+/s+7f/78z7j95lyCvov/40d1L19HV0JLPiGy4Q2gWz9+PHz4jizEwMuxh/s+We2DXghso4jTioEbL728sGPb8Z3D5y/D7kp1HTLefXxIvhjyVBVBDKCBB4O+3X+9x2cHIyPic4T9j6aFdS5aiqwGlvf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ndlJrn7N/4og+NUrgFAZAAAAAElFTkSuQmCC",cA=U({name:"audio-player",props:{musicList:{type:Array,default:()=>[]}},setup(r){const y=Q(),A=p({songPopup:!1,musicListenList:r.musicList||[],playState:"pause",audioObj:{},listActive:0,dragStatus:!1});let l=null;const i=p({isFirst:!0,duration:.1,currentTime:0}),o=f(),C=()=>{if(i.duration=o.value.duration,i.isFirst){i.isFirst=!1;return}A.playState==="play"&&o.value.play()},v=s=>{o.value.pause(),i.currentTime=s,clearTimeout(l),l=setTimeout(()=>{o.value.currentTime=s,A.playState==="play"&&o.value.play(),l=null},300)},w=D(()=>`${d(i.currentTime)} / ${d(i.duration)}`),g=s=>{const t=A.musicListenList.findIndex(n=>n.id===s.id);t>-1&&(A.listActive===t?A.playState=A.playState==="play"?"pause":"play":A.playState="play",A.listActive=t,A.audioObj=A.musicListenList[t])},c=s=>{s==="play"?A.playState="play":s==="pause"?A.playState="pause":s==="pre"?A.musicListenList[A.listActive-1]&&(i.currentTime=0,g(A.musicListenList[A.listActive-1])):s==="next"&&A.musicListenList[A.listActive+1]&&(i.currentTime=0,g(A.musicListenList[A.listActive+1]))};return m(()=>y.value,s=>{s==="hidden"&&(o.value.pause(),A.playState="pause")}),m(()=>A.playState,s=>{s==="play"?o.value.play():o.value.pause()}),m(()=>r.musicList,()=>{A.musicListenList=r.musicList;const s=r.musicList;s.length>0&&(A.audioObj=s[0])}),S(()=>{h.nextTick(()=>{const s=r.musicList;s.length>0&&(A.audioObj=s[0])})}),()=>{var s;return a("div",{class:e.audioPlayer},[a("div",{class:e.playerHeader},[a("div",{class:e.musicInfo},[a("div",{class:[e.cover,A.playState==="pause"&&e.imgRotate]},[a(B,{src:E,class:e.musicBg},null)]),a("div",{class:e.musicName},[((s=A.audioObj)==null?void 0:s.name)||"--"])]),a("div",{class:e.controls},[a(u,{name:sA,class:e.icon,onClick:()=>{c("pre")}},null),a(u,{name:A.playState==="play"?eA:AA,class:[e.icon,e.iconPlay],onClick:()=>{A.playState==="pause"?c("play"):c("pause")}},null),a(u,{name:aA,class:e.icon,onClick:()=>{c("next")}},null),a(u,{name:$,class:[e.icon,e.iconMenu],onClick:()=>{A.songPopup=!0}},null)])]),a("div",{class:e.playerFooter},[a(F,{step:.01,class:e.timeProgress,modelValue:i.currentTime,"onUpdate:modelValue":[t=>i.currentTime=t,t=>{v(t)}],max:i.duration,onDragStart:()=>{A.dragStatus=!0},onDragEnd:()=>{A.dragStatus=!1}},null),a("div",{class:e.playerTimer},[w.value]),a("audio",{ref:o,src:A.audioObj.url,onLoadedmetadata:C,onEnded:()=>{c("pause")},onTimeupdate:()=>{var t;l||A.dragStatus||(A.playState==="pause"&&o.value.pause(),i.currentTime=(t=o.value)==null?void 0:t.currentTime)}},null)]),a(k,{show:A.songPopup,"onUpdate:show":t=>A.songPopup=t,round:!0,position:"bottom",class:e.songPopup},{default:()=>[a("div",{class:e.songContainer},[a("div",{class:e.songTitle},[b("代表作")]),a("div",{class:e.songCellGroup},[A.musicListenList.map((t,n)=>a(L,{border:!1,class:[e.songCell,n===A.listActive&&e.active],center:!0,onClick:()=>{n!==A.listActive&&(A.audioObj=A.musicListenList[n],A.listActive=n,A.playState="play")}},{icon:()=>a(B,{src:E,class:e.songImg},null),title:()=>a("div",{class:e.songName},[t.name])}))])])]})])}}});export{cA as A,E as m};