This commit is contained in:
2020-08-26 19:56:45 +08:00
parent 7ff6b2ec35
commit 3ece010fc1
208 changed files with 14753 additions and 637 deletions

View File

@@ -79,7 +79,7 @@ MyUtl.callCust = function(cust)
end
end
---public 云拨号
MyUtl.doCall = function(custId, phoneNo, cust)
MyUtl.doCall = function(custId, phoneNo, cust, callback)
showHotWheel("拨号中...")
NetProto.send.bi_call(
custId,
@@ -88,19 +88,64 @@ MyUtl.doCall = function(custId, phoneNo, cust)
function(content)
hideHotWheel()
if content.success then
MyUtl.toastS("拨号成功!")
getPanelAsy("PanelNewFollowSimple", onLoadedPanelTT, cust)
CLLCallListner.waite4Callback()
local orgs = {}
orgs.callback = "MyUtl.onEndincomingCall"
orgs.custList = cust and {cust} or content.result
orgs.phoneNo = phoneNo
CLLCallListner.waite4Callback(json.encode(orgs))
MyUtl.toastS("拨号成功,注意接听回拨电话!")
Utl.doCallback(callback)
end
end
)
end
MyUtl.onEndincomingCall = function(data)
local custList = data.custList
if custList and #custList > 0 then
if #custList == 1 then
getPanelAsy("PanelNewFollowSimple", onLoadedPanelTT, custList[1])
else
---@type _ParamCLLPPopList2
local params = {}
params.title = joinStr("新建跟进:", data.phoneNo)
params.list = {}
---@param _cust _DBCust
for i, _cust in ipairs(custList) do
table.insert(
params.list,
{
index = i,
name = joinStr("任务:", DBCust.getTaskName(_cust.taskId)),
subname = joinStr("客户:", _cust.custName)
}
)
end
params.callback = function(d)
local index = d.index
getPanelAsy("PanelNewFollowSimple", onLoadedPanelTT, custList[index])
end
getPanelAsy("PanelPopList2", onLoadedPanelTT, params)
end
else
MyUtl.confirm(
joinStr("是否将号码【", data.phoneNo, "】创建为客户?"),
function()
getPanelAsy("PanelNewCust", onLoadedPanelTT, {phoneNo = data.phoneNo})
end,
"创建为客户"
)
end
end
---public 调用系统拨打电话
MyUtl.callCustByNative = function(phoneNo, cust)
if CLUIFormUtl.callPhone then
CLUIFormUtl.callPhone(phoneNo)
else
Application.OpenURL(joinStr( "tel:", phoneNo))
Application.OpenURL(joinStr("tel:", phoneNo))
end
getPanelAsy("PanelNewFollowSimple", onLoadedPanelTT, cust)
end
@@ -129,8 +174,8 @@ function MyUtl.setIsHidePhone(val)
end
MyUtl.hidePhone = function(phone)
if not phone then
return
if isNilOrEmpty(phone) then
return ""
end
if not MyUtl.isHidePhone then
return phone