Commit 6468ebb43f738669af04e7b83a73554cfd20582f

Authored by wangfan
1 parent ef7ef9da

C端电话不一致

@@ -49,22 +49,23 @@ Component({ @@ -49,22 +49,23 @@ Component({
49 tapButton(e){ 49 tapButton(e){
50 let type=util.attr(e,'type'); 50 let type=util.attr(e,'type');
51 if(type=='oncall'){ 51 if(type=='oncall'){
52 - if(this.data.seller.seller_tel.length<2){  
53 - if(!this.data.seller.phone){  
54 - return util.toast('商家电话错误','none');  
55 - } 52 + let seller_tel=this.data.seller.seller_tel;
  53 + if(seller_tel.length<1){
  54 + seller_tel=[this.data.seller.phone]
  55 + }
  56 + if(seller_tel.length==1){
56 wx.makePhoneCall({ 57 wx.makePhoneCall({
57 - phoneNumber:this.data.seller.phone 58 + phoneNumber:seller_tel[0].replace(/[^\d]/g,'')
58 }) 59 })
59 }else{ 60 }else{
60 //wx.hideTabBar(); 61 //wx.hideTabBar();
61 wx.showActionSheet({ 62 wx.showActionSheet({
62 - itemList:this.data.seller.seller_tel, 63 + itemList:seller_tel,
63 complete:()=>{ 64 complete:()=>{
64 //wx.showTabBar(); 65 //wx.showTabBar();
65 }, 66 },
66 success:(res)=>{ 67 success:(res)=>{
67 - let phone=this.data.seller.seller_tel[res.tapIndex] 68 + let phone=seller_tel[res.tapIndex]
68 wx.makePhoneCall({ 69 wx.makePhoneCall({
69 phoneNumber:phone.replace(/[^\d]/g,'') 70 phoneNumber:phone.replace(/[^\d]/g,'')
70 }) 71 })