更新记录
1.0.0(2023-11-05) 下载此版本
init
平台兼容性
uni-app
Vue2 | Vue3 | Chrome | Safari | app-vue | app-nvue | Android | iOS | 鸿蒙 |
---|---|---|---|---|---|---|---|---|
√ | √ | - | - | - | - | 6.0 | × | - |
微信小程序 | 支付宝小程序 | 抖音小程序 | 百度小程序 | 快手小程序 | 京东小程序 | 鸿蒙元服务 | QQ小程序 | 飞书小程序 | 快应用-华为 | 快应用-联盟 |
---|---|---|---|---|---|---|---|---|---|---|
× | × | × | × | × | × | - | × | × | × | × |
uni-app x
Chrome | Safari | Android | iOS | 鸿蒙 | 微信小程序 |
---|---|---|---|---|---|
- | - | 6.0 | × | - | × |
直接拨打电话 wa-call
uts插件,仅支持Android,主要为解决uni-app x还不支持uni.makePhoneCall
的替代插件。
未在Android5上测试,或许可用。Android6以上没问题。
因需要电话权限,在HBuilderX 3.97以前,需要打包自定义基座。3.97起的标准基座已包含该权限。
本插件只有一个API,调用非常简单。工程下引入插件,在页面里的调用方式如下:
<template>
<view style="align-items: center;">
<input class="input" type="tel" @input="bindInput" placeholder="请输入电话号码" />
<button @tap="makePhoneCall" :disabled="disabled">直接拨打</button>
</view>
</template>
<script>
import {makePhoneCall} from "@/uni_modules/wa-call";
export default {
data() {
return {
disabled: true,
inputValue: ""
}
},
methods: {
bindInput: function (e : InputEvent) {
this.inputValue = e.detail.value
if (this.inputValue.length > 2) {
this.disabled = false
} else {
this.disabled = true
}
},
makePhoneCall: function () {
makePhoneCall(this.inputValue)
}
}
}
</script>
<style>
.input {
height: 44px;
border-bottom: 1rpx solid #E2E2E2;
text-align: center;
margin: 4px;
}
</style>