1 |
- import{d as U,r as F,x as R,a as s,A as r,C as W,j as x,N as T,E as C,D as M,G as B,J as N,K,P as q,q as Q,aO as z,w as L,y as _,a8 as H,bY as G,aN as k,aZ as Z,a2 as j,Q as O,bZ as J}from"./index-521a9826.js";import{s as t,i as X,a as Y,b as $,c as ee}from"./icon-pause-48fad3c4.js";import{v as se,e as E,f as ae,g as te,h as oe}from"./video-bg-472da6c7.js";import{b as V}from"./browser-504037ee.js";import{M as ie}from"./index-570cc16d.js";import{M as ne}from"./index-9a28eb74.js";import{F as v}from"./index-e6f760ef.js";import{C as le,M as ue}from"./index-207eaba3.js";import{S as ce}from"./index-631128d0.js";import{I as g}from"./index-25b5c9d0.js";import{C as re}from"./index-1ad6a58d.js";import{L as de}from"./index-b1810e0a.js";import"./tcplayer.v4.8.0.min-e19fa46b.js";import"./index-163db0a7.js";import"./use-tab-status-da6d8e9f.js";const me="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=",pe="_loginModel_1wz3k_1",Ae="_iconClose_1wz3k_7",ge="_loginSection_1wz3k_17",fe="_fieldSection_1wz3k_20",Se="_icon_1wz3k_7",ye="_codeText_1wz3k_37",he="_btnGroup_1wz3k_41",ve="_btnText_1wz3k_41",u={loginModel:pe,iconClose:Ae,loginSection:ge,fieldSection:fe,icon:Se,codeText:ye,btnGroup:he,btnText:ve},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=U({name:"login-model",props:{isRegister:{type:Boolean,default:!1}},emits:["close","confirm"],setup(f,{emit:d}){const e=F(),a=R({loginType:"PWD",imgCodeStatus:!1,username:"",password:"",smsCode:"",countDownStatus:!0,countDownTime:1e3*120}),S=async()=>{try{if(!T(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});K(A.data),d("confirm",!0)}catch(n){console.log(n)}},y=()=>{if(!T(a.username))return C("请输入正确的手机号码");a.imgCodeStatus=!0},h=()=>{a.countDownStatus=!1,V.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(le,{ref:n=>e.value=n,"auto-start":!1,time:a.countDownTime,onFinish:m,format:"ss秒"},null)})]),s("div",{class:u.btnGroup},[s(W,{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(x,{to:"body"},{default:()=>[s(ne,{value:a.imgCodeStatus,"onUpdate:value":n=>a.imgCodeStatus=n,phone:a.username,type:"REGISTER",onClose:()=>{a.imgCodeStatus=!1},onSendCode:h},null)]}):null])}}),Te=()=>{sessionStorage.removeItem("Authorization")},Ke=U({name:"creation-detail",setup(){const f=q(),d=Q(),e=R({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:""});F();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 ae({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 te({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 oe({token:o});e.loginTag=c.data,c.data||(Te(),J())}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",V.nextTick(()=>{p()}))}catch(o){e.listState.dataShow=!1}},I=z();return L(I,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,w,D;return s("div",{class:t.creation},[s("div",{class:t.playSection},[e.playType==="Video"&&s(ie,{src:e.musicDetail.videoUrl,poster:((o=e.musicDetail)==null?void 0:o.videoImg)||se},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?X:Y},null)])]),s("div",{class:[t.slider]},[s(ce,{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(re,{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:$,class:t.iconMember},null)]),s("p",{class:t.sub},[e.musicDetail.subjectName," ",Z(e.musicDetail.currentGradeNum-1)])]),value:()=>s("div",{class:[t.zan,e.musicDetail.starFlag&&t.zanActive],onClick:h},[s("img",{src:e.musicDetail.starFlag?ee:me,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]),((w=e.musicDetail)==null?void 0:w.desc)&&s("div",{class:t.musicDesc},[(D=e.musicDetail)==null?void 0:D.desc])]),s("div",{class:t.likeSection},[s("div",{class:t.likeTitle},[r("推荐作品")]),e.listState.dataShow?s(de,{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(j,{description:"暂无数据"},null)]),s(O,{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(ue,{show:e.messageStatus,"onUpdate:show":i=>e.messageStatus=i,message:e.message,showButton:!1},null)])}}});export{Ke as default};
|