Commit 3c2b887f58c13d54151b624e74e66e11ae113391

Authored by wangfan
1 parent cbfb0ba0

多个电话

@@ -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 }
1 { 1 {
2 "component": true, 2 "component": true,
3 - "usingComponents": {} 3 + "usingComponents": {
  4 + "as":"../../actionSheet/index"
  5 + }
4 } 6 }
@@ -17,4 +17,5 @@ @@ -17,4 +17,5 @@
17 </view> 17 </view>
18 </view> 18 </view>
19 </view> 19 </view>
20 -</view>  
  20 +</view>
  21 +<as items="{{['1','2']}}" id="as"></as>