方法:window.location.href = 'tel://' + 电话号码;——对安卓支持;iOS不支持
iOS需要多加一个a标签;
写法:
<div class="contact-line contact-tel">
<div>手机号</div>
<div class="tel">{{tel}}</div>
<div @click="callTel()">拨打</div>
<a href="" v-show="false" ref="tels"></a>
</div>
callTel: function(e) {
if (this.is_uptodate) {
if(platform.isIos) { // iOS
this.$refs.tels.href = 'tel://' + this.tel;
this.$refs.tels.click();
} else {
// 安卓
window.location.href = 'tel://' + this.tel;
}
}
}
跨平台电话拨打解决方案
1222

被折叠的 条评论
为什么被折叠?



