1 |
- !function(){function e(e,t,i,n,o,a,d){try{var r=e[a](d),l=r.value}catch(s){return void i(s)}r.done?t(l):Promise.resolve(l).then(n,o)}var t=document.createElement("style");t.innerHTML="._uploader-section_22hbs_1{margin:.26667rem 0;height:3.86667rem;border:.02667rem dashed #ccc;border-radius:.26667rem;box-sizing:border-box;position:relative}._uploader-section_22hbs_1 ._img-close_22hbs_9{position:absolute;top:.21333rem;right:.26667rem;z-index:99999;font-size:.42667rem;background-color:#333;color:#fff;width:.58667rem;height:.58667rem;display:flex;justify-content:center;align-items:center;border-radius:50%}._uploader-section_22hbs_1 ._col-uploader_22hbs_24,._uploader-section_22hbs_1 .van-uploader{width:100%;height:100%;align-items:center;display:flex;justify-content:center}._uploader-section_22hbs_1 .van-uploader__wrapper,._uploader-section_22hbs_1 .van-uploader__input-wrapper{display:flex;align-items:center;justify-content:center;width:inherit;height:inherit}._uploader-section_22hbs_1 ._uploader_22hbs_1{display:flex;align-items:center;justify-content:center;flex-direction:column;height:100%}._uploader-section_22hbs_1 ._uploader_22hbs_1 ._uploaderText_22hbs_53{font-size:.37333rem;color:#999;margin-top:.21333rem}._uploader-section_22hbs_1 ._uploadImg_22hbs_58{width:100%;height:100%;overflow:hidden;position:absolute;top:0;left:0;z-index:99}._uploader-section_22hbs_1 video{background:rgba(0,0,0,.6)}\n",document.head.appendChild(t),System.register(["./index-legacy.fba2875c.js","./index-legacy.d92f7da7.js","./index-legacy.af00a324.js","./index-legacy.507e7b89.js","./index-legacy.33b60c3e.js"],(function(t){"use strict";var i,n,o,a,d,r,l,s,c,u,f,p,h;return{setters:[function(e){i=e.d,n=e.T,o=e.g,a=e.w,d=e.bg,r=e.bn,l=e.n,s=e.a_,c=e.j,u=e.M,f=e.f,p=e.F},function(){},function(){},function(){},function(e){h=e.U}],execute:function(){var g="_uploader-section_22hbs_1",m="_img-close_22hbs_9",b="_uploader_22hbs_1",_="_uploaderText_22hbs_53",v="_uploadImg_22hbs_58",A="data:image/png;base64,iVBORw0K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qMT8368EVoNj8ncHM7hWi+O9slYMHdoNcaGhWsMrZIPKDlDNgG2SNEDxRw8BjBIDloFdRwcG8Eizt9jN8AkD98X58flcwA4EzwcF63E1MSQi+NZoFnwzjwhJ5fzz/8QD17+iHcVjdxKZYqHA9gnEqQ84OMAldPizF7X83IAR19vBfDz7PwufzbAO5X8xABvUXIDi9lNoZIbWAvHaUtygFUfWqlL9nCKSe9VqCzp+gt5+mbdb6LRD+7pAfpKTznkAAAAAElFTkSuQmCC";t("C",i({name:"ColUploadVideo",props:{modelValue:String,posterUrl:String,tips:{type:String,default:"点击上传"},nativeUpload:{type:Boolean,default:!0},size:{type:Number,default:30},deletable:{type:Boolean,default:!0},bucket:{type:String,default:"daya"}},methods:{beforeRead:function(e){return!!(e.size/1024/1024<this.size)||(n("上传视频大小不能超过 ".concat(this.size,"MB")),!1)},beforeDelete:function(e,t){return!0},afterRead:function(t,i){var l,s=this;return(l=regeneratorRuntime.mark((function e(){var i,l,c,u,f,p,h,g;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,t.status="uploading",t.message="上传中...",i="TEACHER"===o.platformType?"/api-teacher/getUploadSign":"/api-student/getUploadSign",l=t.file.name.replaceAll(" ","_"),c=(new Date).getTime()+l,console.log(t),e.next=9,a.post(i,{data:{filename:l,bucketName:s.bucket,postData:{filename:l,acl:"public-read",key:c,unknowValueField:[]}}});case 9:for(h in u=e.sent,n.loading({message:"加载中...",forbidClick:!0,loadingType:"spinner",duration:0}),f={policy:u.data.policy,signature:u.data.signature,key:c,KSSAccessKeyId:u.data.kssAccessKeyId,acl:"public-read",name:l},p=new FormData,f)p.append(h,f[h]);return p.append("file",t.file),e.next=17,d(r(s.bucket),{method:"POST",data:p});case 17:g=r(s.bucket)+c,n.clear(),s.$emit("update:modelValue",g),e.next=25;break;case 22:e.prev=22,e.t0=e.catch(0),console.log(e.t0);case 25:case"end":return e.stop()}}),e,null,[[0,22]])})),function(){var t=this,i=arguments;return new Promise((function(n,o){var a=l.apply(t,i);function d(t){e(a,n,o,d,r,"next",t)}function r(t){e(a,n,o,d,r,"throw",t)}d(void 0)}))})()},onClose:function(e){this.$emit("update:modelValue",null),e.stopPropagation()},onNativeUpload:function(){var e=this;l({api:"chooseFile",content:{type:"video",bucket:this.bucket}},(function(t){e.$emit("update:modelValue",t.fileUrl)}))},getVideoBase64:function(e){return new Promise((function(t){var i="",n=document.createElement("video");n.setAttribute("crossOrigin","anonymous"),n.setAttribute("src",e),n.setAttribute("preload","auto"),n.addEventListener("loadeddata",(function(){console.log(n,"video loadeddata");var e=document.createElement("canvas");console.log("video.clientWidth",n.videoWidth),console.log("video.clientHeight",n.videoHeight);var o=n.videoWidth||750,a=n.videoHeight||500;e.width=o,e.height=a,e.getContext("2d").drawImage(n,0,0,o,a),i=e.toDataURL("image/jpeg"),t(i)}))}))}},render:function(){var e=this;return s((function(){return e.modelValue})),c("div",{class:g},[this.modelValue&&this.deletable?c(u,{name:"cross",onClick:this.onClose,class:m},null):null,f().isApp&&this.nativeUpload?c("div",{onClick:this.onNativeUpload,style:{height:"100%"}},[this.modelValue?c("video",{ref:"videoUpload",class:v,src:this.modelValue+"#t=1,4"},null):c("div",{class:b},[c(u,{name:A,size:"32"},null),c("p",{class:_},[this.tips])])]):c(p,null,[c(h,{accept:".mp4",afterRead:this.afterRead,beforeRead:this.beforeRead,beforeDelete:this.beforeDelete},{default:function(){return e.modelValue?c("video",{ref:"videoUpload",class:v,src:e.modelValue+"#t=1,4"},null):c("div",{class:b},[c(u,{name:A,size:"32"},null),c("p",{class:_},[e.tips])])}})])])}}))}}}))}();
|