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.b903c881.js","./index-legacy.5b93d63d.js","./index-legacy.ae2ce69e.js","./index-legacy.712aadc5.js","./index-legacy.2aba0015.js","./oss-file-upload-legacy.930c862e.js"],(function(t){"use strict";var i,n,o,a,d,r,l,s,c,u,f,p;return{setters:[function(e){i=e.d,n=e.T,o=e.bn,a=e.n,d=e.a_,r=e.j,l=e.M,s=e.f,c=e.F},function(){},function(){},function(){},function(e){u=e.U},function(e){f=e.g,p=e.o}],execute:function(){var h="_uploader-section_22hbs_1",g="_img-close_22hbs_9",b="_uploader_22hbs_1",m="_uploaderText_22hbs_53",_="_uploadImg_22hbs_58",v="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cFwv03rvW4RH3G3S41qMT8368EVoNj8ncHM7hWi+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 a,d=this;return(a=regeneratorRuntime.mark((function e(){var i,a,r,l,s,c;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,t.status="uploading",t.message="上传中...",i=t.file.name.replaceAll(" ","_"),a=(new Date).getTime()+i,console.log(t),e.next=8,f({filename:a,bucketName:d.bucket,postData:{filename:a,acl:"public-read",key:a}});case 8:return r=e.sent,l=r.data,n.loading({message:"加载中...",forbidClick:!0,loadingType:"spinner",duration:0}),s={policy:l.policy,signature:l.signature,key:a,KSSAccessKeyId:l.kssAccessKeyId,acl:"public-read",name:a,file:t.file},e.next=14,p(o(d.bucket),s);case 14:c=e.sent,n.clear(),d.$emit("update:modelValue",c),e.next=22;break;case 19:e.prev=19,e.t0=e.catch(0),console.log(e.t0);case 22:case"end":return e.stop()}}),e,null,[[0,19]])})),function(){var t=this,i=arguments;return new Promise((function(n,o){var d=a.apply(t,i);function r(t){e(d,n,o,r,l,"next",t)}function l(t){e(d,n,o,r,l,"throw",t)}r(void 0)}))})()},onClose:function(e){this.$emit("update:modelValue",null),e.stopPropagation()},onNativeUpload:function(){var e=this;a({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 d((function(){return e.modelValue})),r("div",{class:h},[this.modelValue&&this.deletable?r(l,{name:"cross",onClick:this.onClose,class:g},null):null,s().isApp&&this.nativeUpload?r("div",{onClick:this.onNativeUpload,style:{height:"100%"}},[this.modelValue?r("video",{ref:"videoUpload",class:_,src:this.modelValue+"#t=1,4"},null):r("div",{class:b},[r(l,{name:v,size:"32"},null),r("p",{class:m},[this.tips])])]):r(c,null,[r(u,{accept:".mp4",afterRead:this.afterRead,beforeRead:this.beforeRead,beforeDelete:this.beforeDelete},{default:function(){return e.modelValue?r("video",{ref:"videoUpload",class:_,src:e.modelValue+"#t=1,4"},null):r("div",{class:b},[r(l,{name:v,size:"32"},null),r("p",{class:m},[e.tips])])}})])])}}))}}}))}();
|