uniapp click to call

<view class=" btn" @click="contact">咨询商家</view>
contact(){
    
    
				if(this.detail.phone!=null){
    
    
					uni.makePhoneCall({
    
    
					 // 手机号
					    phoneNumber:this.detail.phone+'', 
					// 成功回调
					success: (res) => {
    
    
					console.log('调用成功!')	
					},
					// 失败回调
					fail: (res) => {
    
    
						console.log(res);
					console.log('调用失败!')
					}
						
					  });
				}
			}

Guess you like

Origin blog.csdn.net/qq_45894929/article/details/111688776