Showing
2 changed files
with
12 additions
and
7 deletions
| @@ -39,10 +39,13 @@ Component({ | @@ -39,10 +39,13 @@ Component({ | ||
| 39 | this.triggerEvent("share"); | 39 | this.triggerEvent("share"); |
| 40 | break; | 40 | break; |
| 41 | case 1: | 41 | case 1: |
| 42 | - if(!/^1\d{10}$/.test(this.data.bookInfo.phone)){ | ||
| 43 | - util.toast('手机号码错误','none') | ||
| 44 | - return; | ||
| 45 | - } | 42 | + if(!this.data.bookInfo.phone){ |
| 43 | + util.toast('未填写手机号码','none') | ||
| 44 | + return; | ||
| 45 | + }else if(!/^1\d{10}$/.test(this.data.bookInfo.phone)){ | ||
| 46 | + util.toast('手机号码错误','none') | ||
| 47 | + return; | ||
| 48 | + } | ||
| 46 | this.close(); | 49 | this.close(); |
| 47 | wx.navigateTo({ | 50 | wx.navigateTo({ |
| 48 | url:'/pages/book/b_sms?id='+this.data.bookInfo.id | 51 | url:'/pages/book/b_sms?id='+this.data.bookInfo.id |
| @@ -52,8 +55,10 @@ Component({ | @@ -52,8 +55,10 @@ Component({ | ||
| 52 | if(!this.data.bookInfo.hasOwner){ | 55 | if(!this.data.bookInfo.hasOwner){ |
| 53 | return util.toast('只有记录人可以拨打','none'); | 56 | return util.toast('只有记录人可以拨打','none'); |
| 54 | } | 57 | } |
| 55 | - if(this.data.bookInfo.phone.length<3){ | ||
| 56 | - return util.toast('号码错误','none'); | 58 | + console.log('this.data.bookInfo',this.data.bookInfo); |
| 59 | + let pl=this.data.bookInfo.phone?this.data.bookInfo.phone.length:0; | ||
| 60 | + if(pl<3){ | ||
| 61 | + return util.toast(pl==0?'未填写手机号码':'手机号码错误','none'); | ||
| 57 | } | 62 | } |
| 58 | wx.makePhoneCall({ | 63 | wx.makePhoneCall({ |
| 59 | phoneNumber: this.data.bookInfo.phone, //仅为示例,并非真实的电话号码 | 64 | phoneNumber: this.data.bookInfo.phone, //仅为示例,并非真实的电话号码 |
-
Please register or login to post a comment