Browse Source

feat(market): 添加拨打电话记录功能

- 在 market.js 中新增 setCallUp 方法,用于添加拨打电话记录
- 在 clue_info.vue 中实现拨打电话功能,包括添加拨打电话记录
- 移除 util.js 中的 callTel 函数,改为在 clue_info.vue 中直接实现
master
liutong 12 months ago
parent
commit
8e7b09d6b4
  1. 8
      api/market.js
  2. 28
      common/util.js
  3. 41
      pages/market/clue/clue_info.vue

8
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;
})
},

28
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
}

41
pages/market/clue/clue_info.vue

@ -256,7 +256,7 @@
<!-- 底部按钮组-->
<view class="bottom-label">
<view @click="openViewWritingFollowUp()">添加跟进记录</view>
<view @click="$util.callTel(clientInfo.student_phone)">拨打电话</view>
<view @click="callTel(clientInfo.student_phone)">拨打电话</view>
<view @click="openViewNewTask()">转交跟进任务</view>
</view>
</view>
@ -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;
}
});
},
//

Loading…
Cancel
Save