index.ec430e5a.js 3.8 KB

1
  1. import{d as h,f as C,P as D,Q as b,S as f,V as I,a5 as y,j as i,A,B as k,n as a}from"./ResizeObserver.es.39b48a47.js";import{C as T}from"./index.970ad07b.js";import{C as V}from"./index.b1c0c586.js";import"./index.db115763.js";import{F}from"./index.428ab1a8.js";import{C as l}from"./index.c6490fa7.js";import{a as B,d as x}from"./api.43706268.js";import"./index.dc19bc54.js";import"./use-id.b004ff17.js";import"./index.fcbcb027.js";import"./index.0e35d2fb.js";import"./index.fe852f14.js";const R="_creationTablet_4veag_1",N="_sectionVideo_4veag_1",M="_videoBg_4veag_1",S="_btnGroup_4veag_16",U="_btnCropper_4veag_40",P="_btnImg_4veag_52",w="_section_4veag_1",G="_sectionFile_4veag_89",L="_muploader_4veag_101",O="_uploadImg_4veag_130",j="_tip_4veag_135",q="_musicDetail_4veag_161",z="_musicName_4veag_166",H="_username_4veag_172";var o={creationTablet:R,sectionVideo:N,videoBg:M,btnGroup:S,btnCropper:U,btnImg:P,section:w,sectionFile:G,muploader:L,uploadImg:O,tip:j,musicDetail:q,musicName:z,username:H},Q="./assets/videobg.e5380989.png",ae=h({name:"creation-edit",setup(){const{isTablet:r,ios:u,iPhone:d}=C(),m=D(),p=b(),e=f({id:m.query.id,musicDetail:{},playType:"",desc:"",videoImg:"",img:"",needCheckDevice:!!(u||d),hasDeviceAuth:!1}),v=async()=>{console.log({id:e.id,img:e.img,videoImg:e.videoImg,desc:e.desc||"\u6211\u53D1\u5E03\u4E86\u4E00\u9996\u6F14\u594F\u4F5C\u54C1\uFF0C\u5FEB\u6765\u542C\u542C\u5427\uFF5E",musicPracticeRecordId:e.musicDetail.musicPracticeRecordId,type:"FORMAL"});try{await x({id:e.id,img:e.img,videoImg:e.videoImg,desc:e.desc||"\u6211\u53D1\u5E03\u4E86\u4E00\u9996\u6F14\u594F\u4F5C\u54C1\uFF0C\u5FEB\u6765\u542C\u542C\u5427\uFF5E",musicPracticeRecordId:e.musicDetail.musicPracticeRecordId,type:"FORMAL"}),p.back()}catch{}},g=()=>{a({api:"checkDeviceCamera",content:{hideAlert:!0}},t=>{t!=null&&t.content.status&&(e.hasDeviceAuth=!0)})},c=()=>{console.log("\u6821\u9A8Capp",e.needCheckDevice),e.needCheckDevice?a({api:"checkDeviceCamera"},t=>{const{content:s}=t;s!=null&&s.status?e.hasDeviceAuth=!0:e.hasDeviceAuth=!1}):e.hasDeviceAuth=!0},_=()=>{a({api:"videoCrop",content:{url:e.musicDetail.videoUrl}},t=>{t!=null&&t.content.videoCover&&(e.videoImg=t.content.videoCover)})};function n(t){a({api:"setStatusBarTextColor",content:{statusBarTextColor:t}})}return I(async()=>{g(),n(!1);try{const{data:t}=await B(e.id);e.musicDetail=t,e.desc=t.desc,e.videoImg=t.videoImg,e.img=t.img,(t==null?void 0:t.videoUrl.lastIndexOf("mp4"))!==-1?e.playType="Video":e.playType="Audio"}catch{}}),y(()=>{n(!0)}),()=>i("div",{class:r?o.creationTablet:""},[i(V,{position:"top"},{default:()=>[i(T,{background:"#F1F1F1",border:!1},null)]}),i("div",{class:[o.section,o.sectionFile]},[i("div",{class:o.uploadImg,onClick:c},[i(l,{class:o.muploader,cropper:!0,tips:"",deletable:!1,hasDeviceAuth:e.hasDeviceAuth,modelValue:e.img,"onUpdate:modelValue":t=>e.img=t},null)]),i("div",{class:o.musicDetail},[i("p",{class:o.musicName},[e.musicDetail.musicSheetName]),i("p",{class:o.username},[e.musicDetail.username])])]),e.playType==="Video"&&i("div",{class:[o.section,o.sectionVideo]},[i("img",{src:e.videoImg||Q,class:o.videoBg},null),i("div",{class:o.btnGroup},[i("div",{onClick:c},[i(l,{class:o.btnImg,cropper:!0,tips:"",deletable:!1,hasDeviceAuth:e.hasDeviceAuth,onUploadChange:t=>{console.log(t,"img"),e.videoImg=t},options:{fixedNumber:[16,9]}},null)]),i("div",{class:o.btnCropper,onClick:_},[A("\u89C6\u9891\u622A\u53D6\u5C01\u9762")])])]),i("div",{class:o.section},[i(F,{rows:4,autosize:!0,type:"textarea",maxlength:150,placeholder:"\u6211\u53D1\u5E03\u4E86\u4E00\u9996\u6F14\u594F\u4F5C\u54C1\uFF0C\u5FEB\u6765\u542C\u542C\u5427\uFF5E",showWordLimit:!0,modelValue:e.desc,"onUpdate:modelValue":t=>e.desc=t},null)]),i("div",{class:o.btnGroup},[i(k,{type:"primary",round:!0,block:!0,color:"#2DC7AA",onClick:v},{default:()=>[e.musicDetail.type==="FORMAL"?"\u4FDD\u5B58":"\u53D1\u5E03"]})])])}});export{ae as default};