1 |
- import{d as R,r as U,x as F,a as s,A as r,C as x,j as W,M as D,N as C,D as M,E as B,G as N,J as q,P as K,q as z,aO as Q,w as L,y as _,Q as H,c0 as G,aN as k,b3 as j,a2 as O,R as Z,S as J,c1 as X}from"./index-869d77fb.js";import{s as t,i as Y,a as $,b as ee,c as se}from"./icon-pause-1cf5b5e0.js";import{v as ae,e as E,f as te,g as oe,h as ie}from"./video-bg-baa82a7b.js";import{b as I}from"./browser-504037ee.js";import{M as ne}from"./index-4e4433c1.js";import{M as le}from"./index-b9d9d40c.js";import{F as v}from"./index-0153d173.js";import{C as ue,M as ce}from"./index-4a265525.js";import{S as re}from"./index-43d9e077.js";import{I as g}from"./index-e76f2a88.js";import{C as de}from"./index-1c6c2ec0.js";import{L as me}from"./index-f12c44b8.js";import"./tcplayer.v4.8.0.min-74106fe8.js";import"./index-8150a3e4.js";import"./use-tab-status-0ed30c24.js";const pe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAYAAADhAJiYAAAAAXNSR0IArs4c6QAAA8dJREFUWEftmE9oHFUcx7+/N50kk0NBbVGRgha01HpRIlKKptqLhxZ6qV4FRUShJjH73pvEkqkYZ36zoKk3kXq1QsBDFRGEaqVWKj0pKCIUWhQP1Vq0TcSd95O3ZMNm2aa7426Sg7/Tzr6Z9/vM9/3+7RI2mNEG48F/AtJa7ySiKoC9AK4A+BDAEWa+WvZFSwNNTk7eEwTBeQC3NDsnojNDQ0N7kySplYEqDaS1foeIngfwSVEUz4RhuMU5dxLAdhE5lOf5/JoCGWPOAXgYwB5m/so711qPEdFbAN5lZg/btZVWyBjzI4B7lVI70jT1nz3QPiL6DMApZn6iaxqgXFCPj49HAwMDV0Rk0/Dw8OYkSa5755VK5SGllI+r88w8smZAWuuDROQz6hwzP9JwHMfxo8650wBOM/PoWgGRtfaMiOwWkZfzPH+74dgY8xSADwDMM/OhNQEyxkwC8LXnlyiKdiRJ8lcT0JsAxonoaJZlSd+BrLUviohXxCfDQWb2ab5s1tpvReQBAKPM7I+ua+soy6y1D4rIUQAHRESUUq9kWebTe9mMMbsAfLf0xQUABQBpIfLX14jobBAE2ezs7KVW4hVA09PTd9VqtQyAf8vGmt/EOwt9e3DOvVStVt9v3cha+7qITHchyWUi2p1l2U/Nz6wAMsacWupLN9r3SWb+tN3i2NjYnWEYDg8ODtaXa7Xair2LoqhfK6W2AngNwL52wd8K9DeAASIaUUr909gEwNcAhpRSj6Vp+mUXKrS9dWpq6vaiKH71ijPzrasp5M9dRVEUJEnimrLHF76oV0BxHN/mnLsM4E9m3rzuQJVKZb9S6qSIfJHnuR9dlq31yOoKZVmmiGg5Q4wxPVXIWvuGiMRElGZZNrXuQFrrz4lo1Dl3oFqtfnRTIGZWzTWklwolSbJpYWHhqohEQRBsTdP0t9WAfCBTP4G01iNE9A2AH5h556qF0RjTd6A4jg87544BeI+Zn+0UqDXYexbUWusTRPS0iDyX5/nxjQB0kYi2icj9eZ5/v65AExMT28IwvAjgd2be0qb5rhxhjTH12sPMfTkya60/qhMAPmbm/e36SqvjfgMdE5HDIvJqnueznQDVsyyKonBmZqZoVOte1CFr7d0ichbAHasNcK0K+QHLzz5tTUQuEFH9F0bDmltMu4eccyAi72e7b9BL/evxdvHjn28d0EaKojjunNu1tIlf72iq7GAk8YrPLy4uvjA3N/fHje7vyFkcx/c55/zEWMqUUuKc+7mTPyE6AipFUfKh/4FuJtyGU+hfID3aNIv87yAAAAAASUVORK5CYII=",Ae="_loginModel_1wz3k_1",ge="_iconClose_1wz3k_7",fe="_loginSection_1wz3k_17",Se="_fieldSection_1wz3k_20",ye="_icon_1wz3k_7",he="_codeText_1wz3k_37",ve="_btnGroup_1wz3k_41",Te="_btnText_1wz3k_41",u={loginModel:Ae,iconClose:ge,loginSection:fe,fieldSection:Se,icon:ye,codeText:he,btnGroup:ve,btnText:Te},we="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAMAAAC7IEhfAAAAPFBMVEUAAACnsMylrsymr8ymsMymrsymsMynsM2or8+ms8ynsM2nsM2mr8yosc6nr8ulscyissmkrcimr82mr8xoS1BYAAAAE3RSTlMAqlX5zaSca0wN5MK3cmNBIRyPF9bpcQAAAHRJREFUOMvt1LEOgCAMRVEriKiIKP//r4JlMIK+RCcT7kTDCRttan1H59Ry4yZ/bS6/57PEWoKdz9MlSHwnXThrwUP7AO0xGAxVPA8jhl4SUXAQchVW+AIKQzEJoU6TQnBIk0VwY+kkw0/fFS8AvFLwkvpXO7wRJHHiDd4WAAAAAElFTkSuQmCC",b="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAMAAAC7IEhfAAAAZlBMVEUAAACmr82mr8ynsMyjssqnr8ymr8yksdKmr8ymr8ynsM2nr8ynsM2lr86qtc2msMyosc6nsc6msdOmsM2msM2nsM2nr82nsM2msMunsMynsc6or8ytrc6nsMymsMylsM2krcqmr8w5Qv39AAAAIXRSTlMArFWqIN6KBvv1oe+lShjWOzQL5bB5cmldWU1GD8SblDU92uELAAAAt0lEQVQ4y+3RyQ6DIBSFYVRAQUHrrLXDef+XbGp0I0NJXHTjv7oJX8gNkKs1Pbwkn9NfLOUZvrHY7+oH9jovTAC0o+pLAL47KyBbz1MJMM+eEuDbriWg3JABdBt7gLuhgNhHBUg3zJDv4x0ozsKa0gyCbo1AS7XNdQJmrDLcDGt5bT6hPWV+nr3YA8tnHgTFQqYgyAi5/Qk2hFRBENNSeKHRScgd8H2EurG6iBhpnkTHiiElVyF9ALhVMzsJy5oXAAAAAElFTkSuQmCC",De=R({name:"login-model",props:{isRegister:{type:Boolean,default:!1}},emits:["close","confirm"],setup(f,{emit:d}){const e=U(),a=F({loginType:"PWD",imgCodeStatus:!1,username:"",password:"",smsCode:"",countDownStatus:!0,countDownTime:1e3*120}),S=async()=>{try{if(!D(a.username))return C("请输入正确的手机号码");const n={username:a.username,client_id:"cooleshow-student",client_secret:"cooleshow-student",password:a.loginType==="PWD"?a.password:a.smsCode,grant_type:"password",loginType:a.loginType==="PWD"?"PASSWORD":"SMS",autoRegister:f.isRegister},{data:p}=await M.post("/edu-app/userlogin",{requestType:"form",data:{...n}});B.set(N,p.token_type+" "+p.access_token);const A=await M.get("/edu-app/user/getUserInfo",{initRequest:!0});q(A.data),d("confirm",!0)}catch(n){console.log(n)}},y=()=>{if(!D(a.username))return C("请输入正确的手机号码");a.imgCodeStatus=!0},h=()=>{a.countDownStatus=!1,I.nextTick(()=>{console.log(e.value,"countDownRef.value"),e.value.start()})},m=()=>{a.countDownStatus=!0,e.value.reset()};return()=>s("div",{class:u.loginModel},[s("i",{class:u.iconClose,onClick:()=>d("close")},null),s("div",{class:u.loginSection},[s("div",{class:u.fieldSection},[s(v,{modelValue:a.username,"onUpdate:modelValue":n=>a.username=n,placeholder:"请输入手机号",autocomplete:"off",border:!1,type:"tel",maxlength:11},{"left-icon":()=>s("img",{src:we,class:u.icon},null)}),a.loginType==="PWD"?s(v,{modelValue:a.password,"onUpdate:modelValue":n=>a.password=n,placeholder:"请输入密码",autocomplete:"off",border:!1,type:"password"},{"left-icon":()=>s("img",{src:b,class:u.icon},null)}):s(v,{modelValue:a.smsCode,"onUpdate:modelValue":n=>a.smsCode=n,placeholder:"请输入验证码",autocomplete:"off",maxlength:6,type:"tel",border:!1},{"left-icon":()=>s("img",{src:b,class:u.icon},null),button:()=>a.countDownStatus?s("span",{class:u.codeText,onClick:y},[r("获取验证码")]):s(ue,{ref:n=>e.value=n,"auto-start":!1,time:a.countDownTime,onFinish:m,format:"ss秒"},null)})]),s("div",{class:u.btnGroup},[s(x,{round:!0,block:!0,color:"linear-gradient(90deg, #44C9FF 0%, #259CFE 100%)",onClick:S},{default:()=>[r("登录")]}),s("span",{class:u.btnText,onClick:()=>{a.loginType==="PWD"?(a.countDownStatus=!0,a.loginType="SMS"):a.loginType="PWD"}},[a.loginType==="PWD"?"验证码登录":"密码登录"])])]),a.imgCodeStatus?s(W,{to:"body"},{default:()=>[s(le,{zIndex:9999,value:a.imgCodeStatus,"onUpdate:value":n=>a.imgCodeStatus=n,phone:a.username,type:"REGISTER",onClose:()=>{a.imgCodeStatus=!1},onSendCode:h},null)]}):null])}}),Ce=()=>{sessionStorage.removeItem("Authorization")},Ke=R({name:"creation-detail",setup(){const f=K(),d=z(),e=F({id:f.query.id,loginTag:!1,loginStatus:!1,playType:"",musicDetail:{},timer:null,paused:!0,audioWidth:0,currentTime:0,duration:.1,loop:!1,dragStatus:!1,isClick:!1,list:[],listState:{dataShow:!0,loading:!1,finished:!1},params:{page:1,rows:20},messageStatus:!1,message:""});U();const a=new Audio;a.controls=!0,a.style.width="100%",a.className=t.audio;const S=o=>{e.currentTime=o,clearTimeout(e.timer),e.timer=setTimeout(()=>{a.currentTime=o,e.timer=null},60)},y=o=>{o.stopPropagation(),a.paused?a.play():a.pause(),e.paused=a.paused},h=async()=>{if(!e.loginTag){e.loginStatus=!0;return}try{await te({userMusicId:e.id,star:!e.musicDetail.starFlag}),e.musicDetail.starFlag=!e.musicDetail.starFlag,e.musicDetail.starFlag?e.musicDetail.likeNum+=1:e.musicDetail.likeNum-=1}catch(o){}},m=async()=>{try{if(e.isClick)return;e.isClick=!0;const o=await oe({type:"FORMAL",exclusionId:e.id,sort:1,...e.params});e.listState.loading=!1;const l=o.data||{};if(e.list.length>0&&l.current===1)return;e.list=e.list.concat(l.rows||[]),e.listState.finished=l.current>=l.pages,e.params.page=l.current+1,e.listState.dataShow=e.list.length>0,e.isClick=!1}catch(o){e.listState.dataShow=!1,e.listState.finished=!0,e.isClick=!1}},n=o=>{d.push({path:"/shareCreation",query:{id:o.id}})},p=()=>{try{a.src=e.musicDetail.videoUrl,a.load(),a.oncanplaythrough=()=>{e.paused=a.paused,e.duration=a.duration},a.addEventListener("timeupdate",()=>{e.duration=a.duration,e.currentTime=a.currentTime;const o=e.currentTime/e.duration*100;e.audioWidth=o>100?100:o}),a.addEventListener("ended",()=>{e.paused=a.paused})}catch(o){console.log(o)}},A=async()=>{try{const o=B.get(N)||"";if(o){const c=await ie({token:o});e.loginTag=c.data,c.data||(Ce(),X())}const l=await E(e.id);if(l.code===999){e.message=l.message,e.messageStatus=!0;return}else e.musicDetail=l.data,m(),l.data.videoUrl.lastIndexOf("mp4")!==-1?e.playType="Video":(e.playType="Audio",I.nextTick(()=>{p()}))}catch(o){e.listState.dataShow=!1}},V=Q();return L(V,o=>{console.log(o),o==="hidden"&&a&&(a.pause(),e.paused=a.paused)}),_(async()=>{A()}),H(()=>{a&&(a.pause(),e.paused=a.paused)}),G(o=>{e.id=o.query.id,e.playType="",e.params.page=1,a&&(a.currentTime=0,a.pause(),e.paused=a.paused),e.list=[],A()}),()=>{var o,l,c,T,w;return s("div",{class:[t.creation,J().isTablet?t.creationTablet:""]},[s("div",{class:t.playSection},[e.playType==="Video"&&s(ne,{class:t.videoSection,src:e.musicDetail.videoUrl,poster:((o=e.musicDetail)==null?void 0:o.videoImg)||ae},null),e.playType==="Audio"&&s("div",{class:t.audioSection},[s("div",{class:t.audioContainer},[s("div",{class:t.waveActive,style:{width:e.audioWidth+"%"}},null),s("div",{class:t.waveDefault},null)]),s("div",{class:t.audioBox},[s("div",{class:[t.audioPan,e.paused&&t.imgRotate]},[s(g,{class:t.audioImg,src:(l=e.musicDetail)==null?void 0:l.img},null)]),s("i",{class:t.audioPoint},null),s("i",{class:[t.audioZhen,e.paused&&t.active]},null)]),s("div",{class:[t.controls],onClick:i=>{i.stopPropagation()},onTouchmove:i=>{}},[s("div",{class:t.actions},[s("div",{class:t.actionBtn,onClick:y},[s("img",{src:e.paused?Y:$},null)])]),s("div",{class:[t.slider]},[s(re,{step:.01,class:t.timeProgress,modelValue:e.currentTime,"onUpdate:modelValue":[i=>e.currentTime=i,i=>{S(i)}],max:e.duration,onDragStart:()=>{e.dragStatus=!0,console.log("onDragStart")},onDragEnd:()=>{e.dragStatus=!1,console.log("onDragEnd")}},null)]),s("div",{class:t.time},[s("div",null,[k(e.currentTime)]),s("span",null,[r("/")]),s("div",null,[k(e.duration)])])])])]),s(de,{class:t.userSection,center:!0,border:!1},{icon:()=>s(g,{class:t.userLogo,src:e.musicDetail.avatar},null),title:()=>s("div",{class:t.userInfo},[s("p",{class:t.name},[s("span",null,[e.musicDetail.username]),e.musicDetail.vipFlag&&s("img",{src:ee,class:t.iconMember},null)]),s("p",{class:t.sub},[e.musicDetail.subjectName," ",j(e.musicDetail.currentGradeNum-1)])]),value:()=>s("div",{class:[t.zan,e.musicDetail.starFlag&&t.zanActive],onClick:h},[s("img",{src:e.musicDetail.starFlag?se:pe,class:t.iconZan},null),e.musicDetail.likeNum])}),s("div",{class:t.musicSection},[s("div",{class:t.musicName},[s("span",{class:t.musicTag},[r("曲目名称")]),(c=e.musicDetail)==null?void 0:c.musicSheetName]),((T=e.musicDetail)==null?void 0:T.desc)&&s("div",{class:t.musicDesc},[(w=e.musicDetail)==null?void 0:w.desc])]),s("div",{class:t.likeSection},[s("div",{class:t.likeTitle},[r("推荐作品")]),e.listState.dataShow?s(me,{finished:e.listState.finished,finishedText:" ",class:[t.container,t.containerInformation],onLoad:m,immediateCheck:!1},{default:()=>[s("div",{class:t.cellGroup},[e.list.map(i=>s("div",{class:t.cell,onClick:()=>n(i)},[s("div",{class:t.cellImg},[s(g,{class:t.cellImage,src:i.img,fit:"cover"},null),s("div",{class:t.iconZan},[i.likeNum])]),s("div",{class:[t.cellTitle,"van-ellipsis"]},[i.musicSheetName]),s("div",{class:t.users},[s(g,{src:i.avatar,class:t.userImg},null),s("span",{class:t.name},[i.username])])]))])]}):s(O,{description:"暂无数据"},null)]),s(Z,{show:e.loginStatus,"onUpdate:show":i=>e.loginStatus=i,style:{background:"transparent",overflow:"inherit"}},{default:()=>[s(De,{isRegister:!0,onClose:()=>e.loginStatus=!1,onConfirm:async i=>{e.loginTag=i,e.loginStatus=!1;const{data:P}=await E(e.id);e.musicDetail=P}},null)]}),s(ce,{show:e.messageStatus,"onUpdate:show":i=>e.messageStatus=i,message:e.message,showButton:!1},null)])}}});export{Ke as default};
|