微信小程序一键拨打电话

微信小程序中一键拨打电话可以使用提供的API接口:wx.makePhoneCall,下面是详细示例:

wxml中:

<button bindtap="to_call">拨打电话</button>

js中:

Page({
	data: {
		phone: "0551-66666666"
	},
	to_call: function(){
		wx.makePhoneCall({
			phoneNumber: this.data.phone
		})
	}
})

效果如下:

在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/qq_38882327/article/details/91948453