HTML5页面唤起打电话(纯h5、app嵌套、浙里办app)记录
方法一:在H5页面中拨打电话
html
<a class="call" href="tel:要拨打的电话号">要拨打的电话号</a>
<meta name="format-detection" content="telephone=yes" />
方法二:H5嵌套在app中用vue拨打用户电话
html
getPhone(){
if (window.plus) {
plus.device.dial('要拨打的电话号', true);
}
}
方法三:浙里办app中直接拨打电话
html
//先初始化ZWJSBridge
ZWJSBridge.onReady(() => {
console.log("初始化完成后,执行bridge方法");
});
//再执行phoneCall
getPhone() {
ZWJSBridge.phoneCall({
corpId: '要拨打的电话号'
})
.then(result => {
console.log(result);
})
.catch(error => {
console.log(error);
});
}