diff --git a/subpages/heart/pages/volunteer/volunteer.js b/subpages/heart/pages/volunteer/volunteer.js
index 40fd742..88eb57f 100644
--- a/subpages/heart/pages/volunteer/volunteer.js
+++ b/subpages/heart/pages/volunteer/volunteer.js
@@ -180,10 +180,17 @@ Page({
this.showToast('姓名不能超过20个字')
return false
}
+
if (!this.data.identityNo) {
this.showToast('请输入身份证号')
return false
}
+ var reg = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/;
+ if (reg.test(this.data.identityNo) === false) {
+ this.showToast('请输入正确的身份证号')
+ return false
+ }
+
if (this.data.getMobileType === 'wx') {
if (!this.data.mobile) {
this.showToast('请获取手机号')
diff --git a/subpages/heart/pages/volunteer/volunteer.wxml b/subpages/heart/pages/volunteer/volunteer.wxml
index 52e7cb3..141d8f0 100644
--- a/subpages/heart/pages/volunteer/volunteer.wxml
+++ b/subpages/heart/pages/volunteer/volunteer.wxml
@@ -18,7 +18,7 @@
姓名
-
+
@@ -79,7 +79,7 @@
-
+
@@ -110,7 +110,7 @@
-
+