chunk-042b5119.4a31a996.js 17 KB

1234567891011
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-042b5119"],{"09bb":function(e,t,r){"use strict";r.d(t,"b",(function(){return a})),r.d(t,"a",(function(){return n}));var i=r("f0e1");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})}},"7be5":function(e,t,r){"use strict";var i=r("7139");t["a"]={customer:i["a"].baseApi+"api/aftersale/customer/",work:i["a"].baseApi+"worker/",weixin:i["a"].baseUrl+"api/weixin/"}},a8d0:function(e,t,r){"use strict";r.r(t);var i=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",[r("van-nav-bar",{staticClass:"shadow mb-4",attrs:{title:"注册","left-text":"返回","left-arrow":""},on:{"click-left":function(t){return e.$router.back(-1)}}}),r("van-form",{staticClass:"w-11/12 mx-auto",on:{submit:e.onSubmit}},[r("div",{staticClass:"shadow"},[r("p",{staticClass:"bg-yellow-600 bg-opacity-80 text-white px-4 py-2"},[e._v("基本信息")]),r("div",{staticClass:"van-cell van-cell--clickable van-field"},[r("span",{staticClass:"van-cell__title van-field__label"},[e._v("工种")]),r("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 r("el-option",{key:e.id,attrs:{label:e.name,value:e.id}})})),1)],1),r("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"}}),r("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"}}),r("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"}}),r("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"}}),r("van-field",{attrs:{clearable:"",type:"digit",label:"短信验证码",placeholder:"请输入短信验证码",rules:[{required:!0}]},scopedSlots:e._u([{key:"button",fn:function(){return[r("van-button",{attrs:{disabled:e.sendDisabled,loading:e.sendLoading,size:"small",type:"primary"},on:{click:e.handSendVerifyCode}},[r("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}}),r("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"}}),r("van-field",{attrs:{name:"uploader",label:"身份证正面"},scopedSlots:e._u([{key:"input",fn:function(){return[r("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}])}),r("van-field",{attrs:{name:"uploader",label:"身份证反面"},scopedSlots:e._u([{key:"input",fn:function(){return[r("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),r("div",{staticClass:"mt-8"},[r("van-button",{attrs:{loading:e.submitLoading,block:"",type:"info","loading-text":"加载中...","native-type":"submit"}},[e._v("注册")])],1)])],1)},a=[],n=(r("f8c2"),r("4d38"),r("c08f"),r("09ed"),r("e4de"),r("b00a"),r("f0e1")),o=r("7be5");function s(e){return Object(n["a"])({url:o["a"].customer+"regions",method:"get",params:e})}var l=r("09bb"),c=r("d7f4"),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("cba8"),b=Object(g["a"])(m,i,a,!1,null,null,null);t["default"]=b.exports},d7f4:function(e,t,r){
  2. /*!
  3. * Compressor.js v1.1.1
  4. * https://fengyuanchen.github.io/compressorjs
  5. *
  6. * Copyright 2018-present Chen Fengyuan
  7. * Released under the MIT license
  8. *
  9. * Date: 2021-10-05T02:32:40.212Z
  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,i.key,i)}}function a(e,t,r){return t&&i(e.prototype,t),r&&i(e,r),e}function n(e,t,r){return 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||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)}var s={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)})(s);var l=s.exports,c=function(e){return"undefined"!==typeof Blob&&(e instanceof Blob||"[object Blob]"===Object.prototype.toString.call(e))},u={strict:!0,checkOrientation:!0,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},d="undefined"!==typeof window&&"undefined"!==typeof window.document,h=d?window:{},f=function(e){return e>0&&e<1/0},p=Array.prototype.slice;function m(e){return Array.from?Array.from(e):p.call(e)}var g=/^image\/.+$/;function b(e){return g.test(e)}function v(e){var t=b(e)?e.substr(6):"";return"jpeg"===t&&(t="jpg"),".".concat(t)}var w=String.fromCharCode;function y(e,t,r){var i,a="";for(r+=t,i=t;i<r;i+=1)a+=w(e.getUint8(i));return a}var k=h.btoa;function F(e,t){var r=[],i=8192,a=new Uint8Array(e);while(a.length>0)r.push(w.apply(null,m(a.subarray(0,i)))),a=a.subarray(i);return"data:".concat(t,";base64,").concat(k(r.join("")))}function x(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"===y(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 T(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 O(e){var t=e.aspectRatio,r=e.height,i=e.width,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"none",n=f(i),o=f(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}}var j=h.ArrayBuffer,U=h.FileReader,C=h.URL||h.webkitURL,B=/\.\w+$/,R=h.Compressor,_=function(){function e(i,a){r(this,e),this.file=i,this.image=new Image,this.options=t(t({},u),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(c(t)){var i=t.type;if(b(i))if(C&&U)if(j||(r.checkOrientation=!1),C&&!r.checkOrientation)this.load({url:C.createObjectURL(t)});else{var a=new U,n=r.checkOrientation&&"image/jpeg"===i;this.reader=a,a.onload=function(r){var a=r.target,s=a.result,l={};if(n){var c=x(s);c>1||!C?(l.url=F(s,i),c>1&&o(l,T(c))):l.url=C.createObjectURL(t)}else l.url=s;e.load(l)},a.onabort=function(){e.fail(new Error("Aborted to read the image with FileReader."))},a.onerror=function(){e.fail(new Error("Failed to read the image with FileReader."))},a.onloadend=function(){e.reader=null},n?a.readAsArrayBuffer(t):a.readAsDataURL(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."))},h.navigator&&/(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(h.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,c=e.scaleY,u=void 0===c?1:c,d=this.file,h=this.image,p=this.options,m=document.createElement("canvas"),g=m.getContext("2d"),v=Math.abs(n)%180===90,w=("contain"===p.resize||"cover"===p.resize)&&f(p.width)&&f(p.height),y=Math.max(p.maxWidth,0)||1/0,k=Math.max(p.maxHeight,0)||1/0,F=Math.max(p.minWidth,0)||0,x=Math.max(p.minHeight,0)||0,T=r/i,D=p.width,j=p.height;if(v){var U=[k,y];y=U[0],k=U[1];var C=[x,F];F=C[0],x=C[1];var B=[j,D];D=B[0],j=B[1]}w&&(T=D/j);var R=O({aspectRatio:T,width:y,height:k},"contain");y=R.width,k=R.height;var _=O({aspectRatio:T,width:F,height:x},"cover");if(F=_.width,x=_.height,w){var A=O({aspectRatio:T,width:D,height:j},p.resize);D=A.width,j=A.height}else{var $=O({aspectRatio:T,width:D,height:j}),P=$.width;D=void 0===P?r:P;var M=$.height;j=void 0===M?i:M}D=Math.floor(L(Math.min(Math.max(D,F),y))),j=Math.floor(L(Math.min(Math.max(j,x),k)));var E=-D/2,S=-j/2,W=D,z=j,H=[];if(w){var q=0,I=0,N=r,K=i,V=O({aspectRatio:T,width:r,height:i},{contain:"cover",cover:"contain"}[p.resize]);N=V.width,K=V.height,q=(r-N)/2,I=(i-K)/2,H.push(q,I,N,K)}if(H.push(E,S,W,z),v){var G=[j,D];D=G[0],j=G[1]}m.width=D,m.height=j,b(p.mimeType)||(p.mimeType=d.type);var J="transparent";if(d.size>p.convertSize&&p.convertTypes.indexOf(p.mimeType)>=0&&(p.mimeType="image/jpeg"),"image/jpeg"===p.mimeType&&(J="#fff"),g.fillStyle=J,g.fillRect(0,0,D,j),p.beforeDraw&&p.beforeDraw.call(this,g,m),!this.aborted&&(g.save(),g.translate(D/2,j/2),g.rotate(n*Math.PI/180),g.scale(s,u),g.drawImage.apply(g,[h].concat(H)),g.restore(),p.drew&&p.drew.call(this,g,m),!this.aborted)){var X=function(e){t.aborted||t.done({naturalWidth:r,naturalHeight:i,result:e})};m.toBlob?m.toBlob(X,p.mimeType,p.quality):X(l(m.toDataURL(p.mimeType,p.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(C&&!o.checkOrientation&&C.revokeObjectURL(n.src),i)if(o.strict&&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(B,v(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=R,e}},{key:"setDefaults",value:function(e){o(u,e)}}]),e}();return _}))}}]);