chunk-3b409886.bdee8403.js 19 KB

1234567891011
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-3b409886"],{"35b5":function(e,t,r){"use strict";var i=r("1854");t["a"]={customer:i["a"].baseApi+"api/aftersale/customer/",work:i["a"].baseApi+"worker/",weixin:i["a"].baseUrl+"api/weixin/"}},4895:function(e,t,r){"use strict";r.r(t);var i=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("div",{staticClass:"van-cell van-cell--clickable van-field"},[t("span",{staticClass:"van-cell__title van-field__label"},[e._v("工种")]),t("el-select",{attrs:{placeholder:"请选择"},model:{value:e.registerForm.type_ids,callback:function(t){e.$set(e.registerForm,"type_ids",t)},expression:"registerForm.type_ids"}},e._l(e.workTypes,(function(e){return t("el-option",{key:e.id,attrs:{label:e.name,value:e.id}})})),1)],1),t("van-field",{attrs:{name:"账号",label:"账号",placeholder:"账号",rules:[{required:!0,message:"请填写账号"}]},model:{value:e.registerForm.userno,callback:function(t){e.$set(e.registerForm,"userno",t)},expression:"registerForm.userno"}}),t("van-field",{attrs:{name:"姓名",label:"姓名",placeholder:"姓名",rules:[{required:!0,message:"请填写姓名"}]},model:{value:e.registerForm.name,callback:function(t){e.$set(e.registerForm,"name",t)},expression:"registerForm.name"}}),t("van-field",{attrs:{type:"password",name:"密码",label:"密码",placeholder:"密码",rules:[{required:!0,message:"请填写密码"}]},model:{value:e.registerForm.password,callback:function(t){e.$set(e.registerForm,"password",t)},expression:"registerForm.password"}}),t("van-field",{attrs:{clearable:"",label:"手机号",placeholder:"请输入手机号",type:"tel",rules:[{required:!0}]},on:{input:e.changePhone},model:{value:e.registerForm.phone,callback:function(t){e.$set(e.registerForm,"phone",t)},expression:"registerForm.phone"}}),t("van-field",{attrs:{clearable:"",type:"digit",label:"短信验证码",placeholder:"请输入短信验证码",rules:[{required:!0}]},scopedSlots:e._u([{key:"button",fn:function(){return[t("van-button",{attrs:{disabled:e.sendDisabled,loading:e.sendLoading,size:"small",type:"primary"},on:{click:e.handSendVerifyCode}},[t("van-count-down",{directives:[{name:"show",rawName:"v-show",value:e.showCountDown,expression:"showCountDown"}],ref:"countDown",staticClass:"text-white",attrs:{time:e.countDownTime,format:"ss秒","auto-start":!1},on:{finish:e.countDownFinish}}),t("span",{directives:[{name:"show",rawName:"v-show",value:!e.showCountDown,expression:"!showCountDown"}]},[e._v("发送验证码")])],1)]},proxy:!0}]),model:{value:e.registerForm.code,callback:function(t){e.$set(e.registerForm,"code",t)},expression:"registerForm.code"}}),t("van-field",{attrs:{name:"uploader",label:"身份证正面"},scopedSlots:e._u([{key:"input",fn:function(){return[t("van-uploader",{attrs:{"before-read":e.beforeRead,multiple:"","max-count":1,rules:[{required:!0}]},model:{value:e.registerForm.picList.idcard1,callback:function(t){e.$set(e.registerForm.picList,"idcard1",t)},expression:"registerForm.picList.idcard1"}})]},proxy:!0}])}),t("van-field",{attrs:{name:"uploader",label:"身份证反面"},scopedSlots:e._u([{key:"input",fn:function(){return[t("van-uploader",{attrs:{"before-read":e.beforeRead,multiple:"","max-count":1,rules:[{required:!0}]},model:{value:e.registerForm.picList.idcard2,callback:function(t){e.$set(e.registerForm.picList,"idcard2",t)},expression:"registerForm.picList.idcard2"}})]},proxy:!0}])})],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)},a=[],n=(r("d401"),r("4160"),r("14d9"),r("d3b7"),r("25f0"),r("3ca3"),r("159b"),r("ddb0"),r("9f4c")),o=r("35b5");function s(e){return Object(n["a"])({url:o["a"].customer+"regions",method:"get",params:e})}var l=r("7870"),c=r("7c8d"),u=r.n(c);function d(){return Object(n["a"])({url:o["a"].work+"worktypes",method:"get"})}function h(e){return Object(n["a"])({url:o["a"].work+"register",method:"post",data:e})}var f=r("eaf8"),p={data:function(){return{picKeys:[],pickerLoading:!1,sendLoading:!1,pickerValue:"",showOrderTypePicker:!1,sendDisabled:!0,workTypes:[],areaValue:"",houseForm:{},registerForm:{phone:"",code:"",password:"",type_ids:"",idcard1:"",idcard2:"",picList:[]},houseName:"",workTypesName:"",houseIndex:0,workTypesIndex:0,countDownTime:6e4,houseList:[],showDialog:!1,showHousePicker:!1,defaultArea:"",areaLoading:!1,showArea:!1,showCountDown:!1,orderForm:{house_id:0},areaList:{},submitLoading:!1,loginForm:{phone:"",code:"",openid:"",nickname:"",sex:0,headimgurl:"",login_type:1}}},created:function(){this.loadWorkTypes()},methods:{loadWorkTypes:function(){var e=this;this.pickerLoading=!0,d().then((function(t){e.pickerLoading=!1,e.workTypes=t.data.list}))},countDownFinish:function(){this.showCountDown=!1,this.sendDisabled=!1},changePhone:function(){""===this.registerForm.phone?this.sendDisabled=!0:this.sendDisabled=!1},loadRegionList:function(){var e=this;this.areaLoading=!0,s({level:1}).then((function(t){e.areaList=t.data,e.areaLoading=!1}))},handSendVerifyCode:function(){var e=this;this.sendDisabled=!0,this.showCountDown=!0;var t=Object(f["a"])(),r=this.$md5(this.$md5(this.registerForm.phone+t.toString()));Object(l["a"])({phone:this.registerForm.phone,Timestamp:t,Signature:r}).then((function(t){e.$refs.countDown.reset(),e.$refs["countDown"].start(),e.disabled=!1,e.showCountDown=!0})).catch((function(){e.showCountDown=!1,e.sendDisabled=!1}))},handleUpload:function(e){var t=this;return new Promise((function(r,i){var a="";"image/png"===e.type?a="png":"image/jpeg"===e.type?a="jpg":i("上传图片只能是 JPG 或者 PNG 格式!");var n=t;new u.a(e,{quality:.8,maxWidth:1920,success:function(t){console.log("compress ok"),r(Object(l["b"])({file_type:a}).then((function(i){var a=new FormData;a.append("file",t),a.append("token",i.data.token),a.append("key",i.data.key),e.status="uploading",e.message="上传中...",e.url="",n.$axios.post("https://upload.qiniup.com",a,{headers:{"Content-Type":"multipart/form-data"}}).then((function(t){200===t.status?(e.status="success",e.message="上传成功",e.url=n.$store.getters.setting.img_host+t.data.key,n.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 i=t.handleUpload(e);i.catch((function(e){return t.$store.commit("loading/hideLoading"),t.$toast(e),!1})),r.push(i)})),Promise.all(r).then((function(){t.$store.commit("loading/hideLoading"),console.log("finish all")})),!0},confirmWorkTypes:function(e,t){this.workTypesName=e,console.log(this.workTypesName),this.showOrderTypePicker=!1,this.registerForm.main_type=this.workTypes[t[0]]["id"],this.workTypesName=this.workTypes[values]["name"],this.registerForm.type_id=this.workTypes[values]["id"]},onSubmit:function(){var e=this;this.submitLoading=!0,this.registerForm.type_ids=this.registerForm.type_ids+"",this.registerForm.idcard1=this.picKeys[0],this.registerForm.idcard2=this.picKeys[1],console.log(this.registerForm);var t=this;h(this.registerForm).then((function(e){t.$toast.success({message:"提交成功",duration:1e3,onClose:function(){t.$router.push({path:"/login"})}})})).catch((function(t){e.submitLoading=!1,console.log(t)}))}}},m=p,g=r("2877"),b=Object(g["a"])(m,i,a,!1,null,null,null);t["default"]=b.exports},7870:function(e,t,r){"use strict";r.d(t,"b",(function(){return a})),r.d(t,"a",(function(){return n})),r.d(t,"c",(function(){return o}));var i=r("9f4c");function a(e){return Object(i["a"])({url:"qiniu/token",method:"get",params:e})}function n(e){return Object(i["a"])({url:"send_verify_code",method:"get",params:e})}function o(e,t){return Object(i["a"])({url:"worksites/".concat(e),method:"get",params:t})}},"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 i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,i)}return r}function t(t){for(var r=1;r<arguments.length;r++){var i=null!=arguments[r]?arguments[r]:{};r%2?e(Object(i),!0).forEach((function(e){n(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):e(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,l(i.key),i)}}function a(e,t,r){return t&&i(e.prototype,t),r&&i(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function n(e,t,r){return t=l(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 i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}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 i=r.call(e,t||"default");if("object"!==typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function l(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,i=t.Blob&&function(){try{return Boolean(new Blob)}catch(e){return!1}}(),a=i&&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=(i||n)&&t.atob&&t.ArrayBuffer&&t.Uint8Array&&function(e){var t,r,s,l,c,u,d,h,f;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],l=e.slice(t[0].length),c=s?atob(l):decodeURIComponent(l),u=new ArrayBuffer(c.length),d=new Uint8Array(u),h=0;h<c.length;h+=1)d[h]=c.charCodeAt(h);return i?new Blob([a?d:u],{type:r}):(f=new n,f.append(u),f.getBlob(r))};t.HTMLCanvasElement&&!r.toBlob&&(r.mozGetAsFile?r.toBlob=function(e,t,i){var a=this;setTimeout((function(){i&&r.toDataURL&&s?e(s(a.toDataURL(t,i))):e(a.mozGetAsFile("blob",t))}))}:r.toDataURL&&s&&(r.msToBlob?r.toBlob=function(e,t,i){var a=this;setTimeout((function(){(t&&"image/png"!==t||i)&&r.toDataURL&&s?e(s(a.toDataURL(t,i))):e(a.msToBlob(t))}))}:r.toBlob=function(e,t,r){var i=this;setTimeout((function(){e(s(i.toDataURL(t,r)))}))})),e.exports?e.exports=s:t.dataURLtoBlob=s}(window)})(c);var u=c.exports,d=function(e){return"undefined"!==typeof Blob&&(e instanceof Blob||"[object Blob]"===Object.prototype.toString.call(e))},h={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},f="undefined"!==typeof window&&"undefined"!==typeof window.document,p=f?window:{},m=function(e){return e>0&&e<1/0},g=Array.prototype.slice;function b(e){return Array.from?Array.from(e):g.call(e)}var v=/^image\/.+$/;function w(e){return v.test(e)}function y(e){var t=w(e)?e.substr(6):"";return"jpeg"===t&&(t="jpg"),".".concat(t)}var k=String.fromCharCode;function x(e,t,r){var i,a="";for(r+=t,i=t;i<r;i+=1)a+=k(e.getUint8(i));return a}var F=p.btoa;function T(e,t){var r=[],i=8192,a=new Uint8Array(e);while(a.length>0)r.push(k.apply(null,b(a.subarray(0,i)))),a=a.subarray(i);return"data:".concat(t,";base64,").concat(F(r.join("")))}function O(e){var t,r=new DataView(e);try{var i,a,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)){a=s;break}s+=1}}if(a){var l=a+4,c=a+10;if("Exif"===x(r,l,4)){var u=r.getUint16(c);if(i=18761===u,(i||19789===u)&&42===r.getUint16(c+2,i)){var d=r.getUint32(c+4,i);d>=8&&(n=c+d)}}}if(n){var h,f,p=r.getUint16(n,i);for(f=0;f<p;f+=1)if(h=n+12*f+2,274===r.getUint16(h,i)){h+=8,t=r.getUint16(h,i),r.setUint16(h,1,i);break}}}catch(m){t=1}return t}function j(e){var t=0,r=1,i=1;switch(e){case 2:r=-1;break;case 3:t=-180;break;case 4:i=-1;break;case 5:t=90,i=-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:i}}var D=/\.\d*(?:0|9){12}\d*$/;function L(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e11;return D.test(e)?Math.round(e*t)/t:e}function U(e){var t=e.aspectRatio,r=e.height,i=e.width,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"none",n=m(i),o=m(r);if(n&&o){var s=r*t;("contain"===a||"none"===a)&&s>i||"cover"===a&&s<i?r=i/t:i=r*t}else n?r=i/t:o&&(i=r*t);return{width:i,height:r}}function B(e){var t=b(new Uint8Array(e)),r=t.length,i=[],a=0;while(a+3<r){var n=t[a],o=t[a+1];if(255===n&&218===o)break;if(255===n&&216===o)a+=2;else{var s=256*t[a+2]+t[a+3],l=a+s+2,c=t.slice(a,l);i.push(c),a=l}}return i.reduce((function(e,t){return 255===t[0]&&225===t[1]?e.concat(t):e}),[])}function C(e,t){var r=b(new Uint8Array(e));if(255!==r[2]||224!==r[3])return e;var i=256*r[4]+r[5],a=[255,216].concat(t,r.slice(4+i));return new Uint8Array(a)}var A=p.ArrayBuffer,R=p.FileReader,_=p.URL||p.webkitURL,E=/\.\w+$/,P=p.Compressor,$=function(){function e(i,a){r(this,e),this.file=i,this.exif=[],this.image=new Image,this.options=t(t({},h),a),this.aborted=!1,this.result=null,this.init()}return a(e,[{key:"init",value:function(){var e=this,t=this.file,r=this.options;if(d(t)){var i=t.type;if(w(i))if(_&&R){A||(r.checkOrientation=!1,r.retainExif=!1);var a="image/jpeg"===i,n=a&&r.checkOrientation,s=a&&r.retainExif;if(!_||n||s){var l=new R;this.reader=l,l.onload=function(r){var a=r.target,l=a.result,c={},u=1;n&&(u=O(l),u>1&&o(c,j(u))),s&&(e.exif=B(l)),c.url=n||s?!_||u>1?T(l,i):_.createObjectURL(t):l,e.load(c)},l.onabort=function(){e.fail(new Error("Aborted to read the image with FileReader."))},l.onerror=function(){e.fail(new Error("Failed to read the image with FileReader."))},l.onloadend=function(){e.reader=null},n||s?l.readAsArrayBuffer(t):l.readAsDataURL(t)}else this.load({url:_.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,i=this.file,a=this.image;a.onload=function(){r.draw(t(t({},e),{},{naturalWidth:a.naturalWidth,naturalHeight:a.naturalHeight}))},a.onabort=function(){r.fail(new Error("Aborted to load the image."))},a.onerror=function(){r.fail(new Error("Failed to load the image."))},p.navigator&&/(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(p.navigator.userAgent)&&(a.crossOrigin="anonymous"),a.alt=i.name,a.src=e.url}},{key:"draw",value:function(e){var t=this,r=e.naturalWidth,i=e.naturalHeight,a=e.rotate,n=void 0===a?0:a,o=e.scaleX,s=void 0===o?1:o,l=e.scaleY,c=void 0===l?1:l,d=this.file,h=this.image,f=this.options,p=document.createElement("canvas"),g=p.getContext("2d"),b=Math.abs(n)%180===90,v=("contain"===f.resize||"cover"===f.resize)&&m(f.width)&&m(f.height),y=Math.max(f.maxWidth,0)||1/0,k=Math.max(f.maxHeight,0)||1/0,x=Math.max(f.minWidth,0)||0,F=Math.max(f.minHeight,0)||0,O=r/i,j=f.width,D=f.height;if(b){var B=[k,y];y=B[0],k=B[1];var A=[F,x];x=A[0],F=A[1];var _=[D,j];j=_[0],D=_[1]}v&&(O=j/D);var E=U({aspectRatio:O,width:y,height:k},"contain");y=E.width,k=E.height;var P=U({aspectRatio:O,width:x,height:F},"cover");if(x=P.width,F=P.height,v){var $=U({aspectRatio:O,width:j,height:D},f.resize);j=$.width,D=$.height}else{var S=U({aspectRatio:O,width:j,height:D}),M=S.width;j=void 0===M?r:M;var W=S.height;D=void 0===W?i:W}j=Math.floor(L(Math.min(Math.max(j,x),y))),D=Math.floor(L(Math.min(Math.max(D,F),k)));var z=-j/2,H=-D/2,q=j,I=D,N=[];if(v){var K=0,V=0,G=r,J=i,X=U({aspectRatio:O,width:r,height:i},{contain:"cover",cover:"contain"}[f.resize]);G=X.width,J=X.height,K=(r-G)/2,V=(i-J)/2,N.push(K,V,G,J)}if(N.push(z,H,q,I),b){var Y=[D,j];j=Y[0],D=Y[1]}p.width=j,p.height=D,w(f.mimeType)||(f.mimeType=d.type);var Q="transparent";d.size>f.convertSize&&f.convertTypes.indexOf(f.mimeType)>=0&&(f.mimeType="image/jpeg");var Z="image/jpeg"===f.mimeType;if(Z&&(Q="#fff"),g.fillStyle=Q,g.fillRect(0,0,j,D),f.beforeDraw&&f.beforeDraw.call(this,g,p),!this.aborted&&(g.save(),g.translate(j/2,D/2),g.rotate(n*Math.PI/180),g.scale(s,c),g.drawImage.apply(g,[h].concat(N)),g.restore(),f.drew&&f.drew.call(this,g,p),!this.aborted)){var ee=function(e){if(!t.aborted){var a=function(e){return t.done({naturalWidth:r,naturalHeight:i,result:e})};if(e&&Z&&f.retainExif&&t.exif&&t.exif.length>0){var n=function(e){return a(u(T(C(e,t.exif),f.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 R;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 a(e)}};p.toBlob?p.toBlob(ee,f.mimeType,f.quality):ee(u(p.toDataURL(f.mimeType,f.quality)))}}},{key:"done",value:function(e){var t=e.naturalWidth,r=e.naturalHeight,i=e.result,a=this.file,n=this.image,o=this.options;if(_&&0===n.src.indexOf("blob:")&&_.revokeObjectURL(n.src),i)if(o.strict&&!o.retainExif&&i.size>a.size&&o.mimeType===a.type&&!(o.width>t||o.height>r||o.minWidth>t||o.minHeight>r||o.maxWidth<t||o.maxHeight<r))i=a;else{var s=new Date;i.lastModified=s.getTime(),i.lastModifiedDate=s,i.name=a.name,i.name&&i.type!==a.type&&(i.name=i.name.replace(E,y(i.type)))}else i=a;this.result=i,o.success&&o.success.call(this,i)}},{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=P,e}},{key:"setDefaults",value:function(e){o(h,e)}}]),e}();return $}))}}]);