|
@@ -33,14 +33,28 @@ export default {
|
|
|
methods: {
|
|
|
jumpBind(){
|
|
|
let that = this
|
|
|
- if(!this.form.realname){
|
|
|
+
|
|
|
+ if(!this.form.realname.trim()){
|
|
|
this.$u.toast('请输入学员姓名');
|
|
|
return
|
|
|
}
|
|
|
- if(!this.form.idCard){
|
|
|
+ if(!this.form.idCard.trim()){
|
|
|
this.$u.toast('请输入身份证卡号');
|
|
|
return
|
|
|
}
|
|
|
+
|
|
|
+ let IDRe18 = /^([1-6][1-9]|50)\d{4}(18|19|20)\d{2}((0[1-9])|10|11|12)(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/
|
|
|
+ let IDre15 = /^([1-6][1-9]|50)\d{4}\d{2}((0[1-9])|10|11|12)(([0-2][1-9])|10|20|30|31)\d{3}$/
|
|
|
+
|
|
|
+ if( !IDRe18.test( this.form.idCard ) && !IDre15.test( this.form.idCard ) ) {
|
|
|
+ this.$u.toast('请输入格式正确的身份证卡号');
|
|
|
+ console.log(' 验证未通过 ')
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ this.$set(this.form,'realname',this.form.realname.trim()) //去除姓名两头空格
|
|
|
+
|
|
|
that.isUse = true
|
|
|
that.$api.bindId(this.form).then(
|
|
|
res => {
|