chunk-46c8de8a.5b5b15cf.js 11 KB

1
  1. (window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-46c8de8a"],{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=="},"894dc":function(t,e,r){},d3cf:function(t,e,r){"use strict";var n=r("894dc");r.n(n).a},e90e:function(t,e,r){"use strict";r.r(e);var n=[function(){var t=this.$createElement;t=this._self._c||t;return t("div",{staticClass:"success"},[t("img",{staticClass:"image",attrs:{src:r("2398"),alt:""}})])}],i=(r("a4d3"),r("e01a"),r("d28b"),r("3ca3"),r("ddb0"),r("b636"),r("944a"),r("0c47"),r("23dc"),r("3410"),r("d9e2"),r("159b"),r("b0c0"),r("131a"),r("fb6a"),r("0122")),o=r("c964"),a=(r("c740"),r("a434"),r("d81d"),r("d3b7"),r("ac1f"),r("466d"),r("81b2"),r("0eb6"),r("b7ef"),r("8bd4"),r("ace4"),r("5cc6"),r("907a"),r("9a8c"),r("a975"),r("735e"),r("c1ac"),r("d139"),r("3a7b"),r("fa9e"),r("77d9"),r("d5d6"),r("82f8"),r("e91f"),r("60bd"),r("5f96"),r("3280"),r("3fcc"),r("ca91"),r("25a1"),r("cd26"),r("3c5d"),r("2954"),r("649e"),r("219c"),r("170b"),r("b39a9"),r("72f7"),r("1b3b"),r("3d71"),r("c6e3"),r("d708")),c=r("90e7"),s=r("a006");function u(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */u=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",c=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(e){l=function(t,e,r){return t[e]=r}}function f(t,e,r,i){var o,a,c,s;e=e&&e.prototype instanceof p?e:p,e=Object.create(e.prototype),i=new x(i||[]);return n(e,"_invoke",{value:(o=t,a=r,c=i,s="suspendedStart",function(t,e){if("executing"===s)throw new Error("Generator is already running");if("completed"===s){if("throw"===t)throw e;return k()}for(c.method=t,c.arg=e;;){var r=c.delegate;if(r&&(r=function t(e,r){var n=r.method,i=e.iterator[n];return void 0===i?(r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=void 0,t(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),d):(n=h(i,e.iterator,r.arg),"throw"===n.type?(r.method="throw",r.arg=n.arg,r.delegate=null,d):(i=n.arg,i?i.done?(r[e.resultName]=i.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=void 0),r.delegate=null,d):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,d)))}(r,c),r)){if(r===d)continue;return r}if("next"===c.method)c.sent=c._sent=c.arg;else if("throw"===c.method){if("suspendedStart"===s)throw s="completed",c.arg;c.dispatchException(c.arg)}else"return"===c.method&&c.abrupt("return",c.arg);if(s="executing",r=h(o,a,c),"normal"===r.type){if(s=c.done?"completed":"suspendedYield",r.arg===d)continue;return{value:r.arg,done:c.done}}"throw"===r.type&&(s="completed",c.method="throw",c.arg=r.arg)}})}),e}function h(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=f;var d={};function p(){}function g(){}function v(){}o={};var m=(l(o,a,(function(){return this})),Object.getPrototypeOf),y=(m=m&&m(m(E([]))),m&&m!==e&&r.call(m,a)&&(o=m),v.prototype=p.prototype=Object.create(o));function w(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function b(t,e){var o;n(this,"_invoke",{value:function(n,a){function c(){return new e((function(o,c){!function n(o,a,c,s){var u;o=h(t[o],t,a);if("throw"!==o.type)return(a=(u=o.arg).value)&&"object"==Object(i.a)(a)&&r.call(a,"__await")?e.resolve(a.__await).then((function(t){n("next",t,c,s)}),(function(t){n("throw",t,c,s)})):e.resolve(a).then((function(t){u.value=t,c(u)}),(function(t){return n("throw",t,c,s)}));s(o.arg)}(n,a,o,c)}))}return o=o?o.then(c,c):c()}})}function L(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function x(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(L,this),this.reset(!0)}function E(t){if(t){var e,n=t[a];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length))return e=-1,(n=function n(){for(;++e<t.length;)if(r.call(t,e))return n.value=t[e],n.done=!1,n;return n.value=void 0,n.done=!0,n}).next=n}return{next:k}}function k(){return{value:void 0,done:!0}}return n(y,"constructor",{value:g.prototype=v,configurable:!0}),n(v,"constructor",{value:g,configurable:!0}),g.displayName=l(v,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){return t="function"==typeof t&&t.constructor,!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,v):(t.__proto__=v,l(t,s,"GeneratorFunction")),t.prototype=Object.create(y),t},t.awrap=function(t){return{__await:t}},w(b.prototype),l(b.prototype,c,(function(){return this})),t.AsyncIterator=b,t.async=function(e,r,n,i,o){void 0===o&&(o=Promise);var a=new b(f(e,r,n,i),o);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},w(y),l(y,s,"Generator"),l(y,a,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e,r=Object(t),n=[];for(e in r)n.push(e);return n.reverse(),function t(){for(;n.length;){var e=n.pop();if(e in r)return t.value=e,t.done=!1,t}return t.done=!0,t}},t.values=E,x.prototype={constructor:x,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(A),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var i=this.tryEntries.length-1;0<=i;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),s=r.call(o,"finallyLoc");if(c&&s){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;0<=n;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}var a=(o=o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc?null:o)?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),d},finish:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),d}},catch:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var r,n,i=this.tryEntries[e];if(i.tryLoc===t)return"throw"===(r=i.completion).type&&(n=r.arg,A(i)),n}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:E(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},t}var l={name:"app_upload_file",data:function(){return{fileUrl:a.a.apiBaseURL+"/image/scan_upload",imgList:[],allSize:0,token:"",uploading:!0}},created:function(){this.token=this.$route.query.token,document.title="手机端扫码上传"},methods:{again:function(){this.uploading=!0,this.imgList=[],this.allSize=0},submitUpload:function(){var t=this;return Object(o.a)(u().mark((function e(){var r,n;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=0;case 1:if(r<t.imgList.length)return n=t.imgList[r].raw,e.next=5,t.uploadItem(n);e.next=9;break;case 5:r==t.imgList.length-1&&(t.uploading=!1);case 6:r++,e.next=1;break;case 9:case"end":return e.stop()}}),e)})))()},handleRemove:function(t){var e=this,r=this.imgList.findIndex((function(e){e.url,t.url}));this.imgList.splice(r,1),this.$nextTick((function(t){e.imgList.length?e.imgList.map((function(t){e.allSize+=t.raw.size})):e.allSize=0}))},uploadItem:function(t){var e=this;return new Promise((function(r,n){var i=new FormData;i.append("file",t),i.append("uploadToken",e.token),Object(c.fb)(i).then((function(t){200==t.status?r():e.$message({message:"上传失败",type:"error",duration:1e3})})).catch((function(t){e.$Message.error(t.msg)}))}))},dataURLtoBlob:function(t){t=t.split(",");for(var e=t[0].match(/:(.*?);/)[1],r=atob(t[1]),n=r.length,i=new Uint8Array(n);n--;)i[n]=r.charCodeAt(n);return new Blob([i],{type:e})},fileChange:function(t,e){var r=this;2097152<=t.size?Object(s.a)(t.raw).then((function(t){e.length&&(e[e.length-1].raw=t),r.imgList=e,r.imgList.map((function(t){r.allSize+=t.raw.size}))})):(this.imgList=e,this.imgList.map((function(t){r.allSize+=t.raw.size})))},loadData:function(t,e){getCategoryListApi({pid:t.value}).then(function(){var t=Object(o.a)(u().mark((function t(r){var n;return u().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=r.data.list,e(n);case 2:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()).catch((function(t){}))}}},f=(r("d3cf"),r("2877"));f=Object(f.a)(l,(function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{staticClass:"main"},[t.uploading?r("div",[r("div",{staticClass:"img-list"},[r("el-upload",{ref:"upload",attrs:{action:t.fileUrl,"list-type":"picture-card","on-change":t.fileChange,"file-list":t.imgList,"auto-upload":!1},scopedSlots:t._u([{key:"file",fn:function(e){var n=e.file;return r("div",{},[r("img",{staticClass:"el-upload-list__item-thumbnail",attrs:{src:n.url,alt:""}}),r("i",{staticClass:"el-icon-error btndel",on:{click:function(e){return t.handleRemove(n)}}})])}}],null,!1,1045589351)},[r("i",{staticClass:"el-icon-plus",attrs:{slot:"default"},slot:"default"})])],1),r("div",{staticClass:"footer"},[r("div",[t._v("共"+t._s(t.imgList.length)+"张,"+t._s((t.allSize/1e6).toFixed(2))+" M")]),r("div",{staticClass:"upload-btn"},[r("div",{staticClass:"btn upload",on:{click:t.submitUpload}},[t._v("确认上传")])])])]):r("div",{staticClass:"upload-success"},[t._m(0),r("div",{staticClass:"text"},[t._v("图片上传成功")]),r("div",{staticClass:"again",on:{click:t.again}},[t._v("继续上传")])])])}),n,!1,null,"bf01dde6",null);e.default=f.exports}}]);