From ed4653de1f697c0f827c8d0f120d2965f4583f29 Mon Sep 17 00:00:00 2001 From: liutong <836164388@qq.com> Date: Tue, 15 Apr 2025 09:50:46 +0800 Subject: [PATCH] =?UTF-8?q?feat(common):=20=E6=B7=BB=E5=8A=A0=E6=8B=A8?= =?UTF-8?q?=E6=89=93=E7=94=B5=E8=AF=9D=E5=8A=9F=E8=83=BD=E5=B9=B6=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E7=9B=B8=E5=85=B3=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在 util.js 中添加 callTel 函数,实现拨打电话功能 - 在 clue_info.vue 中为拨打电话按钮添加点击事件,调用 callTel 函数 - 修复了原代码中的拼写错误和逻辑错误 --- common/util.js | 30 +++++++++++++++++++++++++++++- pages/market/clue/clue_info.vue | 6 ++++-- 2 files changed, 33 insertions(+), 3 deletions(-) diff --git a/common/util.js b/common/util.js index fcbfe66..1e045f9 100644 --- a/common/util.js +++ b/common/util.js @@ -170,6 +170,33 @@ function formatToDateTime(dateTime, fmt = 'Y-m-d H:i:s') { return fmt; } +//拨打电话 +function callTel(tel) { + console.log('xxx',tel) + return + if (!tel) { + uni.showToast({ + title: '电话号码为空', + icon: 'none' + }); + return; + } + uni.makePhoneCall({ + phoneNumber: phoneNumber, + success: function () { + // console.log('拨打电话成功'); + }, + fail: function (err) { + console.log('拨打电话失败', err); + uni.showToast({ + title: '拨打电话失败', + icon: 'none' + }); + return; + } + }); +} + //跳转首页 function openHomeView() { @@ -226,5 +253,6 @@ module.exports = { dateUtils, hexToRgba, img, - formatToDateTime + formatToDateTime, + callTel } diff --git a/pages/market/clue/clue_info.vue b/pages/market/clue/clue_info.vue index de47bf1..d923261 100644 --- a/pages/market/clue/clue_info.vue +++ b/pages/market/clue/clue_info.vue @@ -256,8 +256,8 @@ 添加跟进记录 - 拨打电话 - 转角跟进任务 + 拨打电话 + 转接跟进任务 @@ -348,6 +348,8 @@ this.listCallUp = res.data }, + + //切换标签 switch_tags(type){ this.switch_tags_type = type