Commit 09726eb7aae6c6c52aaa49194c71c85518b5779f

Authored by liuxuqinfhp1220
1 parent 5ae2d7fd

no message

@@ -65,6 +65,9 @@ Page({ @@ -65,6 +65,9 @@ Page({
65 if(!this.user.name){ 65 if(!this.user.name){
66 return util.toast('请填写预定人','none') 66 return util.toast('请填写预定人','none')
67 } 67 }
  68 + if(!this.user.phone){
  69 + return util.toast('请填写正确的手机号','none')
  70 + }
68 App.Customer.SetCustomerInfo({ 71 App.Customer.SetCustomerInfo({
69 ...this.user 72 ...this.user
70 }).then(res=>{ 73 }).then(res=>{
@@ -84,6 +87,13 @@ Page({ @@ -84,6 +87,13 @@ Page({
84 val = util.attr(e, 'val'); 87 val = util.attr(e, 'val');
85 console.log(val) 88 console.log(val)
86 } else { 89 } else {
  90 + if(key=='phone'){
  91 + console.log('key',key)
  92 + let myreg=/^[1][3,4,5,7,8][0-9]{9}$/;
  93 + if(!myreg.test(util.val(e))){
  94 + return util.val(e);
  95 + }
  96 + }
87 val = util.val(e); 97 val = util.val(e);
88 } 98 }
89 this.user[key] = val; 99 this.user[key] = val;
@@ -38,7 +38,7 @@ @@ -38,7 +38,7 @@
38 data-key="phone" 38 data-key="phone"
39 type="number" 39 type="number"
40 value="{{user.phone}}" 40 value="{{user.phone}}"
41 - placeholder-class="input-pl" maxlength="20"/> 41 + placeholder-class="input-pl" maxlength="11"/>
42 </view> 42 </view>
43 <view class="flex-rr"> 43 <view class="flex-rr">
44 <!-- 一键获取 --> 44 <!-- 一键获取 -->
@@ -109,6 +109,12 @@ Page({ @@ -109,6 +109,12 @@ Page({
109 if (key == 'sex') { 109 if (key == 'sex') {
110 val = util.attr(e, 'val'); 110 val = util.attr(e, 'val');
111 } else { 111 } else {
  112 + if(key=='phone'){
  113 + let myreg=/^[1][3,4,5,7,8][0-9]{9}$/;
  114 + if(!myreg.test(util.val(e))){
  115 + return util.val(e);
  116 + }
  117 + }
112 val = util.val(e); 118 val = util.val(e);
113 } 119 }
114 this.user[key] = val; 120 this.user[key] = val;
@@ -124,7 +130,7 @@ Page({ @@ -124,7 +130,7 @@ Page({
124 return util.toast('请填写姓名','none') 130 return util.toast('请填写姓名','none')
125 } 131 }
126 if(!this.user.phone){ 132 if(!this.user.phone){
127 - return util.toast('请填写手机','none') 133 + return util.toast('请填写正确的手机号','none')
128 } 134 }
129 this.hasSubmit=false; 135 this.hasSubmit=false;
130 let roomids=[]; 136 let roomids=[];
@@ -58,7 +58,7 @@ @@ -58,7 +58,7 @@
58 data-key="phone" 58 data-key="phone"
59 type="number" 59 type="number"
60 value="{{user.phone}}" 60 value="{{user.phone}}"
61 - placeholder-class="input-pl" maxlength="20"/> 61 + placeholder-class="input-pl" maxlength="11"/>
62 <view class="flex-rr"> 62 <view class="flex-rr">
63 <!-- 一键获取 --> 63 <!-- 一键获取 -->
64 <phone bindgetphone="getphone"> 64 <phone bindgetphone="getphone">