您可以使用uniapp提供的API来调起拨打手机号的功能。具体步骤如下:
- <template>
- <view>
- <button type="primary" @click="callPhone">拨打客服电话button>
- view>
- template>
- methods: {
- callPhone() {
- uni.makePhoneCall({
- phoneNumber: '电话号码'
- });
- }
- }
完整代码示例:
- <template>
- <view>
- <button type="primary" @click="callPhone">拨打客服电话button>
- view>
- template>
-
- <script>
- export default {
- methods: {
- callPhone() {
- uni.makePhoneCall({
- phoneNumber: '电话号码'//手机号码
- });
- }
- }
- }
- script>