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; + } + }); + }, + //切换标签