31.1ffc2058fc3572076096.js 8.8 KB

12
  1. webpackJsonp([31],{"/HPE":function(t,r,o){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var e=o("pFYg"),i=o.n(e),n=o("mvHQ"),a=o.n(n),s=o("woOf"),c=o.n(s),l={name:"Certification",created:function(){this.initCardTypeOptions()},data:function(){return{form:{country:"",country_cn:"",cardType:0,cardNo:"",birth:"",firstName:"",lastName:""},countryLoading:!1,countryKeyword:"",countryDropdownVisible:!1,countryPopoverWidth:0,cardTypeDropdownVisible:!1,cardTypePopoverWidth:0,countryList:[],cardTypeOptions:[]}},watch:{countryDropdownVisible:function(t){var r=this;t&&this.$nextTick(function(){var t=r.$refs&&r.$refs.countryRef,o=t&&t.$el?t.$el:null,e=o&&o.offsetWidth?o.offsetWidth:0;r.countryPopoverWidth=e})},cardTypeDropdownVisible:function(t){var r=this;t&&this.$nextTick(function(){var t=r.$refs&&r.$refs.cardTypeRef,o=t&&t.$el?t.$el:null,e=o&&o.offsetWidth?o.offsetWidth:0;r.cardTypePopoverWidth=e})},form:{deep:!0,handler:function(){this.saveFormCache()}}},computed:{canNext:function(){var t=this.form||{},r=Number(t.cardType||0),o=t.birth,e=o instanceof Date?!isNaN(o.getTime()):!!o;return!!(t.country&&r&&t.cardNo&&e&&t.firstName&&t.lastName)},countryLabel:function(){var t=this.form&&this.form.country_cn?String(this.form.country_cn):"";return t?this.$t(t):this.form&&this.form.country?String(this.form.country):""},cardTypeLabel:function(){var t=Number(this.form&&this.form.cardType?this.form.cardType:0),r=Array.isArray(this.cardTypeOptions)?this.cardTypeOptions.find(function(r){return Number(r.value)===t}):null;return r&&r.label?String(r.label):""},countryShowList:function(){var t=Array.isArray(this.countryList)?this.countryList:[],r=String(this.countryKeyword||"").toLowerCase();return r?t.filter(function(t){return-1!==(t&&void 0!==t.country_name&&null!==t.country_name?String(t.country_name):"").toLowerCase().indexOf(r)}):t}},mounted:function(){this.restoreFormCache(),this.getCountryList()},activated:function(){this.restoreFormCache()},methods:{initCardTypeOptions:function(){this.cardTypeOptions=[{value:1,label:"身份证"},{value:2,label:"护照"},{value:3,label:"驾驶证"}]},syncCountryCnByName:function(t){var r=void 0!==t&&null!==t?String(t):"";if(r){var o=(Array.isArray(this.countryList)?this.countryList:[]).find(function(t){return t&&String(t.country_name)===r});this.form.country_cn=o&&o.country_cn?String(o.country_cn):""}else this.form.country_cn=""},saveFormCache:function(){try{var t=this.form&&this.form.birth instanceof Date?this.form.birth.getTime():this.form.birth,r=c()({},this.form,{birth:t});window.localStorage.setItem("CERTIFICATION_FORM_CACHE",a()(r))}catch(t){}},restoreFormCache:function(){try{var t=window.localStorage.getItem("CERTIFICATION_FORM_CACHE");if(!t)return;var r=JSON.parse(t);if(!r||"object"!==(void 0===r?"undefined":i()(r)))return;var o=void 0!==r.birth&&null!==r.birth&&""!==r.birth?new Date(r.birth):"";this.form=c()({},this.form,r,{birth:o})}catch(t){}},getCountryList:function(){var t=this;this.$api&&this.$api.auth&&this.$api.auth.countryCode&&(this.countryLoading||(this.countryLoading=!0,this.$api.auth.countryCode().then(function(r){var o=r&&r.data&&Array.isArray(r.data.list)?r.data.list:r&&Array.isArray(r.data)?r.data:[];t.countryList=Array.isArray(o)?o:[],t.form&&t.form.country&&t.syncCountryCnByName(t.form.country),t.countryLoading=!1}).catch(function(){t.countryLoading=!1})))},handleCountrySelect:function(t){var r=t&&void 0!==t.country_name&&null!==t.country_name?String(t.country_name):"",o=t&&t.country_cn?String(t.country_cn):"";this.form.country=r,this.form.country_cn=o,this.countryDropdownVisible=!1},handleCardTypeSelect:function(t){var r=t&&void 0!==t.value&&null!==t.value?Number(t.value):0;this.form.cardType=r,this.cardTypeDropdownVisible=!1},getIdentityVerificationInfo:function(){var t=this;this.$api&&this.$api.mine&&this.$api.mine.identityVerificationInfo&&this.$api.mine.identityVerificationInfo().then(function(r){var o=r&&r.data?r.data:null;o&&(t.form.country=o.country||"",t.syncCountryCnByName(t.form.country),t.form.cardType=o.type||0,t.form.cardNo=o.credential_no||"",t.form.birth=o.birthday?new Date(o.birthday):"",t.form.firstName=o.first_name||"",t.form.lastName=o.last_name||"")}).catch(function(){})},handleNext:function(){this.canNext&&(this.saveFormCache(),this.$router.push("/uploaduserMsg"))}}},u={render:function(){var t=this,r=t.$createElement,o=t._self._c||r;return o("div",{staticClass:"CertificationPage"},[o("div",{staticClass:"CertificationHeader"},[o("div",{staticClass:"CertificationHeaderTitle"},[t._v(t._s(t.$t("基础认证")))]),t._v(" "),o("div",{staticClass:"CertificationHeaderDesc"},[t._v(t._s(t.$t("请注意认证信息一经验证不能修改,务必填写准确信息")))])]),t._v(" "),o("div",{staticClass:"CertificationCard"},[o("div",{staticClass:"CertificationForm"},[o("div",{staticClass:"FormItem"},[o("div",{staticClass:"FormLabel"},[t._v(t._s(t.$t("国家/地区")))]),t._v(" "),o("el-popover",{attrs:{placement:"bottom-start",trigger:"click","popper-class":"CountryDropdownPopper",width:t.countryPopoverWidth||void 0},model:{value:t.countryDropdownVisible,callback:function(r){t.countryDropdownVisible=r},expression:"countryDropdownVisible"}},[o("div",{staticClass:"CountryDropdown",on:{mousedown:function(t){t.stopPropagation()}}},[o("el-input",{staticClass:"CountrySearch",attrs:{placeholder:t.$t("请输入")},on:{mousedown:function(t){t.stopPropagation()}},model:{value:t.countryKeyword,callback:function(r){t.countryKeyword=r},expression:"countryKeyword"}}),t._v(" "),o("div",{staticClass:"CountryList"},[t._l(t.countryShowList,function(r){return o("div",{key:r.country_name,staticClass:"CountryItem",on:{mousedown:function(t){t.stopPropagation()},click:function(o){t.handleCountrySelect(r)}}},[o("div",{staticClass:"CountryItemText"},[t._v(t._s(t.$t(r.country_cn)))])])}),t._v(" "),t.countryLoading||t.countryShowList&&0!==t.countryShowList.length?t._e():o("div",{staticClass:"CountryEmpty"},[t._v("\n "+t._s(t.$t("暂无数据"))+"\n ")])],2)],1),t._v(" "),o("el-input",{ref:"countryRef",staticClass:"FormControl",attrs:{slot:"reference",value:t.countryLabel,readonly:"",placeholder:t.$t("请选择"),"suffix-icon":"el-icon-arrow-down"},slot:"reference"})],1)],1),t._v(" "),o("div",{staticClass:"FormItem"},[o("div",{staticClass:"FormLabel"},[t._v(t._s(t.$t("证件类型")))]),t._v(" "),o("el-popover",{attrs:{placement:"bottom-start",trigger:"click","popper-class":"CardTypeDropdownPopper",width:t.cardTypePopoverWidth||void 0},model:{value:t.cardTypeDropdownVisible,callback:function(r){t.cardTypeDropdownVisible=r},expression:"cardTypeDropdownVisible"}},[o("div",{staticClass:"CardTypeDropdown",on:{mousedown:function(t){t.stopPropagation()}}},[o("div",{staticClass:"CardTypeList"},t._l(t.cardTypeOptions,function(r){return o("div",{key:r.value,staticClass:"CardTypeItem",on:{mousedown:function(t){t.stopPropagation()},click:function(o){t.handleCardTypeSelect(r)}}},[o("div",{staticClass:"CardTypeItemText"},[t._v(t._s(t.$t(r.label)))])])}))]),t._v(" "),o("el-input",{ref:"cardTypeRef",staticClass:"FormControl",attrs:{slot:"reference",value:t.cardTypeLabel,readonly:"",placeholder:t.$t("请选择"),"suffix-icon":"el-icon-arrow-down"},slot:"reference"})],1)],1),t._v(" "),o("div",{staticClass:"FormItem"},[o("div",{staticClass:"FormLabel"},[t._v(t._s(t.$t("证件编码")))]),t._v(" "),o("el-input",{staticClass:"FormControl",attrs:{placeholder:t.$t("请输入")},model:{value:t.form.cardNo,callback:function(r){t.$set(t.form,"cardNo",r)},expression:"form.cardNo"}})],1),t._v(" "),o("div",{staticClass:"FormItem"},[o("div",{staticClass:"FormLabel"},[t._v(t._s(t.$t("出生日期")))]),t._v(" "),o("el-date-picker",{staticClass:"FormControl",attrs:{type:"date",placeholder:t.$t("请选择")},model:{value:t.form.birth,callback:function(r){t.$set(t.form,"birth",r)},expression:"form.birth"}})],1),t._v(" "),o("div",{staticClass:"FormItem"},[o("div",{staticClass:"FormLabel"},[t._v(t._s(t.$t("名字")))]),t._v(" "),o("el-input",{staticClass:"FormControl",attrs:{placeholder:t.$t("请输入")},model:{value:t.form.firstName,callback:function(r){t.$set(t.form,"firstName",r)},expression:"form.firstName"}})],1),t._v(" "),o("div",{staticClass:"FormItem"},[o("div",{staticClass:"FormLabel"},[t._v(t._s(t.$t("姓氏")))]),t._v(" "),o("el-input",{staticClass:"FormControl",attrs:{placeholder:t.$t("请输入")},model:{value:t.form.lastName,callback:function(r){t.$set(t.form,"lastName",r)},expression:"form.lastName"}})],1),t._v(" "),o("div",{staticClass:"FormItem FormItemEmpty"}),t._v(" "),o("div",{staticClass:"FormItem FormItemBtn"},[o("div",{staticClass:"NextBtn",class:{"is-disabled":!t.canNext},on:{click:t.handleNext}},[t._v(t._s(t.$t("下一步")))])])])])])},staticRenderFns:[]};var d=o("VU/8")(l,u,!1,function(t){o("qGNw"),o("DQ5v")},"data-v-4be94b59",null);r.default=d.exports},DQ5v:function(t,r){},qGNw:function(t,r){}});
  2. //# sourceMappingURL=31.1ffc2058fc3572076096.js.map