浏览代码

手机号限制修改

twt 2 周之前
父节点
当前提交
50c9c986e5
共有 2 个文件被更改,包括 18 次插入3 次删除
  1. 9 1
      pages/index/confirmRescue.vue
  2. 9 2
      pages/index/confirmYuyue.vue

+ 9 - 1
pages/index/confirmRescue.vue

@@ -190,7 +190,7 @@
 					});
 					return false;
 				} */
-				var reg = /^1[3|4|5|7|8][0-9]\d{8}$/;
+				/* var reg = /^1[3|4|5|7|8][0-9]\d{8}$/;
 				if(reg.test(this.mobilePhone) == false ){
 				    console.log("手机号码格式不正确");
 				     uni.showToast({
@@ -199,6 +199,14 @@
 				     	duration: 3000
 				     });
 				     return false;   
+				} */
+				if(this.mobilePhone.length!=11){
+					uni.showToast({
+						title: '请输入正确的手机号',
+						icon: 'none',
+						duration: 3000
+					});
+					return false;
 				}
 				if(!this.mobilePhone){
 					uni.showToast({

+ 9 - 2
pages/index/confirmYuyue.vue

@@ -140,7 +140,7 @@
 					});
 					return false;
 				} */
-				var reg = /^1[3|4|5|7|8][0-9]\d{8}$/;
+				/* var reg = /^1[3|4|5|7|8][0-9]\d{8}$/;
 				if(reg.test(this.mobilePhone) == false ){
 				    console.log("手机号码格式不正确");
 				     uni.showToast({
@@ -149,8 +149,15 @@
 				     	duration: 3000
 				     });
 				     return false;   
+				} */
+				if(this.mobilePhone.length!=11){
+					uni.showToast({
+						title: '请输入正确的手机号',
+						icon: 'none',
+						duration: 3000
+					});
+					return false;
 				}
-				
 				if(!this.billDate){
 					uni.showToast({
 						title: '请选择预约时间',