1 |
- (window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-c8a212d4"],{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="",o=n(t);if(o<0||o===1/0)throw new s("Wrong number of repetitions");for(;0<o;(o>>>=1)&&(e+=e))1&o&&(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")},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=p(a/1e7)}function r(t,e){for(var i=6,n=0;0<=--i;)n+=t[i],t[i]=p(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+m("0",7-e.length)+e);return n}var o=i("23e7"),c=i("e330"),l=i("5926"),u=i("408a"),f=i("1148"),d=(i=i("d039"),RangeError),g=String,p=Math.floor,m=c(f),h=c("".slice),v=c(1..toFixed);o({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,o=u(this),c=(t=l(t),[0,0,0,0,0,0]),f="",p="0";if(t<0||20<t)throw new d("Incorrect fraction digits");if(o!=o)return"NaN";if(o<=-1e21||1e21<=o)return g(o);if(o<0&&(f="-",o=-o),1e-21<o)if(o=(e=function(t){for(var e=0,i=t;4096<=i;)e+=12,i/=4096;for(;2<=i;)e+=1,i/=2;return e}(o*n(2,69,1))-69)<0?o*n(2,-e,1):o/n(2,e,1),o*=4503599627370496,0<(e=52-e)){for(a(c,0,o),i=t;7<=i;)a(c,1e7,0),i-=7;for(a(c,n(10,i,1),0),i=e-1;23<=i;)r(c,1<<23),i-=23;r(c,1<<i),a(c,1,1),r(c,2),p=s(c)}else a(c,0,o),a(c,1<<-e,0),p=s(c)+m("0",t);return 0<t?f+((o=p.length)<=t?"0."+m("0",t-o)+p:h(p,0,o-t)+"."+h(p,o-t)):f+p}})},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")),o=i("90e7"),c=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(o.fb)(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(c.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}}]);
|