index-share.74e343cf.js 11 KB

1
  1. import{d as R,S as V,Q as I,j as s,z as r,B as P,bv as B,bH as D,T as w,w as h,t as b,i as x,O as N,P as F,am as K,a2 as X,U as q,bC as Y,bD as L,bE as U,bF as Z,C as Q,aR as _,bI as j,h as G,a as J}from"./index.394decd7.js";import{b as W,s as t,M as H,i as z,a as $,S as ee,c as se,d as ae}from"./index.55ca297e.js";import{C as te}from"./index.9e0d46e4.js";import{I as p}from"./index.ae2dd816.js";import{L as ie}from"./index.dc786267.js";import{v as oe,e as k,f as le,g as ne,h as ue}from"./api.baa8e0a3.js";import{C as ce,I as re}from"./index.1de71727.js";import{F as v}from"./index.224299a1.js";import{O as de}from"./index.041b3d31.js";import"./use-tab-status.723110ee.js";import"./index.a9c78aa8.js";import"./use-id.e2f22365.js";var 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=";const pe="_loginModel_1l794_1",ge="_iconClose_1l794_7",Ae="_loginSection_1l794_17",fe="_fieldSection_1l794_20",Se="_icon_1l794_7",he="_codeText_1l794_40",ve="_btnGroup_1l794_44",Ce="_btnText_1l794_49";var n={loginModel:pe,iconClose:ge,loginSection:Ae,fieldSection:fe,icon:Se,codeText:he,btnGroup:ve,btnText:Ce},Te="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAMAAAC7IEhfAAAAPFBMVEUAAACYucOWusOXusOXucOXusSWusOZusWZub+XusOXucSXucSXucOYusWYucSVuMSTucGbtsiYucKXucMm9nM5AAAAE3RSTlMAqlWi+c1rTA3kwreacmNBIRyPjUAP2gAAAHRJREFUOMvt1LEOgCAMRVErICqKKP//r4JlMIK+RCcT7kTDCRttap2gc9Ny40Z/bS6/57PkWoLC5+kSJL5TLpy15KF9gPYYDIYinvsBQ6+IKDgIuQorfAGloZiCUKdJINinySK4sXSK4afvihcAXil4Sf2rHZjwJGbdGrFMAAAAAElFTkSuQmCC",M="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAMAAAC7IEhfAAAAYFBMVEUAAACXucSXusOYucObucGXusOXusOYusSXucOXucOZu8SXucOXucSXusSXu8WVvcWYusSXucOXusaYt8eXucOXusOYusOYusSYu8OXu8SZusWYucWcvc6XusOYusSXucOWA1M7AAAAH3RSTlMArVWqIaSKS/beBvzxnzQY4tY7Cup5cmldWUYfD8SUrcUn+wAAALRJREFUOMvt08kOgjAUQNGidABlngW9//+XGgIbWyoJCzfc1Ut60jRtKs7msu4llY5/sVgZAPKL31VP1hovvAJBr9sC8O1Zwm1ejyXknnMmoJazFqC3YQTjMragtqHBrKOGZBveuK/jA+RRWI3hB4ZLPQRh5nKNwS4qLadxVlf2FbrT9uO5u3hgkdx3QTOJYReMhEj/BHMhyl2QYZJeaHUQKtyl1r+vcRUIq0xdg+9kJ8529QbfpzBL1TadYgAAAABJRU5ErkJggg==",ye=R({name:"login-model",props:{isRegister:{type:Boolean,default:!1}},emits:["close","confirm"],setup(g,{emit:d}){const e=V(),a=I({loginType:"PWD",imgCodeStatus:!1,username:"",password:"",smsCode:"",countDownStatus:!0,countDownTime:1e3*120}),A=async()=>{try{if(!D(a.username))return w("\u8BF7\u8F93\u5165\u6B63\u786E\u7684\u624B\u673A\u53F7\u7801");if(a.loginType==="PWD"){const{data:c}=await h.post("/api-auth/usernameLogin",{requestType:"form",data:{username:a.username,password:a.password,clientId:"student",clientSecret:"student"}});b(c.authentication.token_type+" "+c.authentication.access_token)}else{const{data:c}=await h.post("/api-auth/smsLogin",{requestType:"form",data:{clientId:"student",clientSecret:"student",phone:a.username,smsCode:a.smsCode,isSurportRegister:g.isRegister}});b(c.authentication.token_type+" "+c.authentication.access_token)}const l=await h.get("/api-student/student/queryUserInfo",{initRequest:!0});x(l.data),d("confirm",!0)}catch(l){console.log(l)}},f=()=>{if(!D(a.username))return w("\u8BF7\u8F93\u5165\u6B63\u786E\u7684\u624B\u673A\u53F7\u7801");a.imgCodeStatus=!0},S=()=>{a.countDownStatus=!1,W.exports.nextTick(()=>{console.log(e.value,"countDownRef.value"),e.value.start()})},m=()=>{a.countDownStatus=!0,e.value.reset()};return()=>s("div",{class:n.loginModel},[s("i",{class:n.iconClose,onClick:()=>d("close")},null),s("div",{class:n.loginSection},[s("div",{class:n.fieldSection},[s(v,{modelValue:a.username,"onUpdate:modelValue":l=>a.username=l,placeholder:"\u8BF7\u8F93\u5165\u624B\u673A\u53F7",autocomplete:"off",border:!1,type:"tel",maxlength:11},{"left-icon":()=>s("img",{src:Te,class:n.icon},null)}),a.loginType==="PWD"?s(v,{modelValue:a.password,"onUpdate:modelValue":l=>a.password=l,placeholder:"\u8BF7\u8F93\u5165\u5BC6\u7801",autocomplete:"off",border:!1,type:"password"},{"left-icon":()=>s("img",{src:M,class:n.icon},null)}):s(v,{modelValue:a.smsCode,"onUpdate:modelValue":l=>a.smsCode=l,placeholder:"\u8BF7\u8F93\u5165\u9A8C\u8BC1\u7801",autocomplete:"off",maxlength:6,type:"tel",border:!1},{"left-icon":()=>s("img",{src:M,class:n.icon},null),button:()=>a.countDownStatus?s("span",{class:n.codeText,onClick:f},[r("\u83B7\u53D6\u9A8C\u8BC1\u7801")]):s(ce,{ref:l=>e.value=l,"auto-start":!1,time:a.countDownTime,onFinish:m,format:"ss\u79D2"},null)})]),s("div",{class:n.btnGroup},[s(P,{round:!0,block:!0,color:"#2DC7AA",onClick:A},{default:()=>[r("\u767B\u5F55")]}),s("span",{class:n.btnText,onClick:()=>{a.loginType==="PWD"?(a.countDownStatus=!0,a.loginType="SMS"):a.loginType="PWD"}},[a.loginType==="PWD"?"\u9A8C\u8BC1\u7801\u767B\u5F55":"\u5BC6\u7801\u767B\u5F55"])])]),a.imgCodeStatus?s(B,{to:"body"},{default:()=>[s(re,{value:a.imgCodeStatus,"onUpdate:value":l=>a.imgCodeStatus=l,phone:a.username,onClose:()=>{a.imgCodeStatus=!1},onSendCode:S},null)]}):null])}}),Pe=R({name:"creation-detail",setup(){const g=N(),d=F(),e=I({id:g.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:""}),a=new Audio;a.controls=!0,a.style.width="100%",a.className=t.audio;const A=i=>{e.currentTime=i,clearTimeout(e.timer),e.timer=setTimeout(()=>{a.currentTime=i,e.timer=null},60)},f=i=>{i.stopPropagation(),a.paused?a.play():a.pause(),e.paused=a.paused},S=async()=>{if(!e.loginTag){e.loginStatus=!0;return}try{await le({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{}},m=async()=>{try{if(e.isClick)return;e.isClick=!0;const i=await ne({type:"FORMAL",exclusionId:e.id,sort:1,...e.params});e.listState.loading=!1;const u=i.data||{};if(e.list.length>0&&u.current===1)return;e.list=e.list.concat(u.rows||[]),e.listState.finished=u.current>=u.pages,e.params.page=u.current+1,e.listState.dataShow=e.list.length>0,e.isClick=!1}catch{e.listState.dataShow=!1,e.listState.finished=!0,e.isClick=!1}},l=i=>{d.push({path:"/shareCreation",query:{id:i.id}})},c=()=>{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 i=e.currentTime/e.duration*100;e.audioWidth=i>100?100:i}),a.addEventListener("ended",()=>{e.paused=a.paused})}catch(i){console.log(i)}},C=async()=>{try{const i=j();i&&(await ue({token:i}),e.loginTag=!0)}catch{e.loginTag=!1,G(),J()}try{const i=await k(e.id);if(i.code===999){e.message=i.msg,e.messageStatus=!0;return}else e.musicDetail=i.data,m(),i.data.videoUrl.lastIndexOf("mp4")!==-1?e.playType="Video":(e.playType="Audio",W.exports.nextTick(()=>{c()}))}catch{e.listState.dataShow=!1}},E=K();return X(E,i=>{i==="hidden"&&a&&(a.pause(),e.paused=a.paused)}),q(async()=>{C()}),Y(()=>{a&&(a.pause(),e.paused=a.paused)}),L(i=>{e.id=i.query.id,e.playType="",e.params.page=1,a&&(a.currentTime=0,a.pause(),e.paused=a.paused),e.list=[],C()}),()=>{var i,u,T,y;return s("div",{class:t.creation},[s("div",{class:t.playSection},[e.playType==="Video"&&s(H,{src:e.musicDetail.videoUrl,poster:e.musicDetail.videoImg||oe},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(p,{class:t.audioImg,src:(i=e.musicDetail)==null?void 0:i.img},null)]),s("i",{class:t.audioPoint},null),s("i",{class:[t.audioZhen,e.paused&&t.active]},null)]),s("div",{class:[t.controls],onClick:o=>{o.stopPropagation()}},[s("div",{class:t.actions},[s("div",{class:t.actionBtn,onClick:f},[s("img",{src:e.paused?z:$},null)])]),s("div",{class:[t.slider]},[s(ee,{step:.01,class:t.timeProgress,modelValue:e.currentTime,"onUpdate:modelValue":[o=>e.currentTime=o,o=>{A(o)}],max:e.duration,"onDrag-start":()=>{e.dragStatus=!0,console.log("onDragStart")},"onDrag-end":()=>{e.dragStatus=!1,console.log("onDragEnd")}},null)]),s("div",{class:t.time},[s("div",null,[U(e.currentTime)]),s("span",null,[r("/")]),s("div",null,[U(e.duration)])])])])]),s(te,{class:t.userSection,center:!0,border:!1},{icon:()=>s(p,{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:se,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:S},[s("img",{src:e.musicDetail.starFlag?ae:me,class:t.iconZan},null),e.musicDetail.likeNum])}),s("div",{class:t.musicSection},[s("div",{class:t.musicName},[s("span",{class:t.musicTag},[r("\u66F2\u76EE\u540D\u79F0")]),(u=e.musicDetail)==null?void 0:u.musicSheetName]),((T=e.musicDetail)==null?void 0:T.desc)&&s("div",{class:t.musicDesc},[(y=e.musicDetail)==null?void 0:y.desc])]),s("div",{class:t.likeSection},[s("div",{class:t.likeTitle},[r("\u63A8\u8350\u4F5C\u54C1")]),e.listState.dataShow?s(ie,{finished:e.listState.finished,finishedText:" ",class:[t.container,t.containerInformation],onLoad:m,immediateCheck:!1},{default:()=>[s("div",{class:t.cellGroup},[e.list.map(o=>s("div",{class:t.cell,onClick:()=>l(o)},[s("div",{class:t.cellImg},[s(p,{class:t.cellImage,src:o.img,fit:"cover"},null),s("div",{class:t.iconZan},[o.likeNum])]),s("div",{class:[t.cellTitle,"van-ellipsis"]},[o.musicSheetName]),s("div",{class:t.users},[s(p,{src:o.avatar,class:t.userImg},null),s("span",{class:t.name},[o.username])])]))])]}):s(Q,{tips:"\u6682\u65E0\u6570\u636E",btnStatus:!1},null)]),s(_,{show:e.loginStatus,"onUpdate:show":o=>e.loginStatus=o,style:{background:"transparent",overflow:"inherit"}},{default:()=>[s(ye,{onClose:()=>e.loginStatus=!1,onConfirm:async o=>{e.loginTag=o,e.loginStatus=!1;const{data:O}=await k(e.id);e.musicDetail=O}},null)]}),s(de,{show:e.messageStatus,"onUpdate:show":o=>e.messageStatus=o,message:e.message,showButton:!1},null)])}}});export{Pe as default};