<template>
<view class="content">
<view class="text-area">
<view @click="toTrouch">拨打电话</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
phone: '10086',
}
},
methods: {
// 拨打电话
toTrouch() {
// 更改this指向
let tath = this
uni.makePhoneCall({
// 手机号
phoneNumber: tath.phone,
// 成功回调
success: (res) => {
console.log('调用成功!')
},
// 失败回调
fail: (res) => {
console.log('调用失败!')
}
});
},
}
}
</script>
uniapp app端调用手机拨打号码
最新推荐文章于 2024-06-19 09:58:29 发布