From 8e7b09d6b4253648420bb16056ce71f04ff379e4 Mon Sep 17 00:00:00 2001 From: liutong <836164388@qq.com> Date: Wed, 16 Apr 2025 09:37:49 +0800 Subject: [PATCH] =?UTF-8?q?feat(market):=20=E6=B7=BB=E5=8A=A0=E6=8B=A8?= =?UTF-8?q?=E6=89=93=E7=94=B5=E8=AF=9D=E8=AE=B0=E5=BD=95=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在 market.js 中新增 setCallUp 方法,用于添加拨打电话记录 - 在 clue_info.vue 中实现拨打电话功能,包括添加拨打电话记录 - 移除 util.js 中的 callTel 函数,改为在 clue_info.vue 中直接实现 --- api/market.js | 8 +++++++ common/util.js | 28 ++-------------------- pages/market/clue/clue_info.vue | 41 ++++++++++++++++++++++++++++++++- 3 files changed, 50 insertions(+), 27 deletions(-) diff --git a/api/market.js b/api/market.js index 3ee5992..6e7217b 100644 --- a/api/market.js +++ b/api/market.js @@ -125,6 +125,14 @@ export default { }) }, + //添加拨打电话记录 + setCallUp(data = {}) { + let url = '/member/set_call_up' + return http.get(url, data).then(res => { + return res; + }) + }, + diff --git a/common/util.js b/common/util.js index c18809e..e24e1aa 100644 --- a/common/util.js +++ b/common/util.js @@ -1,4 +1,5 @@ import {img_domian} from "./config"; +import marketApi from '@/api/market.js'; function formatTime(time) { if (typeof time !== 'number' || time < 0) { @@ -170,30 +171,6 @@ function formatToDateTime(dateTime, fmt = 'Y-m-d H:i:s') { return fmt; } -//拨打电话 -function callTel(tel) { - 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; - } - }); -} //跳转首页 @@ -251,6 +228,5 @@ module.exports = { dateUtils, hexToRgba, img, - formatToDateTime, - callTel + formatToDateTime } diff --git a/pages/market/clue/clue_info.vue b/pages/market/clue/clue_info.vue index 4d1a1aa..a03e384 100644 --- a/pages/market/clue/clue_info.vue +++ b/pages/market/clue/clue_info.vue @@ -256,7 +256,7 @@ 添加跟进记录 - 拨打电话 + 拨打电话 转交跟进任务 @@ -361,6 +361,45 @@ }) }, + //拨打电话 + async callTel(tel) { + + if (!tel) { + uni.showToast({ + title: '电话号码为空', + icon: 'none' + }); + return; + } + + let param = { + sales_id:this.id//线索id + } + let res = await marketApi.setCallUp(param)//添加通过记录 + if(res.code != 1){ + uni.showToast({ + title: res.msg, + icon: 'none' + }) + return + } + + uni.makePhoneCall({ + phoneNumber: tel, + success: function () { + // console.log('拨打电话成功'); + }, + fail: function (err) { + console.log('拨打电话失败', err); + uni.showToast({ + title: '拨打电话失败', + icon: 'none' + }); + return; + } + }); + }, + //切换标签