1 line
8.2 KiB
JavaScript

(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-77e3dba0"],{1148:function(t,e,i){"use strict";var n=i("5926"),a=i("577e"),r=i("1d80"),s=RangeError;t.exports=function(t){var e=a(r(this)),i="",c=n(t);if(c<0||c===1/0)throw new s("Wrong number of repetitions");for(;0<c;(c>>>=1)&&(e+=e))1&c&&(i+=e);return i}},2398:function(t,e){t.exports="data:image/jpeg;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAAXNSR0IArs4c6QAAAARzQklUCAgICHwIZIgAAAIzSURBVGiB7dkvbBRBFIDxihMVJ05UVCARFYgKBKKiEoFoQgWyElFRgUA2gQQBogmWpAgcJBgc8kgqEBUVFRUVFScqECcqTvwQu5te2D8zd927WZJ+enffN7Mzb9+bXVm5556ZwfPUDnOBAb7KeJLaZyawjSu3fEztFAV6eKPMNVZT+zWCNfyskIcJNlI71oJNXNbIw8vUjrVgDzcN8gepHWvBYYN4d+Vlm/U4IH+Y2rMS9NVv1oJPqT0ryeWHAfkf6KV2LYF1nAXkf6Of2rVELn8ekB9hPbVriUj5GzxO7VoiX/OnAXnYS+1aQtyGhQ+pXUvI8vz3CPmhjmac4wj5azxI7VoCryPk4WmbQR+18SrxTFb6hjhqw7sIuoWxbM3O/RHJJ2EcIX/axmQVQTf+CTrEYI7nDDTX8wUTbLYpP6oIcm7GL6K4jAOvFi1fcCWyhcN+pPyJFpfOjvBmG2Er8JxNzd1UwRgPW5GfCh4zc2M16Q6rwjVOwX6r8lMSMTl7gt2Ke99Hyp8sRH5K5ChS5GDqnu3Ie5ZzHILPkULvZEXaZeT1hwuXzwfQw7dIqYvI684t8zQtH8SvSLkYGjPYogbRl+Xru5LuVEFcC9jEH6wlG8DUIK4ConUsJufPinC5UcWZLnVYslIhpkQuWP7GDeG2XwjxJbVrLdjVXPzd6GJ/Ow1eNAzgbWq/KHBQIT8yRxeXDOWfEt39/VOH2wr2QpfS5izIir+d1B5z89/O/D134C+N9zTDbeyE4AAAAABJRU5ErkJggg=="},"2e66e":function(t,e,i){},"7f55":function(t,e,i){"use strict";i("2e66e")},a006:function(t,e,i){"use strict";function n(t){return new Promise((function(e,i){var n=new FileReader;n.readAsDataURL(t),n.onload=function(){var i=new Image;i.src=n.result,i.onload=function(){var n=i.width,a=i.height,r=document.createElement("canvas"),s=(r.width=n,r.height=a,r.getContext("2d"));s.fillStyle="#fff",s.fillRect(0,0,r.width,r.height),s.drawImage(i,0,0,n,a),s=function(t,e){t=t.split(",");for(var i=t[0].match(/:(.*?);/)[1],n=atob(t[1]),a=n.length,r=new Uint8Array(a);a--;)r[a]=n.charCodeAt(a);return new File([r],e,{type:i})}(r.toDataURL("image/jpeg",.8),t.name),e(s)}}}))}i.d(e,"a",(function(){return n})),i("d3b7"),i("b0c0"),i("ac1f"),i("466d"),i("81b2"),i("0eb6"),i("b7ef"),i("8bd4"),i("ace4"),i("5cc6"),i("907a"),i("9a8c"),i("a975"),i("735e"),i("c1ac"),i("d139"),i("3a7b"),i("986a"),i("1d02"),i("d5d6"),i("82f8"),i("e91f"),i("60bd"),i("5f96"),i("3280"),i("3fcc"),i("ca91"),i("25a1"),i("cd26"),i("3c5d"),i("2954"),i("649e"),i("219c"),i("170b"),i("b39a9"),i("6ce5"),i("2834"),i("72f7"),i("4ea1")},b680:function(t,e,i){"use strict";function n(t,e,i){return 0===e?i:e%2==1?n(t,e-1,i*t):n(t*t,e/2,i)}function a(t,e,i){for(var n=-1,a=i;++n<6;)a+=e*t[n],t[n]=a%1e7,a=m(a/1e7)}function r(t,e){for(var i=6,n=0;0<=--i;)n+=t[i],t[i]=m(n/e),n=n%e*1e7}function s(t){for(var e,i=6,n="";0<=--i;)""===n&&0!==i&&0===t[i]||(e=g(t[i]),n=""===n?e:n+p("0",7-e.length)+e);return n}var c=i("23e7"),o=i("e330"),l=i("5926"),u=i("408a"),f=i("1148"),d=(i=i("d039"),RangeError),g=String,m=Math.floor,p=o(f),h=o("".slice),v=o(1..toFixed);c({target:"Number",proto:!0,forced:i((function(){return"0.000"!==v(8e-5,3)||"1"!==v(.9,0)||"1.25"!==v(1.255,2)||"1000000000000000128"!==v(0xde0b6b3a7640080,0)}))||!i((function(){v({})}))},{toFixed:function(t){var e,i,c=u(this),o=(t=l(t),[0,0,0,0,0,0]),f="",m="0";if(t<0||20<t)throw new d("Incorrect fraction digits");if(c!=c)return"NaN";if(c<=-1e21||1e21<=c)return g(c);if(c<0&&(f="-",c=-c),1e-21<c)if(c=(e=function(t){for(var e=0,i=t;4096<=i;)e+=12,i/=4096;for(;2<=i;)e+=1,i/=2;return e}(c*n(2,69,1))-69)<0?c*n(2,-e,1):c/n(2,e,1),c*=4503599627370496,0<(e=52-e)){for(a(o,0,c),i=t;7<=i;)a(o,1e7,0),i-=7;for(a(o,n(10,i,1),0),i=e-1;23<=i;)r(o,1<<23),i-=23;r(o,1<<i),a(o,1,1),r(o,2),m=s(o)}else a(o,0,c),a(o,1<<-e,0),m=s(o)+p("0",t);return 0<t?f+((c=m.length)<=t?"0."+p("0",t-c)+m:h(m,0,c-t)+"."+h(m,c-t)):f+m}})},e90e:function(t,e,i){"use strict";i.r(e),i("b680");var n=[function(){var t=this._self._c;return t("div",{staticClass:"success"},[t("img",{staticClass:"image",attrs:{src:i("2398"),alt:""}})])}],a=i("c7eb"),r=i("1da1"),s=(i("c740"),i("a434"),i("d81d"),i("d3b7"),i("d708")),c=i("90e7"),o=i("a006"),l={name:"app_upload_file",data:function(){return{fileUrl:s.a.apiBaseURL+"/image/scan_upload",imgList:[],allSize:0,token:"",uploading:!0,limit:20,loading:!1,pid:0}},created:function(){this.token=this.$route.query.token,this.pid=this.$route.query.pid,document.title="手机端扫码上传"},methods:{selectImgs:function(){this.loading||this.$refs.upload.$refs["upload-inner"].handleClick()},again:function(){this.uploading=!0,this.imgList=[],this.allSize=0},submitUpload:function(){var t=this;return Object(r.a)(Object(a.a)().mark((function e(){var i,n;return Object(a.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.imgList.length){if(t.loading)return e.abrupt("return");e.next=3}else e.next=15;break;case 3:t.loading=!0,i=0;case 5:if(i<t.imgList.length)return n=t.imgList[i].raw,e.next=9,t.uploadItem(n);e.next=13;break;case 9:i==t.imgList.length-1&&(t.uploading=!1,t.loading=!1);case 10:i++,e.next=5;break;case 13:e.next=16;break;case 15:t.$message.warning("请先选择图片");case 16:case"end":return e.stop()}}),e)})))()},handleRemove:function(t){var e=this,i=this.imgList.findIndex((function(e){return e.url==t.url}));this.imgList.splice(i,1),this.$nextTick((function(t){var i=0;e.imgList.length?(e.imgList.map((function(t){i+=t.raw.size})),e.allSize=i):e.allSize=0}))},uploadItem:function(t){var e=this;return new Promise((function(i,n){var a=new FormData;a.append("file",t),a.append("uploadToken",e.token),a.append("pid",e.pid),Object(c.Z)(a).then((function(t){200==t.status?i():(e.loading=!1,e.$message({message:"上传失败",type:"error",duration:1e3}))})).catch((function(t){e.loading=!1,e.$message.error(t.msg)}))}))},fileError:function(t,e,i){},beforeUpload:function(t){},fileChange:function(t,e){var i=this;return Object(r.a)(Object(a.a)().mark((function n(){var r;return Object(a.a)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(2097152<=t.size)return n.next=3,i.comImg(t.raw).then((function(n){e.map((function(e){e.uid===t.uid&&(i.allSize+=n.size,e.raw=n)})),i.imgList=e}));n.next=5;break;case 3:n.next=8;break;case 5:i.imgList=e,r=0,i.imgList.length?(i.imgList.map((function(t){r+=t.raw.size})),i.allSize=r):i.allSize=0;case 8:case"end":return n.stop()}}),n)})))()},comImg:function(t){return new Promise((function(e,i){Object(o.a)(t).then((function(t){e(t)}))}))},loadData:function(t,e){getCategoryListApi({pid:t.value}).then(function(){var t=Object(r.a)(Object(a.a)().mark((function t(i){var n;return Object(a.a)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=i.data.list,e(n);case 2:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()).catch((function(t){}))}}},u=(i("7f55"),i("2877"));u=Object(u.a)(l,(function(){var t=this,e=t._self._c;return e("div",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticClass:"main"},[t.uploading?e("div",[e("div",{staticClass:"img-list",class:{"none-card":t.imgList.length}},[e("el-upload",{ref:"upload",attrs:{action:t.fileUrl,"list-type":"picture-card","on-change":t.fileChange,"on-error":t.fileError,"before-upload":t.beforeUpload,"file-list":t.imgList,"auto-upload":!1,multiple:!0,limit:t.limit,accept:"image/*"},scopedSlots:t._u([{key:"file",fn:function(i){var n=i.file;return e("div",{},[e("img",{staticClass:"el-upload-list__item-thumbnail",attrs:{src:n.url,alt:""}}),e("i",{staticClass:"el-icon-error btndel",on:{click:function(e){return t.handleRemove(n)}}})])}}],null,!1,1045589351)},[t.imgList.length?t._e():e("div",{staticClass:"upload-card",attrs:{slot:"default"},slot:"default"},[e("i",{staticClass:"el-icon-plus"}),e("p",{staticClass:"text"},[t._v("点击选择图片")])])])],1),e("div",{staticClass:"footer"},[t.imgList.length?e("div",[t._v("共"+t._s(t.imgList.length)+"/"+t._s(t.limit)+"张,"+t._s((t.allSize/1e6).toFixed(2))+" M")]):e("div"),e("div",{staticClass:"upload-btn"},[t.imgList.length<t.limit?e("div",{staticClass:"btn",on:{click:t.selectImgs}},[t._v("\n "+t._s(t.imgList.length?"继续选择":"选择图片")+"\n ")]):t._e(),e("div",{staticClass:"btn upload",class:{"no-pic":!t.imgList.length},on:{click:t.submitUpload}},[t._v("确认上传")])])])]):e("div",{staticClass:"upload-success"},[t._m(0),e("div",{staticClass:"text"},[t._v("图片上传成功")]),e("div",{staticClass:"again",on:{click:t.again}},[t._v("继续上传")])])])}),n,!1,null,"4478ceac",null);e.default=u.exports}}]);