Commit 6288bc564e9460265b8bbdf0fdb77c7ad91382c3

Authored by vking
1 parent 6dd0beb4

fixbug【周到安排小程序,198的电话无法下单和添加联系人】https://www.tapd.cn/57419716/bugtrace/bugs/view?…

…bug_id=1157419716001003607
@@ -66,8 +66,11 @@ Page({ @@ -66,8 +66,11 @@ Page({
66 return util.toast('请填写预定人','none') 66 return util.toast('请填写预定人','none')
67 } 67 }
68 if(!this.user.phone){ 68 if(!this.user.phone){
69 - return util.toast('请填写正确的手机号','none') 69 + return util.toast('请填写手机号','none')
70 } 70 }
  71 + if(!/^[1][3-9][0-9]{9}$/.test(this.user.phone)){
  72 + return util.toast('请填写正确的手机号','none')
  73 + }
71 App.Customer.SetCustomerInfo({ 74 App.Customer.SetCustomerInfo({
72 ...this.user 75 ...this.user
73 }).then(res=>{ 76 }).then(res=>{
@@ -89,13 +92,6 @@ Page({ @@ -89,13 +92,6 @@ Page({
89 val = util.attr(e, 'val'); 92 val = util.attr(e, 'val');
90 console.log(val) 93 console.log(val)
91 } else { 94 } else {
92 - if(key=='phone'){  
93 - console.log('key',key)  
94 - let myreg=/^[1][3-9][0-9]{9}$/;  
95 - if(!myreg.test(util.val(e))){  
96 - return util.val(e);  
97 - }  
98 - }  
99 val = util.val(e); 95 val = util.val(e);
100 } 96 }
101 this.user[key] = val; 97 this.user[key] = val;
@@ -113,12 +113,6 @@ Page({ @@ -113,12 +113,6 @@ Page({
113 if (key == 'sex') { 113 if (key == 'sex') {
114 val = util.attr(e, 'val'); 114 val = util.attr(e, 'val');
115 } else { 115 } else {
116 - if(key=='phone'){  
117 - let myreg=/^[1][3-9][0-9]{9}$/;  
118 - if(!myreg.test(util.val(e))){  
119 - return util.val(e);  
120 - }  
121 - }  
122 val = util.val(e); 116 val = util.val(e);
123 } 117 }
124 this.user[key] = val; 118 this.user[key] = val;
@@ -135,6 +129,9 @@ Page({ @@ -135,6 +129,9 @@ Page({
135 return util.toast('请填写姓名','none') 129 return util.toast('请填写姓名','none')
136 } 130 }
137 if(!this.user.phone){ 131 if(!this.user.phone){
  132 + return util.toast('请填写手机号','none')
  133 + }
  134 + if(!/^[1][3-9][0-9]{9}$/.test(this.user.phone)){
138 return util.toast('请填写正确的手机号','none') 135 return util.toast('请填写正确的手机号','none')
139 } 136 }
140 this.hasSubmit=false; 137 this.hasSubmit=false;