(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){ /*! * Compressor.js v1.2.1 * https://fengyuanchen.github.io/compressorjs * * Copyright 2018-present Chen Fengyuan * Released under the MIT license * * Date: 2023-02-28T14:09:41.732Z */ (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;r0&&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;i0)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=8&&(n=c+d)}}}if(n){var h,f,p=r.getUint16(n,i);for(f=0;f1&&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&&s1&&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