1 |
- webpackJsonp([20],{KcAV:function(t,e,a){var n=a("jYoL");"string"==typeof n&&(n=[[t.i,n,""]]),n.locals&&(t.exports=n.locals);a("rjj0")("1c83e766",n,!1,{})},jYoL:function(t,e,a){(e=a("yGwj")(!0)).push([t.i,"\n.el-radio[data-v-e1144fa2] {\n margin: 10px 20px 10px 0;\n}\n.el-form-item[data-v-e1144fa2] .el-tabs__content {\n /*max-height: 120px !important;*/\n overflow: auto;\n}\n.el-row[data-v-e1144fa2] {\n margin-bottom: 10px;\n}\n.el-input[data-v-e1144fa2] {\n width: 400px;\n}\n.avatar-uploader .el-upload[data-v-e1144fa2] {\n border: 1px dashed #d9d9d9;\n border-radius: 6px;\n cursor: pointer;\n position: relative;\n overflow: hidden;\n}\n.avatar-uploader .el-upload[data-v-e1144fa2]:hover {\n border-color: #409EFF;\n}\n.avatar-uploader-icon[data-v-e1144fa2] {\n border: 1px dashed #d9d9d9;\n border-radius: 6px;\n font-size: 28px;\n color: #8c939d;\n width: 176px;\n height: 178px;\n line-height: 178px;\n text-align: center;\n}\n.avatar-uploader-icon[data-v-e1144fa2]:hover {\n border-color: #409EFF;\n}\n.avatar[data-v-e1144fa2] {\n width: 178px;\n height: 178px;\n display: block;\n}\n","",{version:3,sources:["IndividualAuthentication.vue"],names:[],mappings:";AACA;EACE,wBAAwB;AAC1B;AACA;EACE,gCAAgC;EAChC,cAAc;AAChB;AACA;EACE,mBAAmB;AACrB;AACA;EACE,YAAY;AACd;AACA;EACE,0BAA0B;EAC1B,kBAAkB;EAClB,eAAe;EACf,kBAAkB;EAClB,gBAAgB;AAClB;AACA;EACE,qBAAqB;AACvB;AACA;EACE,0BAA0B;EAC1B,kBAAkB;EAClB,eAAe;EACf,cAAc;EACd,YAAY;EACZ,aAAa;EACb,kBAAkB;EAClB,kBAAkB;AACpB;AACA;EACE,qBAAqB;AACvB;AACA;EACE,YAAY;EACZ,aAAa;EACb,cAAc;AAChB",file:"IndividualAuthentication.vue",sourcesContent:["\n.el-radio[data-v-e1144fa2] {\n margin: 10px 20px 10px 0;\n}\n.el-form-item[data-v-e1144fa2] .el-tabs__content {\n /*max-height: 120px !important;*/\n overflow: auto;\n}\n.el-row[data-v-e1144fa2] {\n margin-bottom: 10px;\n}\n.el-input[data-v-e1144fa2] {\n width: 400px;\n}\n.avatar-uploader .el-upload[data-v-e1144fa2] {\n border: 1px dashed #d9d9d9;\n border-radius: 6px;\n cursor: pointer;\n position: relative;\n overflow: hidden;\n}\n.avatar-uploader .el-upload[data-v-e1144fa2]:hover {\n border-color: #409EFF;\n}\n.avatar-uploader-icon[data-v-e1144fa2] {\n border: 1px dashed #d9d9d9;\n border-radius: 6px;\n font-size: 28px;\n color: #8c939d;\n width: 176px;\n height: 178px;\n line-height: 178px;\n text-align: center;\n}\n.avatar-uploader-icon[data-v-e1144fa2]:hover {\n border-color: #409EFF;\n}\n.avatar[data-v-e1144fa2] {\n width: 178px;\n height: 178px;\n display: block;\n}\n"]}]),t.exports=e},ygwZ:function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=a("SQ4B"),i=a("b9vf"),o=a("qI5z"),r=a("vGYV"),s={name:"IndividualAuthentication",data:function(){var t=this;return{userId:0,user:{},loading:!1,isModifyMode:!1,authentication:{IDCardPositivePhoto:r.c.image,realName:"",IDCard:"",bankAccount:"",address:"",authStatus:{},explain:""},rules:{IDCard:[{required:!0,message:"请输入身份证号",trigger:"blur"},{min:18,max:18,message:"身份证号输入有误",trigger:"blur"}],realName:[{required:!0,message:"请输入身份证上的姓名",trigger:"blur"}],IDCardPositivePhoto:[{validator:function(t,e,a){console.log(e),null==e||""==e?a(new Error("手持身份证照片不能为空")):a()},trigger:"blue"}],bankAccount:[{required:!0,message:"请输入银行卡账户",trigger:"blur"},{min:16,max:19,message:"银行卡账户输入有误",trigger:"blur"},{validator:function(e,a,n){t.checkNumber(a)?n():n(new Error("对银行卡账户有误"))},trigger:"blur"}],address:[{required:!0,message:"请输入地址",trigger:"blur"}]}}},mounted:function(){var t=this;this.$nextTick(function(){t.init()})},watch:{deep:!0},methods:{init:function(){this.setUserInfo(),this.getAuthInfo()},getAuthInfo:function(){this.showLoading(),Object(r.v)(this.user.userVO.id,this.getAuthInfoSuccess,this.getAuthInfoFail)},getAuthInfoSuccess:function(t){this.hideLoading(),this.authentication.IDCardPositivePhoto=null==t.idCardPositivePhotoi?r.c.image:t.idCardPositivePhotoi,this.authentication.realName=null==t.realName?"暂未填写":t.realName,this.authentication.IDCard=null==t.idcard?"暂未填写":t.idcard,this.authentication.bankAccount=null==t.bankAccount?"暂未填写":t.bankAccount,this.authentication.address=null==t.address?"暂未填写":t.address,this.authentication.authStatus=t.authStatus,this.authentication.explain=t.explain,console.log(this.authentication)},getAuthInfoFail:function(t){this.hideLoading(),Object(o.a)("error","加载认证信息失败:"+t.data)},modifyInfo:function(){this.isModifyMode=!0},updateAuthInfo:function(){var t=this;this.$refs.authentication.validate(function(e){if(!e)return Object(o.a)("error","表单填写错误!"),!1;t.showLoading();var a={userId:t.user.userVO.id,realName:t.authentication.realName,bankAccount:t.authentication.bankAccount,address:t.authentication.address,IDCardPositivePhoto:t.authentication.IDCardPositivePhoto,IDCard:t.authentication.IDCard};Object(r.T)(t.user.userVO.id,a,t.updateAuthInfoSuccess,t.updateAuthInfoFail)})},updateAuthInfoSuccess:function(t){var e=this;this.hideLoading(),this.authentication.IDCardPositivePhoto=null==t.idCardPositivePhotoi?r.c.image:t.idCardPositivePhotoi,this.authentication.realName=null==t.realName?"暂未填写":t.realName,this.authentication.IDCard=null==t.idcard?"暂未填写":t.idcard,this.authentication.bankAccount=null==t.bankAccount?"暂未填写":t.bankAccount,this.authentication.address=null==t.address?"暂未填写":t.address,this.cancelModify(),Object(o.a)("success","认证信息修改成功,正在为您刷新用户信息"),Object(r.w)().then(function(t){Object(r.O)("user",t),e.user=t,e.sendBusMessage(),Object(r.O)("rolesPermissions",Object(r.C)(t.roleList)),e.hideLoading(),Object(o.a)("success","用户信息刷新成功")}).catch(function(t){e.hideLoading(),Object(o.a)("error","重新获取用户信息失败:"+t.data)})},updateAuthInfoFail:function(t){this.hideLoading(),Object(o.a)("error",t.data)},cancelModify:function(){this.getAuthInfo(),this.isModifyMode=!1},handleRemove:function(t,e){console.log(t,e)},handleExceed:function(t,e){this.$message.warning("当前限制选择 1 个文件,本次选择了 "+t.length+" 个文件,共选择了 "+(t.length+e.length)+" 个文件")},beforeRemove:function(t,e){},beforeFileUpload:function(t){if(t.size>1e7)return Object(o.a)("error","单个文件大小不能超过10M"),!1;var e=t.namep,a=e.lastIndexOf(".");if(a<=0)return Object(o.a)("error","只能上传png/jpg格式的文件"),!1;var n=e.substr(a);return".jpg"!==n&&".png"!==n?(Object(o.a)("error","只能上传png/jpg格式的文件"),!1):void 0},uploadFile:function(t){var e=this;this.showLoading();var a=new FormData;a.append("file",t.file),n.a.upload(i.a.FILE.UPLOAD_IMAGE.replace("{userId}",this.user.userVO.id),a,{headers:{"Content-Type":"multipart/form-data"}}).then(function(t){e.hideLoading(),console.log("上传成功"),e.authentication.IDCardPositivePhoto=t.data,console.log(t.data),Object(o.a)("success","上传成功"),e.$refs.authentication.validateField("IDCardPositivePhoto")}).catch(function(t){e.hideLoading();try{413===t.response.status?Object(o.a)("error","文件过大,请选择小于20M的图片"):500===t.response.status&&Object(o.a)("error","上传文件发生错误,请稍后重试")}catch(e){Object(o.a)("error",t.data)}})},setUserInfo:function(){this.user=Object(r.M)("user")},showLoading:function(){this.loading=!0},hideLoading:function(){this.loading=!1},sendBusMessage:function(){this.$root.$emit("user",this.user)},checkNumber:function(t){return/^\d+$/.test(t)}},created:function(){}},d=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticClass:"create-container"},[a("div",{staticClass:"create-body"},[a("div",{staticClass:"title"},[t._v("个人信息认证")]),t._v(" "),a("el-form",{ref:"authentication",staticClass:"demo-report",attrs:{model:t.authentication,rules:t.rules,"label-width":"12%"}},[a("el-form-item",{attrs:{label:"姓名",prop:"realName"}},[t.isModifyMode?a("el-input",{model:{value:t.authentication.realName,callback:function(e){t.$set(t.authentication,"realName",e)},expression:"authentication.realName"}}):t._e(),t._v(" "),t.isModifyMode?t._e():a("span",[t._v(t._s(t.authentication.realName))])],1),t._v(" "),a("el-form-item",{attrs:{prop:"IDCardPositivePhoto",label:"手持身份证照片"}},[t.isModifyMode?a("el-upload",{staticClass:"avatar-uploader",attrs:{action:"","show-file-list":!1,"http-request":t.uploadFile,"before-upload":t.beforeFileUpload}},[t.authentication.IDCardPositivePhoto?a("img",{staticClass:"avatar",attrs:{src:t.authentication.IDCardPositivePhoto}}):a("i",{staticClass:"el-icon-plus avatar-uploader-icon"})]):t._e(),t._v(" "),t.isModifyMode?t._e():a("span",[a("el-image",{staticStyle:{width:"100px"},attrs:{src:t.authentication.IDCardPositivePhoto,fit:"scale-down"}})],1)],1),t._v(" "),a("el-form-item",{attrs:{label:"身份证号",prop:"IDCard"}},[t.isModifyMode?a("el-input",{model:{value:t.authentication.IDCard,callback:function(e){t.$set(t.authentication,"IDCard",e)},expression:"authentication.IDCard"}}):t._e(),t._v(" "),t.isModifyMode?t._e():a("span",[t._v(t._s(t.authentication.IDCard))])],1),t._v(" "),t.isModifyMode?t._e():a("el-form-item",{attrs:{label:"认证状态",prop:"name"}},[a("el-tag",{attrs:{type:t.authentication.authStatus.style}},[t._v(t._s(t.authentication.authStatus.text))])],1),t._v(" "),t.isModifyMode||"认证失败"!=t.authentication.authStatus.text?t._e():a("el-form-item",{attrs:{label:"失败原因",prop:"name"}},[null!=t.authentication.explain&&""!=t.authentication.explain?a("el-link",{attrs:{type:"danger",disabled:""}},[t._v("\n "+t._s(t.authentication.explain)+"\n ")]):t._e(),t._v(" "),null==t.authentication.explain||""==t.authentication.explain?a("el-link",{attrs:{type:"danger",disabled:""}},[t._v("管理员未填写\n ")]):t._e()],1),t._v(" "),a("el-form-item",{attrs:{label:"地址",prop:"address"}},[t.isModifyMode?a("el-input",{model:{value:t.authentication.address,callback:function(e){t.$set(t.authentication,"address",e)},expression:"authentication.address"}}):t._e(),t._v(" "),t.isModifyMode?t._e():a("span",[t._v(t._s(t.authentication.address))])],1),t._v(" "),t.isModifyMode?t._e():a("el-form-item",["认证通过"!=t.authentication.authStatus.text?a("div",{staticClass:"btn btn-medium btn-info",on:{click:function(e){return t.modifyInfo()}}},[t._v("修改\n ")]):t._e()]),t._v(" "),t.isModifyMode?a("el-form-item",[a("div",{staticClass:"btn btn-primary btn-info",on:{click:function(e){return t.updateAuthInfo()}}},[t._v("提交")]),t._v(" "),a("div",{staticClass:"btn btn-primary",on:{click:function(e){return t.cancelModify()}}},[t._v("取消")])]):t._e()],1)],1)])};d._withStripped=!0;var u={render:d,staticRenderFns:[]},c=u;var l=!1;var h=a("VU/8")(s,c,!1,function(t){l||a("KcAV")},"data-v-e1144fa2",null);h.options.__file="src/components/authen/IndividualAuthentication.vue";e.default=h.exports}});
|