1 |
- !function(){function e(e,t,i,n,o,a,r){try{var d=e[a](r),l=d.value}catch(s){return void i(s)}d.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(["./ResizeObserver.es-legacy.8d60aee1.js","./index-legacy.4a75d877.js","./index-legacy.7e047c4c.js","./index-legacy.a082ee96.js","./index-legacy.598eb07e.js"],(function(t){"use strict";var i,n,o,a,r,d,l,s,c,u,f,p;return{setters:[function(e){i=e.d,n=e.T,o=e.br,a=e.n,r=e.a$,d=e.j,l=e.N,s=e.f,c=e.F},function(){},function(){},function(){},function(e){u=e.g,f=e.o,p=e.U}],execute:function(){var h="_uploader-section_22hbs_1",g="_img-close_22hbs_9",m="_uploader_22hbs_1",b="_uploaderText_22hbs_53",v="_uploadImg_22hbs_58",_="data:image/png;base64,iVBORw0KG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MT8368EVoNj8ncHM7hWi+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,r=this;return(a=regeneratorRuntime.mark((function e(){var i,a,d,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,u({filename:a,bucketName:r.bucket,postData:{filename:a,acl:"public-read",key:a}},!0);case 8:return d=e.sent,l=d.data,setTimeout((function(){n.loading({message:"加载中...",forbidClick:!0,loadingType:"spinner",duration:0})}),100),s={policy:l.policy,signature:l.signature,key:a,KSSAccessKeyId:l.kssAccessKeyId,acl:"public-read",name:a,file:t.file},e.next=14,f(o(r.bucket),s);case 14:c=e.sent,n.clear(),r.$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 r=a.apply(t,i);function d(t){e(r,n,o,d,l,"next",t)}function l(t){e(r,n,o,d,l,"throw",t)}d(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 r((function(){return e.modelValue})),d("div",{class:h},[this.modelValue&&this.deletable?d(l,{name:"cross",onClick:this.onClose,class:g},null):null,s().isApp&&this.nativeUpload?d("div",{onClick:this.onNativeUpload,style:{height:"100%"}},[this.modelValue?d("video",{ref:"videoUpload",class:v,src:this.modelValue+"#t=1,4"},null):d("div",{class:m},[d(l,{name:_,size:"32"},null),d("p",{class:b},[this.tips])])]):d(c,null,[d(p,{accept:".mp4",afterRead:this.afterRead,beforeRead:this.beforeRead,beforeDelete:this.beforeDelete},{default:function(){return e.modelValue?d("video",{ref:"videoUpload",class:v,src:e.modelValue+"#t=1,4"},null):d("div",{class:m},[d(l,{name:_,size:"32"},null),d("p",{class:b},[e.tips])])}})])])}}))}}}))}();
|