From a5f488e2fa756390663e77e1cb3848c3a073ba6f Mon Sep 17 00:00:00 2001 From: chenkun <3289431190@qq.com> Date: Fri, 11 Oct 2024 13:39:34 +0800 Subject: [PATCH] =?UTF-8?q?=E8=81=94=E7=B3=BB=E5=AE=A2=E6=9C=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/config/customerServicePopup.vue | 38 ++++++++++++++++++++++++++++-- 1 file changed, 36 insertions(+), 2 deletions(-) diff --git a/components/config/customerServicePopup.vue b/components/config/customerServicePopup.vue index 9a4f314..cfd07bf 100644 --- a/components/config/customerServicePopup.vue +++ b/components/config/customerServicePopup.vue @@ -60,14 +60,48 @@ } }, methods: { - open(){ + open() { this.show = true }, - close(){ + close() { this.show = false }, + // 拨打电话 confirm() { this.show = false + let phone = "13575038513"; // 需要拨打的电话号码 + // console.log('拨打电话', phone) + const res = uni.getSystemInfoSync(); + // ios系统默认有个模态框 + if (res.platform == 'ios') { + uni.makePhoneCall({ + phoneNumber: phone, + success() { + console.log('ios拨打成功'); + }, + fail() { + console.log('ios拨打失败'); + } + }) + } else { + //安卓手机手动设置一个showActionSheet + uni.showActionSheet({ + itemList: [phone, '呼叫'], + success: function(res) { + if (res.tapIndex == 1) { + uni.makePhoneCall({ + phoneNumber: phone, + success() { + console.log('安卓拨打成功'); + }, + fail() { + console.log('安卓拨打失败'); + } + }) + } + } + }) + } }, } }