效果图:
代码展示:
<template>
<view class="page-map">
<view class="btn" @click="telFun()" style="text-align: center;">电话咨询</view>
</view>
</template>
<script>
export default {
data() {
return {}
},
methods: {
//拨打电话:
telFun() {
uni.makePhoneCall({
phoneNumber: '135xxxxxxxxxx', //电话号码
success: function(e) {
console.log(e);
},
fail: function(e) {
console.log(e);
}
})
},
}
}
</script>
<style lang="scss" scoped>
</style>
注解:
uni.makePhoneCall(OBJECT) 拨打电话