Browse Source

feat(common): 添加拨打电话功能并修复相关错误

- 在 util.js 中添加 callTel 函数,实现拨打电话功能
- 在 clue_info.vue 中为拨打电话按钮添加点击事件,调用 callTel 函数
- 修复了原代码中的拼写错误和逻辑错误
master
liutong 12 months ago
parent
commit
ed4653de1f
  1. 30
      common/util.js
  2. 6
      pages/market/clue/clue_info.vue

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

6
pages/market/clue/clue_info.vue

@ -256,8 +256,8 @@
<!-- 底部按钮组-->
<view class="bottom-label">
<view>添加跟进记录</view>
<view>拨打电话</view>
<view>跟进任务</view>
<view @click="$util.callTel(clientInfo.student_phone)">拨打电话</view>
<view>跟进任务</view>
</view>
</view>
</view>
@ -348,6 +348,8 @@
this.listCallUp = res.data
},
//
switch_tags(type){
this.switch_tags_type = type

Loading…
Cancel
Save