chunk-5bf1379c.b7784a07.js 28 KB

1234567891011
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-5bf1379c"],{"14d9":function(e,t,r){"use strict";var a=r("23e7"),i=r("7b0b"),n=r("07fa"),o=r("3a34"),s=r("3511"),d=r("d039"),c=d((function(){return 4294967297!==[].push.call({length:4294967296},1)})),u=function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(e){return e instanceof TypeError}},l=c||!u();a({target:"Array",proto:!0,arity:1,forced:l},{push:function(e){var t=i(this),r=n(t),a=arguments.length;s(r+a);for(var d=0;d<a;d++)t[r]=arguments[d],r++;return o(t,r),r}})},3511:function(e,t,r){"use strict";var a=TypeError,i=9007199254740991;e.exports=function(e){if(e>i)throw a("Maximum allowed index exceeded");return e}},"3a34":function(e,t,r){"use strict";var a=r("83ab"),i=r("e8b5"),n=TypeError,o=Object.getOwnPropertyDescriptor,s=a&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(e){return e instanceof TypeError}}();e.exports=s?function(e,t){if(i(e)&&!o(e,"length").writable)throw new n("Cannot set read only .length");return e.length=t}:function(e,t){return e.length=t}},"3b0e":function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));var a=r("1836"),i=r("2687");function n(e,t){return Object(a["a"])({url:i["a"].customer+"orders/".concat(e,"/revoke"),method:"post",data:t})}},"408a":function(e,t,r){"use strict";var a=r("e330");e.exports=a(1..valueOf)},"42d5":function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));var a=r("1836"),i=r("2687");function n(e){return Object(a["a"])({url:i["a"].customer+"regions",method:"get",params:e})}},"4a19":function(e,t,r){"use strict";r("dfaa")},"4de4":function(e,t,r){"use strict";var a=r("23e7"),i=r("b727").filter,n=r("1dde"),o=n("filter");a({target:"Array",proto:!0,forced:!o},{filter:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}})},"51eb":function(e,t,r){"use strict";var a=r("825a"),i=r("485a"),n=TypeError;e.exports=function(e){if(a(this),"string"===e||"default"===e)e="string";else if("number"!==e)throw new n("Incorrect hint");return i(this,e)}},"7a82f":function(e,t,r){"use strict";var a=r("23e7"),i=r("83ab"),n=r("9bf2").f;a({target:"Object",stat:!0,forced:Object.defineProperty!==n,sham:!i},{defineProperty:n})},"7c8d":function(e,t,r){
  2. /*!
  3. * Compressor.js v1.2.1
  4. * https://fengyuanchen.github.io/compressorjs
  5. *
  6. * Copyright 2018-present Chen Fengyuan
  7. * Released under the MIT license
  8. *
  9. * Date: 2023-02-28T14:09:41.732Z
  10. */
  11. (function(t,r){e.exports=r()})(0,(function(){"use strict";function e(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,a)}return r}function t(t){for(var r=1;r<arguments.length;r++){var a=null!=arguments[r]?arguments[r]:{};r%2?e(Object(a),!0).forEach((function(e){n(t,e,a[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):e(Object(a)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(a,e))}))}return t}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){for(var r=0;r<t.length;r++){var a=t[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,d(a.key),a)}}function i(e,t,r){return t&&a(e.prototype,t),r&&a(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function n(e,t,r){return t=d(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function o(){return o=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},o.apply(this,arguments)}function s(e,t){if("object"!==typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var a=r.call(e,t||"default");if("object"!==typeof a)return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function d(e){var t=s(e,"string");return"symbol"===typeof t?t:String(t)}var c={exports:{}};(function(e){"undefined"!==typeof window&&function(t){var r=t.HTMLCanvasElement&&t.HTMLCanvasElement.prototype,a=t.Blob&&function(){try{return Boolean(new Blob)}catch(e){return!1}}(),i=a&&t.Uint8Array&&function(){try{return 100===new Blob([new Uint8Array(100)]).size}catch(e){return!1}}(),n=t.BlobBuilder||t.WebKitBlobBuilder||t.MozBlobBuilder||t.MSBlobBuilder,o=/^data:((.*?)(;charset=.*?)?)(;base64)?,/,s=(a||n)&&t.atob&&t.ArrayBuffer&&t.Uint8Array&&function(e){var t,r,s,d,c,u,l,f,p;if(t=e.match(o),!t)throw new Error("invalid data URI");for(r=t[2]?t[1]:"text/plain"+(t[3]||";charset=US-ASCII"),s=!!t[4],d=e.slice(t[0].length),c=s?atob(d):decodeURIComponent(d),u=new ArrayBuffer(c.length),l=new Uint8Array(u),f=0;f<c.length;f+=1)l[f]=c.charCodeAt(f);return a?new Blob([i?l:u],{type:r}):(p=new n,p.append(u),p.getBlob(r))};t.HTMLCanvasElement&&!r.toBlob&&(r.mozGetAsFile?r.toBlob=function(e,t,a){var i=this;setTimeout((function(){a&&r.toDataURL&&s?e(s(i.toDataURL(t,a))):e(i.mozGetAsFile("blob",t))}))}:r.toDataURL&&s&&(r.msToBlob?r.toBlob=function(e,t,a){var i=this;setTimeout((function(){(t&&"image/png"!==t||a)&&r.toDataURL&&s?e(s(i.toDataURL(t,a))):e(i.msToBlob(t))}))}:r.toBlob=function(e,t,r){var a=this;setTimeout((function(){e(s(a.toDataURL(t,r)))}))})),e.exports?e.exports=s:t.dataURLtoBlob=s}(window)})(c);var u=c.exports,l=function(e){return"undefined"!==typeof Blob&&(e instanceof Blob||"[object Blob]"===Object.prototype.toString.call(e))},f={strict:!0,checkOrientation:!0,retainExif:!1,maxWidth:1/0,maxHeight:1/0,minWidth:0,minHeight:0,width:void 0,height:void 0,resize:"none",quality:.8,mimeType:"auto",convertTypes:["image/png"],convertSize:5e6,beforeDraw:null,drew:null,success:null,error:null},p="undefined"!==typeof window&&"undefined"!==typeof window.document,h=p?window:{},m=function(e){return e>0&&e<1/0},y=Array.prototype.slice;function b(e){return Array.from?Array.from(e):y.call(e)}var v=/^image\/.+$/;function g(e){return v.test(e)}function w(e){var t=g(e)?e.substr(6):"";return"jpeg"===t&&(t="jpg"),".".concat(t)}var _=String.fromCharCode;function k(e,t,r){var a,i="";for(r+=t,a=t;a<r;a+=1)i+=_(e.getUint8(a));return i}var j=h.btoa;function O(e,t){var r=[],a=8192,i=new Uint8Array(e);while(i.length>0)r.push(_.apply(null,b(i.subarray(0,a)))),i=i.subarray(a);return"data:".concat(t,";base64,").concat(j(r.join("")))}function x(e){var t,r=new DataView(e);try{var a,i,n;if(255===r.getUint8(0)&&216===r.getUint8(1)){var o=r.byteLength,s=2;while(s+1<o){if(255===r.getUint8(s)&&225===r.getUint8(s+1)){i=s;break}s+=1}}if(i){var d=i+4,c=i+10;if("Exif"===k(r,d,4)){var u=r.getUint16(c);if(a=18761===u,(a||19789===u)&&42===r.getUint16(c+2,a)){var l=r.getUint32(c+4,a);l>=8&&(n=c+l)}}}if(n){var f,p,h=r.getUint16(n,a);for(p=0;p<h;p+=1)if(f=n+12*p+2,274===r.getUint16(f,a)){f+=8,t=r.getUint16(f,a),r.setUint16(f,1,a);break}}}catch(m){t=1}return t}function T(e){var t=0,r=1,a=1;switch(e){case 2:r=-1;break;case 3:t=-180;break;case 4:a=-1;break;case 5:t=90,a=-1;break;case 6:t=90;break;case 7:t=90,r=-1;break;case 8:t=-90;break}return{rotate:t,scaleX:r,scaleY:a}}var L=/\.\d*(?:0|9){12}\d*$/;function P(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e11;return L.test(e)?Math.round(e*t)/t:e}function U(e){var t=e.aspectRatio,r=e.height,a=e.width,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"none",n=m(a),o=m(r);if(n&&o){var s=r*t;("contain"===i||"none"===i)&&s>a||"cover"===i&&s<a?r=a/t:a=r*t}else n?r=a/t:o&&(a=r*t);return{width:a,height:r}}function A(e){var t=b(new Uint8Array(e)),r=t.length,a=[],i=0;while(i+3<r){var n=t[i],o=t[i+1];if(255===n&&218===o)break;if(255===n&&216===o)i+=2;else{var s=256*t[i+2]+t[i+3],d=i+s+2,c=t.slice(i,d);a.push(c),i=d}}return a.reduce((function(e,t){return 255===t[0]&&225===t[1]?e.concat(t):e}),[])}function E(e,t){var r=b(new Uint8Array(e));if(255!==r[2]||224!==r[3])return e;var a=256*r[4]+r[5],i=[255,216].concat(t,r.slice(4+a));return new Uint8Array(i)}var B=h.ArrayBuffer,S=h.FileReader,F=h.URL||h.webkitURL,R=/\.\w+$/,C=h.Compressor,I=function(){function e(a,i){r(this,e),this.file=a,this.exif=[],this.image=new Image,this.options=t(t({},f),i),this.aborted=!1,this.result=null,this.init()}return i(e,[{key:"init",value:function(){var e=this,t=this.file,r=this.options;if(l(t)){var a=t.type;if(g(a))if(F&&S){B||(r.checkOrientation=!1,r.retainExif=!1);var i="image/jpeg"===a,n=i&&r.checkOrientation,s=i&&r.retainExif;if(!F||n||s){var d=new S;this.reader=d,d.onload=function(r){var i=r.target,d=i.result,c={},u=1;n&&(u=x(d),u>1&&o(c,T(u))),s&&(e.exif=A(d)),c.url=n||s?!F||u>1?O(d,a):F.createObjectURL(t):d,e.load(c)},d.onabort=function(){e.fail(new Error("Aborted to read the image with FileReader."))},d.onerror=function(){e.fail(new Error("Failed to read the image with FileReader."))},d.onloadend=function(){e.reader=null},n||s?d.readAsArrayBuffer(t):d.readAsDataURL(t)}else this.load({url:F.createObjectURL(t)})}else this.fail(new Error("The current browser does not support image compression."));else this.fail(new Error("The first argument must be an image File or Blob object."))}else this.fail(new Error("The first argument must be a File or Blob object."))}},{key:"load",value:function(e){var r=this,a=this.file,i=this.image;i.onload=function(){r.draw(t(t({},e),{},{naturalWidth:i.naturalWidth,naturalHeight:i.naturalHeight}))},i.onabort=function(){r.fail(new Error("Aborted to load the image."))},i.onerror=function(){r.fail(new Error("Failed to load the image."))},h.navigator&&/(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(h.navigator.userAgent)&&(i.crossOrigin="anonymous"),i.alt=a.name,i.src=e.url}},{key:"draw",value:function(e){var t=this,r=e.naturalWidth,a=e.naturalHeight,i=e.rotate,n=void 0===i?0:i,o=e.scaleX,s=void 0===o?1:o,d=e.scaleY,c=void 0===d?1:d,l=this.file,f=this.image,p=this.options,h=document.createElement("canvas"),y=h.getContext("2d"),b=Math.abs(n)%180===90,v=("contain"===p.resize||"cover"===p.resize)&&m(p.width)&&m(p.height),w=Math.max(p.maxWidth,0)||1/0,_=Math.max(p.maxHeight,0)||1/0,k=Math.max(p.minWidth,0)||0,j=Math.max(p.minHeight,0)||0,x=r/a,T=p.width,L=p.height;if(b){var A=[_,w];w=A[0],_=A[1];var B=[j,k];k=B[0],j=B[1];var F=[L,T];T=F[0],L=F[1]}v&&(x=T/L);var R=U({aspectRatio:x,width:w,height:_},"contain");w=R.width,_=R.height;var C=U({aspectRatio:x,width:k,height:j},"cover");if(k=C.width,j=C.height,v){var I=U({aspectRatio:x,width:T,height:L},p.resize);T=I.width,L=I.height}else{var M=U({aspectRatio:x,width:T,height:L}),N=M.width;T=void 0===N?r:N;var H=M.height;L=void 0===H?a:H}T=Math.floor(P(Math.min(Math.max(T,k),w))),L=Math.floor(P(Math.min(Math.max(L,j),_)));var z=-T/2,D=-L/2,X=T,$=L,W=[];if(v){var V=0,q=0,G=r,K=a,Y=U({aspectRatio:x,width:r,height:a},{contain:"cover",cover:"contain"}[p.resize]);G=Y.width,K=Y.height,V=(r-G)/2,q=(a-K)/2,W.push(V,q,G,K)}if(W.push(z,D,X,$),b){var J=[L,T];T=J[0],L=J[1]}h.width=T,h.height=L,g(p.mimeType)||(p.mimeType=l.type);var Q="transparent";l.size>p.convertSize&&p.convertTypes.indexOf(p.mimeType)>=0&&(p.mimeType="image/jpeg");var Z="image/jpeg"===p.mimeType;if(Z&&(Q="#fff"),y.fillStyle=Q,y.fillRect(0,0,T,L),p.beforeDraw&&p.beforeDraw.call(this,y,h),!this.aborted&&(y.save(),y.translate(T/2,L/2),y.rotate(n*Math.PI/180),y.scale(s,c),y.drawImage.apply(y,[f].concat(W)),y.restore(),p.drew&&p.drew.call(this,y,h),!this.aborted)){var ee=function(e){if(!t.aborted){var i=function(e){return t.done({naturalWidth:r,naturalHeight:a,result:e})};if(e&&Z&&p.retainExif&&t.exif&&t.exif.length>0){var n=function(e){return i(u(O(E(e,t.exif),p.mimeType)))};if(e.arrayBuffer)e.arrayBuffer().then(n).catch((function(){t.fail(new Error("Failed to read the compressed image with Blob.arrayBuffer()."))}));else{var o=new S;t.reader=o,o.onload=function(e){var t=e.target;n(t.result)},o.onabort=function(){t.fail(new Error("Aborted to read the compressed image with FileReader."))},o.onerror=function(){t.fail(new Error("Failed to read the compressed image with FileReader."))},o.onloadend=function(){t.reader=null},o.readAsArrayBuffer(e)}}else i(e)}};h.toBlob?h.toBlob(ee,p.mimeType,p.quality):ee(u(h.toDataURL(p.mimeType,p.quality)))}}},{key:"done",value:function(e){var t=e.naturalWidth,r=e.naturalHeight,a=e.result,i=this.file,n=this.image,o=this.options;if(F&&0===n.src.indexOf("blob:")&&F.revokeObjectURL(n.src),a)if(o.strict&&!o.retainExif&&a.size>i.size&&o.mimeType===i.type&&!(o.width>t||o.height>r||o.minWidth>t||o.minHeight>r||o.maxWidth<t||o.maxHeight<r))a=i;else{var s=new Date;a.lastModified=s.getTime(),a.lastModifiedDate=s,a.name=i.name,a.name&&a.type!==i.type&&(a.name=a.name.replace(R,w(a.type)))}else a=i;this.result=a,o.success&&o.success.call(this,a)}},{key:"fail",value:function(e){var t=this.options;if(!t.error)throw e;t.error.call(this,e)}},{key:"abort",value:function(){this.aborted||(this.aborted=!0,this.reader?this.reader.abort():this.image.complete?this.fail(new Error("The compression process has been aborted.")):(this.image.onload=null,this.image.onabort()))}}],[{key:"noConflict",value:function(){return window.Compressor=C,e}},{key:"setDefaults",value:function(e){o(f,e)}}]),e}();return I}))},"7cc1":function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));var a=r("1836"),i=r("2687");function n(e){return Object(a["a"])({url:i["a"].customer+"qiniu/token",method:"get",params:e})}},8172:function(e,t,r){"use strict";var a=r("e065"),i=r("57b9");a("toPrimitive"),i()},9189:function(e,t,r){"use strict";var a=function(){var e=this,t=e._self._c;return t("div",[t("van-field",{attrs:{readonly:"",border:e.border,label:e.label,placeholder:e.placeholder,disabled:e.disabled},scopedSlots:e._u([{key:"input",fn:function(){return[t("van-uploader",{attrs:{accept:e.accept,"before-read":e.beforeUpload,"after-read":e.afterRead,disabled:e.disabled,"show-upload":e.edit,deletable:e.edit},on:{delete:e.update},scopedSlots:e._u([{key:"preview-cover",fn:function(r){return[r.url&&"mp4"==r.url.split("/").pop().split(".").pop()?t("div",{staticClass:"w-full h-full overflow-hidden flex justify-center items-center"},[t("video",{staticClass:"min-w-full min-h-full",attrs:{src:r.url},on:{click:function(t){return e.videoPlay(r.url)}}},[e._v(" 您的浏览器不支持视频播放 ")])]):e._e()]}}]),model:{value:e.fileList,callback:function(t){e.fileList=t},expression:"fileList"}})]},proxy:!0}])}),e.videoShow?t("van-overlay",{staticClass:"flex justify-center items-center",attrs:{show:e.videoShow,"z-index":"1000"}},[t("video",{staticClass:"max-w-full max-h-full",attrs:{src:e.videoUrl,controls:""}},[e._v(" 您的浏览器不支持视频播放 ")]),t("i",{staticClass:"van-icon van-icon-clear van-image-preview__close-icon van-image-preview__close-icon--top-right",attrs:{role:"button"},on:{click:function(t){e.videoShow=!1}}})]):e._e()],1)},i=[],n=(r("9a83"),r("f564")),o=r("ade3"),s=(r("68ef"),r("a71a"),r("6e47")),d=(r("e930"),r("8f80")),c=(r("4de4"),r("4160"),r("d81d"),r("b64b"),r("d3b7"),r("159b"),{name:"UploadList",components:Object(o["a"])(Object(o["a"])({},d["a"].name,d["a"]),s["a"].name,s["a"]),props:{value:{type:Array,default:function(){return[]}},label:{type:String,default:""},placeholder:{type:String,default:""},accept:{type:String,default:"image/*"},disabled:{type:Boolean,default:!1},border:{type:Boolean,default:!1},edit:{type:Boolean,default:!0}},watch:{value:{deep:!0,imediate:!0,handler:function(e){this.fileList=e.map((function(e){return{url:e}}))}}},data:function(){return{dataObj:{},fileList:[],videoShow:!1,videoUrl:""}},created:function(){this.fileList=this.value.map((function(e){return{url:e}}))},methods:{videoPlay:function(e){this.videoUrl=e,this.videoShow=!0},beforeUpload:function(e){if("video/mp4"===e.type){if(e.size/1024/1024>30)return Object(n["a"])({type:"danger",message:"上传视频大小不能超过 30MB!"}),!1}else if(e.size/1024/1024>30)return Object(n["a"])({type:"danger",message:"上传图片大小不能超过 30MB!"}),!1;var t="";if(console.log(e.type),"image/png"===e.type)t="png";else if("image/jpeg"===e.type)t="jpg";else{if("video/mp4"!==e.type)return Object(n["a"])({type:"danger",message:"上传格式有误!"}),!1;t="mp4"}var r=this;return new Promise((function(a,i){getToken({file_type:t}).then((function(t){var i=t.data.key,n=t.data.token;r._data.dataObj.token=n,r._data.dataObj.key=i,a(e)})).catch((function(e){console.log(e),i()}))}))},afterRead:function(e){var t=this;console.log(e),e.status="uploading",e.message="上传中...";var r=new FormData;r.append("file",e.file),Object.keys(this.dataObj).forEach((function(e){r.append(e,t.dataObj[e])})),this.$axios({method:"post",url:"https://upload.qiniup.com",data:r}).then((function(r){console.log(r),e.url=t.$store.getters.setting.img_host+r.data.key,e.status="done",e.message="上传成功",t.update()})).catch((function(){e.status="failed",e.message="上传失败",t.update()}))},update:function(){var e=this.fileList.filter((function(e){return!e.status||"done"==e.status})).map((function(e){return e.url}));this.$emit("input",e),console.log(e)}}}),u=c,l=(r("4a19"),r("2877")),f=Object(l["a"])(u,a,i,!1,null,"1659bf72",null);t["a"]=f.exports},a15b:function(e,t,r){"use strict";var a=r("23e7"),i=r("e330"),n=r("44ad"),o=r("fc6a"),s=r("a640"),d=i([].join),c=n!==Object,u=c||!s("join",",");a({target:"Array",proto:!0,forced:u},{join:function(e){return d(o(this),void 0===e?",":e)}})},a9e3:function(e,t,r){"use strict";var a=r("23e7"),i=r("c430"),n=r("83ab"),o=r("da84"),s=r("428f"),d=r("e330"),c=r("94ca"),u=r("1a2d"),l=r("7156"),f=r("3a9b"),p=r("d9b5"),h=r("c04e"),m=r("d039"),y=r("241c").f,b=r("06cf").f,v=r("9bf2").f,g=r("408a"),w=r("58a8").trim,_="Number",k=o[_],j=s[_],O=k.prototype,x=o.TypeError,T=d("".slice),L=d("".charCodeAt),P=function(e){var t=h(e,"number");return"bigint"==typeof t?t:U(t)},U=function(e){var t,r,a,i,n,o,s,d,c=h(e,"number");if(p(c))throw new x("Cannot convert a Symbol value to a number");if("string"==typeof c&&c.length>2)if(c=w(c),t=L(c,0),43===t||45===t){if(r=L(c,2),88===r||120===r)return NaN}else if(48===t){switch(L(c,1)){case 66:case 98:a=2,i=49;break;case 79:case 111:a=8,i=55;break;default:return+c}for(n=T(c,2),o=n.length,s=0;s<o;s++)if(d=L(n,s),d<48||d>i)return NaN;return parseInt(n,a)}return+c},A=c(_,!k(" 0o1")||!k("0b1")||k("+0x1")),E=function(e){return f(O,e)&&m((function(){g(e)}))},B=function(e){var t=arguments.length<1?0:k(P(e));return E(this)?l(Object(t),this,B):t};B.prototype=O,A&&!i&&(O.constructor=B),a({global:!0,constructor:!0,wrap:!0,forced:A},{Number:B});var S=function(e,t){for(var r,a=n?y(t):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,isFinite,isInteger,isNaN,isSafeInteger,parseFloat,parseInt,fromString,range".split(","),i=0;a.length>i;i++)u(t,r=a[i])&&!u(e,r)&&v(e,r,b(t,r))};i&&j&&S(s[_],j),(A||i)&&S(s[_],k)},ade3:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));r("7a82f");var a=r("53ca");r("8172"),r("d9e2"),r("d401"),r("efec"),r("a9e3");function i(e,t){if("object"!=Object(a["a"])(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=Object(a["a"])(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function n(e){var t=i(e,"string");return"symbol"==Object(a["a"])(t)?t:t+""}function o(e,t,r){return(t=n(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}},d81d:function(e,t,r){"use strict";var a=r("23e7"),i=r("b727").map,n=r("1dde"),o=n("map");a({target:"Array",proto:!0,forced:!o},{map:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}})},dfaa:function(e,t,r){},efec:function(e,t,r){"use strict";var a=r("1a2d"),i=r("cb2d"),n=r("51eb"),o=r("b622"),s=o("toPrimitive"),d=Date.prototype;a(d,s)||i(d,s,n)},f745:function(e,t,r){"use strict";r.r(t);var a=function(){var e=this,t=e._self._c;return t("div",[t("van-nav-bar",{staticClass:"shadow mb-4",attrs:{title:"添加报修","left-text":"返回","left-arrow":""},on:{"click-left":function(t){return e.$router.back(-1)}}}),t("van-form",{staticClass:"w-11/12 mx-auto",on:{submit:e.onSubmit}},[t("div",{staticClass:"shadow"},[t("p",{staticClass:"bg-yellow-600 bg-opacity-80 text-white px-4 py-2"},[e._v("基本信息")]),t("van-field",{attrs:{readonly:"",clickable:"",label:"报修类型",value:e.pickerValue,rules:[{required:!0}],placeholder:"选择报修类型"},on:{click:function(t){e.showOrderTypePicker=!0}}}),t("van-popup",{attrs:{round:"",position:"bottom"},model:{value:e.showOrderTypePicker,callback:function(t){e.showOrderTypePicker=t},expression:"showOrderTypePicker"}},[t("van-picker",{attrs:{"show-toolbar":"","value-key":"type_name",columns:e.orderTypes,loading:e.pickerLoading},on:{cancel:function(t){e.showOrderTypePicker=!1},confirm:e.confirmOrderTypes}})],1),t("van-field",{attrs:{rows:"3",autosize:"",label:"故障描述",type:"textarea",placeholder:"请填写故障描述",rules:[{required:!0}]},model:{value:e.orderForm.content,callback:function(t){e.$set(e.orderForm,"content",t)},expression:"orderForm.content"}}),t("van-field",{attrs:{name:"uploader",label:"上传图片"},scopedSlots:e._u([{key:"input",fn:function(){return[t("UploadList",{attrs:{value:["https://image.nczyzs.com/17111796835249483636614200244.jpg","https://image.nczyzs.com/17124067795563612565117412409.jpg","https://image.nczyzs.com/17107371559867504924763436260.jpg"],edit:!1}})]},proxy:!0}])})],1),t("div",{staticClass:"mt-2 shadow"},[t("p",{staticClass:"bg-gray-600 text-white px-4 py-2 bg-opacity-80"},[e._v("房屋信息")]),t("div",{staticClass:"bg-white"},[e.houseList.length>0?t("van-field",{attrs:{readonly:"",clickable:"",name:"picker",value:e.houseName,label:"选择房屋",placeholder:"选择房屋"},on:{click:function(t){e.showHousePicker=!0}}}):e._e(),t("van-popup",{attrs:{position:"bottom"},model:{value:e.showHousePicker,callback:function(t){e.showHousePicker=t},expression:"showHousePicker"}},[t("van-picker",{attrs:{"show-toolbar":"",columns:e.houseList,"value-key":"address","default-index":e.houseIndex},on:{confirm:e.handleChooseHouse,cancel:function(t){e.showHousePicker=!1}}})],1)],1)]),t("div",{staticClass:"mt-8"},[t("van-button",{attrs:{loading:e.submitLoading,block:"",type:"info","loading-text":"加载中...","native-type":"submit"}},[e._v("提交")])],1)])],1)},i=[];r("4de4"),r("4160"),r("a15b"),r("d81d"),r("14d9"),r("b64b"),r("d3b7"),r("3ca3"),r("159b"),r("ddb0"),r("1836"),r("2687");var n=r("7cc1"),o=(r("3b0e"),r("42d5")),s=(r("f39f"),r("7c8d")),d=r.n(s),c=r("9189"),u={components:{UploadList:c["a"]},data:function(){return{picList:[],picKeys:[],pickerLoading:!1,pickerValue:"",showOrderTypePicker:!1,orderTypes:[],areaValue:"",houseForm:{},houseName:"",houseIndex:0,houseList:[{id:6715,user_id:7287,district:3,district_name:"",address:"联发广场 X-X-XXXX",pkg_id:2,link_name:"客户",link_phone:"13000000000",shop_id:2,designer:931,designer_name:"XXX",supervisor:194,supervisor_name:"XXX",salesman:17,project_manager:0,project_manager_name:"",project_leader:798,project_leader_name:"",project_start:"1635955200",project_end:"0",warranty_start:"2022-05-30",warranty_mark:"",created_at:"1636014109",warranty_type:[{id:1,type_name:"主材",left_date:-629,in_warranty:0,warranty_end:165384e4,warranty_period:0,warranty_period_adddate:0},{id:2,type_name:"基础",left_date:102,in_warranty:1,warranty_end:1716998400,warranty_period:2,warranty_period_adddate:0},{id:3,type_name:"水电工程",left_date:1197,in_warranty:1,warranty_end:1811606400,warranty_period:5,warranty_period_adddate:0}],warranty_period_base:2,warranty_period_material:0,warranty_period_electric:5,warranty_period_base_adddate:0,warranty_period_material_adddate:0,warranty_period_electric_adddate:0,pictures:""}],showDialog:!1,showHousePicker:!1,defaultArea:"",areaLoading:!1,showArea:!1,orderForm:{house_id:0},areaList:{},submitLoading:!1}},created:function(){this.loadOrderTypes(),this.loadHouseList(0)},methods:{loadHouseList:function(e){var t=this;this.houseList.forEach((function(r,a){(0===e&&0===a||r["id"]===e)&&(t.houseName=r["address"],t.houseIndex=a,t.orderForm.house_id=r["id"])}))},handleChooseHouse:function(e,t){console.log(t),this.houseName=this.houseList[t]["address"],this.orderForm.house_id=this.houseList[t]["id"],this.showHousePicker=!1},loadOrderTypes:function(){this.orderTypes=[{children:[{created_at:1616144887,id:4,pid:1,show:0,type_name:"瓷砖",updated_at:1616144887,warranty_period:0},{created_at:1616144894,id:5,pid:1,show:0,type_name:"地板",updated_at:1616144894,warranty_period:0},{created_at:1616144901,id:6,pid:1,show:0,type_name:"洁具",updated_at:1616144901,warranty_period:0},{created_at:1616144907,id:7,pid:1,show:0,type_name:"门类",updated_at:1616144907,warranty_period:0},{created_at:1616144923,id:8,pid:1,show:0,type_name:"柜子类",updated_at:1616144923,warranty_period:0},{created_at:1616144930,id:9,pid:1,show:0,type_name:"电器类",updated_at:1616144930,warranty_period:0},{created_at:1616144936,id:10,pid:1,show:0,type_name:"吊顶类",updated_at:1616144936,warranty_period:0},{created_at:1620457124,id:15,pid:1,show:0,type_name:"封窗",updated_at:1620457124,warranty_period:0},{created_at:1621148442,id:16,pid:1,show:0,type_name:"赠品",updated_at:1621148442,warranty_period:0}],created_at:1615886807,id:1,pid:0,show:1,type_name:"主材",updated_at:1685418171,warranty_period:1},{children:[{created_at:1616145054,id:12,pid:2,show:0,type_name:"泥工",updated_at:1616145054,warranty_period:0},{created_at:1616145060,id:13,pid:2,show:0,type_name:"木工",updated_at:1616145060,warranty_period:0},{created_at:1616145067,id:14,pid:2,show:0,type_name:"油漆工",updated_at:1616145067,warranty_period:0}],created_at:1615886807,id:2,pid:0,show:1,type_name:"基础",updated_at:1685418173,warranty_period:2},{children:[{created_at:1616145032,id:11,pid:3,show:0,type_name:"水电",updated_at:1616145032,warranty_period:0}],created_at:1615886807,id:3,pid:0,show:1,type_name:"水电工程",updated_at:1685418176,warranty_period:5},{children:[{created_at:1623143906,id:20,pid:19,show:0,type_name:"费用问题",updated_at:1623143906,warranty_period:0}],created_at:1623143771,id:19,pid:0,show:0,type_name:"账单核对",updated_at:1623143850,warranty_period:5},{children:[{created_at:1627012111,id:22,pid:21,show:0,type_name:"设计师",updated_at:1627012320,warranty_period:0}],created_at:1627012069,id:21,pid:0,show:0,type_name:"设计师服务",updated_at:1627012086,warranty_period:0}]},loadRegionList:function(){var e=this;this.areaLoading=!0,Object(o["a"])({level:1}).then((function(t){e.areaList=t.data,e.areaLoading=!1}))},handleUpload:function(e){var t=this;return new Promise((function(r,a){var i="";"image/png"===e.type?i="png":"image/jpeg"===e.type?i="jpg":a("上传头像图片只能是 JPG 或者 PNG 格式!");var o=t;new d.a(e,{quality:.8,maxWidth:1920,success:function(t){console.log("compress ok"),r(Object(n["a"])({file_type:i}).then((function(a){var i=new FormData;i.append("file",t),i.append("token",a.data.token),i.append("key",a.data.key),e.status="uploading",e.message="上传中...",e.url="",o.$axios.post("https://upload.qiniup.com",i,{headers:{"Content-Type":"multipart/form-data"}}).then((function(t){200===t.status?(e.status="success",e.message="上传成功",e.url=o.$store.getters.setting.img_host+t.data.key,o.picKeys.push(t.data.key)):(e.status="failed",e.message="上传失败"),r()}))})))}})}))},beforeRead:function(e){var t=this,r=[];return e instanceof Array||(e=[e]),this.$store.commit("loading/showLoading"),e.forEach((function(e){var a=t.handleUpload(e);a.catch((function(e){return t.$store.commit("loading/hideLoading"),t.$toast(e),!1})),r.push(a)})),Promise.all(r).then((function(){t.$store.commit("loading/hideLoading"),console.log("finish all")})),!0},confirmOrderTypes:function(e,t){this.pickerValue=e.join("/"),this.showOrderTypePicker=!1,this.orderForm.main_type=this.orderTypes[t[0]]["id"],this.orderForm.sub_type=this.orderTypes[t[0]]["children"][t[1]]["id"]},handleShowArea:function(){0===Object.keys(this.areaList).length&&this.loadRegionList(),this.showArea=!0},confirmArea:function(e){this.areaValue=e.filter((function(e){return!!e})).map((function(e){return e.name})).join("/"),this.showArea=!1,this.orderForm.province=e[0].code,this.orderForm.city=e[1].code,this.orderForm.region=e[2].code,console.log(this.orderForm)},onSubmit:function(){this.submitLoading=!0,this.orderForm.pics=this.picKeys.join(",");var e=this;e.$toast.success({message:"提交成功",duration:1e3,onClose:function(){e.$router.push({path:"/orders"})}})}}},l=u,f=r("2877"),p=Object(f["a"])(l,a,i,!1,null,null,null);t["default"]=p.exports}}]);