Showing
3 changed files
with
27 additions
and
6 deletions
| @@ -40,12 +40,30 @@ Component({ | @@ -40,12 +40,30 @@ Component({ | ||
| 40 | tapButton(e){ | 40 | tapButton(e){ |
| 41 | let type=util.attr(e,'type'); | 41 | let type=util.attr(e,'type'); |
| 42 | if(type=='oncall'){ | 42 | if(type=='oncall'){ |
| 43 | - if(!this.data.seller.phone){ | 43 | + if(this.data.seller.seller_tel.length<1){ |
| 44 | + if(!this.data.seller.phone){ | ||
| 44 | return util.toast('商家电话错误','none'); | 45 | return util.toast('商家电话错误','none'); |
| 45 | - } | ||
| 46 | - wx.makePhoneCall({ | 46 | + } |
| 47 | + wx.makePhoneCall({ | ||
| 47 | phoneNumber:this.data.seller.phone | 48 | phoneNumber:this.data.seller.phone |
| 48 | - }) | 49 | + }) |
| 50 | + }else{ | ||
| 51 | + wx.hideTabBar(); | ||
| 52 | + //this.selectComponent('#as').show(); | ||
| 53 | + wx.showActionSheet({ | ||
| 54 | + itemList:this.data.seller.seller_tel, | ||
| 55 | + complete:()=>{ | ||
| 56 | + wx.showTabBar(); | ||
| 57 | + }, | ||
| 58 | + success:(res)=>{ | ||
| 59 | + let phone=this.data.seller.seller_tel[res.tapIndex] | ||
| 60 | + wx.makePhoneCall({ | ||
| 61 | + phoneNumber:phone.replace(/[^\d]/g,'') | ||
| 62 | + }) | ||
| 63 | + } | ||
| 64 | + }); | ||
| 65 | + } | ||
| 66 | + | ||
| 49 | }else{ | 67 | }else{ |
| 50 | util.toast('请打电话预定','none'); | 68 | util.toast('请打电话预定','none'); |
| 51 | } | 69 | } |
-
Please register or login to post a comment