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

@@ -0,0 +1,105 @@
---@class _ParamCLLPPopList2
---@field title
---@field list
---@field callback
-- xx界面
local CLLPPopList2 = {}
---@type Coolape.CLPanelLua
local csSelf = nil
---@type UnityEngine.Transform
local transform = nil
local uiobjs = {}
---@type _ParamCLLPPopList2
local mdata
-- 初始化,只会调用一次
function CLLPPopList2.init(csObj)
csSelf = csObj
transform = csObj.transform
---@type UISprite
uiobjs.SpriteBg = getCC(transform, "Bottom/offset/SpriteBg", "UISprite")
uiobjs.list = getChild(transform, "Bottom/offset/List")
---@type Coolape.CLUILoopGrid
uiobjs.grid = getCC(uiobjs.list.transform, "Content/Grid", "CLUILoopGrid")
uiobjs.LabelTitle = getCC(transform, "Bottom/offset/LabelTitle", "UILabel")
end
-- 设置数据
function CLLPPopList2.setData(paras)
mdata = paras
end
--当有通用背板显示时的回调
function CLLPPopList2.onShowFrame()
end
-- 显示在c#中。show为调用refreshshow和refresh的区别在于当页面已经显示了的情况当页面再次出现在最上层时只会调用refresh
function CLLPPopList2.show()
uiobjs.LabelTitle.text = mdata.title
local count = #(mdata.list)
if count == 1 then
uiobjs.SpriteBg.height = 340
uiobjs.list.localPosition = Vector3(0, -340, 0)
elseif count == 2 then
uiobjs.SpriteBg.height = 510
uiobjs.list.localPosition = Vector3(0, -170, 0)
else
uiobjs.SpriteBg.height = 680
uiobjs.list.localPosition = Vector3.zero
end
uiobjs.grid:setList(mdata.list, CLLPPopList2.initCell)
end
function CLLPPopList2.initCell(cell, data)
cell:init(data, CLLPPopList2.onclickCell)
end
function CLLPPopList2.onclickCell(cell, data)
Utl.doCallback(mdata.callback, data)
hideTopPanel(csSelf)
end
-- 刷新
function CLLPPopList2.refresh()
end
-- 关闭页面
function CLLPPopList2.hide()
end
-- 网络请求的回调cmd指命succ成功失败msg消息paras服务器下行数据
function CLLPPopList2.procNetwork(cmd, succ, msg, paras)
--[[
if(succ == NetSuccess) then
if(cmd == "xxx") then
-- TODO:
end
end
--]]
end
-- 处理ui上的事件例如点击等
function CLLPPopList2.uiEventDelegate(go)
local goName = go.name
if goName == "ButtonClose" or goName == "SpriteBg" then
hideTopPanel(csSelf)
end
end
-- 当顶层页面发生变化时回调
function CLLPPopList2.onTopPanelChange(topPanel)
end
-- 当按了返回键时关闭自己返值为true时关闭
function CLLPPopList2.hideSelfOnKeyBack()
if NetProto and csSelf then
NetProto.removePanelListener(csSelf)
end
return true
end
--------------------------------------------
return CLLPPopList2

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: cbeb7d495338f41a185db41382a82f27
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -66,7 +66,7 @@ end
-- 处理ui上的事件例如点击等
function CLLPSendSms.uiEventDelegate(go)
local goName = go.name
if goName == "ButtonClose" then
if goName == "ButtonClose" or goName == "SpriteBg" then
hideTopPanel(csSelf)
elseif goName == "ButtonYunSend" then
local err = uiobjs.offset:checkValid()

View File

@@ -53,6 +53,11 @@ function CLLPStart.setLuasAtBegainning()
if ReporterMessageReceiver.self and ReporterMessageReceiver.self.gameObject then
ReporterMessageReceiver.self.gameObject:SetActive(true)
end
else
NetProto.isDebug = false
if ReporterMessageReceiver.self and ReporterMessageReceiver.self.gameObject then
ReporterMessageReceiver.self.gameObject:SetActive(false)
end
end
end
)
@@ -72,6 +77,13 @@ function CLLPStart.setLuasAtBegainning()
CLUIFormUtl.setSoftInputMode("SOFT_INPUT_ADJUST_PAN")
Screen.sleepTimeout = CS.UnityEngine.SleepTimeout.SystemSetting
CallListner.self:setLua()
CLLCallListner.checkAndSetUserPermission(
function()
CallListner.self:init()
end
)
-- 添加屏蔽字
--MyMain.self:invoke4Lua(CLLPStart.addShieldWords, 1)

View File

@@ -19,6 +19,7 @@ function TRPAbout:init(csObj)
uiobjs.TableForm = uiobjs.Table:GetComponent("CLUIFormRoot")
---@type Coolape.CLCellLua
uiobjs.TableLua = uiobjs.Table:GetComponent("CLCellLua")
uiobjs.LabelVer = getCC(self.transform, "Top/LabelVer", "UILabel")
end
function TRPAbout:initFiledsAttr()
@@ -58,6 +59,7 @@ end
-- 显示在c#中。show为调用refreshshow和refresh的区别在于当页面已经显示了的情况当页面再次出现在最上层时只会调用refresh
function TRPAbout:show()
uiobjs.LabelVer.text = joinStr("Version:", __version__)
---@type _ParamCellExtendFiledRoot
local fieldRootInfor = {}
fieldRootInfor.fields = {}

View File

@@ -32,7 +32,6 @@ end
-- 刷新
function TRPBindPhone:refresh()
local user = DBUser.getMyInfor()
printe("user.ifPhoAuth")
SetActive(uiobjs.ButtonAuth, user.ifPhoAuth ~= "Y" or false)
end

View File

@@ -0,0 +1,107 @@
---@type IDBasePanel
local TRBasePanel = require("ui.panel.TRBasePanel")
---@class TRPCallLogDetail:TRBasePanel 邮件列表
local TRPCallLogDetail = class("TRPCallLogDetail", TRBasePanel)
local uiobjs = {}
-- 初始化,只会调用一次
function TRPCallLogDetail:init(csObj)
TRPCallLogDetail.super.init(self, csObj)
self:setEventDelegate()
MyUtl.setContentView(getChild(self.transform, "PanelContent"), MyUtl.defaultTopHeight, 0)
---@type UIScrollView
uiobjs.scrollView = getCC(self.transform, "PanelContent", "UIScrollView")
uiobjs.scrollView.dampenStrength = MyUtl.dampenStrength
---@type UITable
uiobjs.Table = getCC(uiobjs.scrollView.transform, "Table", "UITable")
uiobjs.detail = getCC(uiobjs.Table.transform, "detail", "CLCellLua")
uiobjs.ButtonNewCust = getChild(self.transform, "ButtonNewCust").gameObject
uiobjs.ButtonCustDetail = getChild(self.transform, "ButtonCustDetail").gameObject
end
-- 设置数据
---@param paras _ParamTRPCallLogDetail
function TRPCallLogDetail:setData(paras)
self.mdata = paras
end
-- 显示在c#中。show为调用refreshshow和refresh的区别在于当页面已经显示了的情况当页面再次出现在最上层时只会调用refresh
function TRPCallLogDetail:show()
uiobjs.detail:init(self.mdata, nil)
if not isNilOrEmpty(self.mdata.custId) then
SetActive(uiobjs.ButtonNewCust, false)
SetActive(uiobjs.ButtonCustDetail, true)
else
SetActive(uiobjs.ButtonNewCust, true)
SetActive(uiobjs.ButtonCustDetail, false)
end
uiobjs.scrollView:ResetPosition()
end
-- 刷新
function TRPCallLogDetail:refresh()
end
-- 关闭页面
function TRPCallLogDetail:hide()
end
-- 网络请求的回调cmd指命succ成功失败msg消息paras服务器下行数据
function TRPCallLogDetail:procNetwork(cmd, succ, msg, paras)
if (succ == NetSuccess) then
--[[
if cmd == xx then
end
]]
end
end
function TRPCallLogDetail:setEventDelegate()
self.EventDelegate = {
ButtonNewCust = function()
local parma
if self.mdata.calltype == "out" then
parma = {phoneNo = self.mdata.destno}
else
parma = {phoneNo = self.mdata.callerno}
end
getPanelAsy("PanelNewCust", onLoadedPanel, parma)
end,
ButtonCustDetail = function()
NetProto.send.get_customerById(
self.mdata.custId,
function(content)
hideHotWheel()
if content.success then
local cust = content.result
if cust then
---@type _ParamTRPCustDetail
local param = {}
param.cust = cust
param.bookingData = nil
param.needShowMore = true
getPanelAsy("PanelCustDetail", onLoadedPanelTT, param)
end
end
end
)
end
}
end
-- 处理ui上的事件例如点击等
function TRPCallLogDetail:uiEventDelegate(go)
local func = self.EventDelegate[go.name]
if func then
func()
end
end
-- 当顶层页面发生变化时回调
function TRPCallLogDetail:onTopPanelChange(topPanel)
end
--------------------------------------------
return TRPCallLogDetail

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: b7f1b65a2061747ccb18fc4bb1b35503
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -549,6 +549,7 @@ function TRPCustDetail:procNetwork(cmd, succ, msg, paras)
self:showOrders()
end
elseif cmd == NetProto.cmds.get_customerById then
-- hideHotWheel()
if self.mdata.custId == paras.result.custId then
self.mdata = paras.result
if self.currToggle == 1 then

View File

@@ -9,7 +9,11 @@ function TRPCustList:init(csObj)
TRPCustList.super.init(self, csObj)
self:setEventDelegate()
self:initFilters()
MyUtl.setContentView(getChild(self.transform, "PanelContent"), MyUtl.defaultTopHeight + MyUtl.defaultTopHeight + 40, 0)
MyUtl.setContentView(
getChild(self.transform, "PanelContent"),
MyUtl.defaultTopHeight + MyUtl.defaultTopHeight + 40,
0
)
uiobjs.InputSeachKey = getCC(self.transform, "Top/InputSeachKey", "UIInput")
uiobjs.ButtonFilterSp = getCC(self.transform, "Top/ButtonFilter", "UISprite")
uiobjs.ButtonFilterLb = getCC(uiobjs.ButtonFilterSp.transform, "Label", "UILabel")
@@ -30,7 +34,19 @@ end
function TRPCustList:initFilters()
self.filters = {}
local d = {}
local d
d = {}
d.title = "客户状态"
d.key = DBCust.FilterGroup.dealFlagList
d.key2 = "dealFlag"
d.list = DBCust.getFilter(DBCust.FilterGroup.dealFlagList)
if #(d.list) > 0 then
-- table.insert(d.list, 1, {name = "全部", value = -1})
table.insert(self.filters, d)
end
d = {}
d.title = "归属工号"
d.key = DBCust.FilterGroup.loginNoList
d.key2 = "loginNos"
@@ -60,16 +76,6 @@ function TRPCustList:initFilters()
table.insert(self.filters, d)
end
d = {}
d.title = "客户状态"
d.key = DBCust.FilterGroup.dealFlagList
d.key2 = "dealFlag"
d.list = DBCust.getFilter(DBCust.FilterGroup.dealFlagList)
if #(d.list) > 0 then
-- table.insert(d.list, 1, {name = "全部", value = -1})
table.insert(self.filters, d)
end
d = {}
d.title = "客户类型"
d.key = DBCust.FilterGroup.custTypeList

View File

@@ -1,23 +1,44 @@
local TRPMakeCall = {}
---@type Coolape.CLPanelLua
local csSelf = nil
local transform = nil
---@type UIInput
local InputNumber
local grid
local cursorPosition = -1
local currRecordName
local LabelTitle
local ButtonDel
local uiobjs = {}
-- 初始化,只会调用一次
function TRPMakeCall.init(csObj)
csSelf = csObj
transform = csObj.transform
grid = getChild(transform, "AnchorBottom/grid"):GetComponent("UIGrid")
MyUtl.setContentView(getChild(transform, "PanelContent"), 298, MyUtl.defaultBottomHeight)
uiobjs.InputSeachKey = getCC(transform, "Top/InputSeachKey", "UIInput")
---@type CLUIScrollViewWithEvent
uiobjs.scrollView = getCC(transform, "PanelContent", "CLUIScrollViewWithEvent")
uiobjs.scrollView.dampenStrength = MyUtl.dampenStrength
uiobjs.scrollView:init(TRPMakeCall.onShowRefreshFlg, TRPMakeCall.onhideRefreshFlg, TRPMakeCall.refreshList)
---@type Coolape.CLUILoopGrid
uiobjs.Grid = getCC(uiobjs.scrollView.transform, "Grid", "CLUILoopGrid")
uiobjs.ButtonEndList = getChild(uiobjs.Grid.transform, "ButtonEndList")
uiobjs.ButtonEndListLb = getCC(uiobjs.ButtonEndList, "Label", "UILabel")
uiobjs.ButtonHeadList = getChild(uiobjs.Grid.transform, "ButtonHeadList")
---@type TweenPosition
uiobjs.bottomOffset = getCC(transform, "AnchorBottom/offset", "TweenPosition")
grid = getChild(uiobjs.bottomOffset.transform, "grid"):GetComponent("UIGrid")
local contentRect = MyUtl.getUIContent(csSelf)
grid.cellWidth = NumEx.getIntPart((contentRect.z - 100) / 3)
InputNumber = getChild(transform, "AnchorBottom/InputNumber"):GetComponent("UIInput")
InputNumber = getChild(uiobjs.bottomOffset.transform, "InputNumber"):GetComponent("UIInput")
ButtonDel = getChild(InputNumber.transform, "ButtonDel").gameObject
local prefabCell = getChild(grid.transform, "00000").gameObject
local list = {1, 2, 3, 4, 5, 6, 7, 8, 9, "*", 0, "#"}
CLUIUtl.resetList4Lua(
@@ -25,9 +46,14 @@ function TRPMakeCall.init(csObj)
prefabCell,
list,
function(cell, data)
cell:init(data, TRPMakeCall.onClickCell)
cell:init(data, TRPMakeCall.onClickNumCell)
end
)
uiobjs.ButtonShow = getChild(transform, "AnchorBottom/ButtonShow").gameObject
uiobjs.ButtonHide = getChild(uiobjs.bottomOffset.transform, "ButtonHide").gameObject
TRPMakeCall.showList()
end
-- 设置数据
@@ -38,12 +64,88 @@ end
function TRPMakeCall.show()
UIInput.selection = InputNumber
InputNumber.value = ""
SetActive(ButtonDel, false)
cursorPosition = -1
-- uiobjs.bottomOffset:ResetToBeginning()
SetActive(uiobjs.bottomOffset.gameObject, true)
SetActive(uiobjs.ButtonShow, false)
NetProto.send.query_cust_calllog(uiobjs.InputSeachKey.value, nil, 1)
end
function TRPMakeCall.onClickNumCell(cell, data)
UIInput.selection = InputNumber
InputNumber:Insert(data)
end
function TRPMakeCall.showList(list)
list = list or {}
SetActive(uiobjs.ButtonHeadList.gameObject, false)
if #list > 0 then
SetActive(uiobjs.ButtonEndList.gameObject, false)
else
SetActive(uiobjs.ButtonEndList.gameObject, true)
end
uiobjs.Grid:setList(list or {}, TRPMakeCall.initCell, TRPMakeCall.onHeadList, TRPMakeCall.onEndList)
TRPMakeCall.reposition()
csSelf:invoke4Lua(TRPMakeCall.reposition, 0.1)
end
function TRPMakeCall.reposition()
uiobjs.scrollView:ResetPosition()
end
function TRPMakeCall.appList(list)
SetActive(uiobjs.ButtonEndList.gameObject, false)
uiobjs.Grid:appendList(list)
end
function TRPMakeCall.onShowRefreshFlg()
if uiobjs.Grid.list.Count > 0 then
uiobjs.ButtonHeadList.transform.localPosition = Vector3(0, 166, 0)
else
uiobjs.ButtonHeadList.transform.localPosition = Vector3(0, 100, 0)
end
SetActive(uiobjs.ButtonHeadList.gameObject, true)
end
function TRPMakeCall.onhideRefreshFlg()
SetActive(uiobjs.ButtonHeadList.gameObject, false)
if uiobjs.Grid.list.Count == 0 then
uiobjs.scrollView:ResetPosition()
end
end
function TRPMakeCall.refreshList()
local queryKey = uiobjs.InputSeachKey.value
showHotWheel()
NetProto.send.query_cust_calllog(uiobjs.InputSeachKey.value, nil, 1)
end
function TRPMakeCall.onHeadList(head)
printw("到最顶端了")
-- uiobjs.ButtonHeadList.transform.localPosition = Vector3(0, 250, 0)
-- SetActive(uiobjs.ButtonHeadList.gameObject, true)
end
function TRPMakeCall.onEndList(tail)
printw("到最后了==" .. tail.name)
if TRPMakeCall.pageInfo and TRPMakeCall.pageInfo.current_page < TRPMakeCall.pageInfo.total_pages then
local queryKey = uiobjs.InputSeachKey.value
showHotWheel()
-- 取得下一页
NetProto.send.query_cust_calllog(uiobjs.InputSeachKey.value, nil, TRPMakeCall.pageInfo.current_page + 1)
else
uiobjs.ButtonEndList.localPosition = tail.transform.localPosition + Vector3.up * -170
SetActive(uiobjs.ButtonEndList.gameObject, true)
end
end
function TRPMakeCall.initCell(cell, data)
cell:init(data, TRPMakeCall.onClickCell)
end
function TRPMakeCall.onClickCell(cell, data)
UIInput.selection = InputNumber
InputNumber:Insert(data)
getPanelAsy("PanelCallLogDetail", onLoadedPanelTT, data)
end
-- 刷新
@@ -53,21 +155,21 @@ end
-- 关闭页面
function TRPMakeCall.hide()
UIInput.selection = nil
csSelf:cancelInvoke4Lua()
end
-- 网络请求的回调cmd指命succ成功失败msg消息paras服务器下行数据
function TRPMakeCall.procNetwork(cmd, succ, msg, paras)
if (succ == 0) then
if (cmd == "8888") then
-- 回拨已调用成功
local orgs = Hashtable()
orgs.callback = "TRPMakeCall.onEndIncomingCall"
orgs.id = msg
CLLCallListner.waite4Callback(JSON.JsonEncode(orgs))
CLUIUtl.showConfirm("云呼叫中,请准备接听电话", nil)
elseif cmd == "1018" then
-- 保存通话记录完成
CLLRecordMgr.moveRecord2Upload(currRecordName)
if succ == NetSuccess then
if cmd == NetProto.cmds.query_cust_calllog then
local result = paras.result or {}
TRPMakeCall.pageInfo = result.meta
if TRPMakeCall.pageInfo and TRPMakeCall.pageInfo.current_page > 1 then
TRPMakeCall.appList(result.data)
else
TRPMakeCall.showList(result.data)
end
hideHotWheel()
end
end
end
@@ -76,46 +178,61 @@ end
function TRPMakeCall.uiEventDelegate(go)
local goName = go.name
if (goName == "ButtonCancel") then
CLPanelManager.hideTopPanel()
hideTopPanel()
elseif goName == "InputNumber" then
cursorPosition = InputNumber.cursorPosition
if isNilOrEmpty(InputNumber.value) then
SetActive(ButtonDel, false)
else
SetActive(ButtonDel, true)
end
elseif goName == "ButtonCall" then
-- CLLCallListner.ready2Call("TRPMakeCall.onEndCall", InputNumber.value)
-- MyUtl.callPhone(InputNumber.value)
if InputNumber.value == nil or InputNumber.value == "" then
CLAlert.add("请输入要呼叫的号码", Color.white, 1)
MyUtl.toastW("请输入要呼叫的号码")
return
end
CLLCallListner.ready2Call("TRPMakeCall.onEndCall", InputNumber.value)
MyUtl.callPhone(InputNumber.value)
elseif goName == "ButtonCallYun" then
if InputNumber.value == nil or InputNumber.value == "" then
CLAlert.add("请输入要呼叫的号码", Color.white, 1)
MyUtl.toastW("请输入要呼叫的号码")
return
end
local selfPhoneNum = Prefs.getSelfPhoneNum()
showHotWheel()
CLLNet.callCust2(selfPhoneNum, InputNumber.value)
MyUtl.doCall(
nil,
InputNumber.value,
nil,
function()
InputNumber.value = ""
end
)
elseif goName == "ButtonDel" then
TRPMakeCall.DoBackspace()
elseif goName == "ButtonShow" then
SetActive(uiobjs.ButtonShow, false)
-- uiobjs.bottomOffset:Play(true)
SetActive(uiobjs.bottomOffset.gameObject, true)
elseif goName == "ButtonHide" then
SetActive(uiobjs.ButtonShow, true)
-- uiobjs.bottomOffset:Play(false)
SetActive(uiobjs.bottomOffset.gameObject, false)
end
end
-- 当结束通话
function TRPMakeCall.onEndCall(orgs)
local func = function(remark)
local data = Hashtable()
data.remark = remark
data.caller_number = Prefs.getSelfPhoneNum()
data.destination_number = orgs.phone
data.created_time = orgs.created_time
data.answered_time = orgs.answered_time
data.over_time = orgs.over_time
data.recording_file_name = Path.GetFileName(orgs.soundRecordFile)
showHotWheel()
CLLNet.saveCall(data)
end
currRecordName = Path.GetFileName(orgs.soundRecordFile)
function TRPMakeCall.onPressButtonDel()
csSelf:invoke4Lua(TRPMakeCall.invokeBackspace, 0.25)
end
CLPanelManager.getPanelAsy("PanelEndCallRemark", onLoadedPanelTT, func)
function TRPMakeCall.onReleaseButtonDel()
csSelf:cancelInvoke4Lua(TRPMakeCall.invokeBackspace)
end
function TRPMakeCall.invokeBackspace()
TRPMakeCall.DoBackspace()
if not isNilOrEmpty(InputNumber.value) then
csSelf:invoke4Lua(TRPMakeCall.invokeBackspace, 0.05)
end
end
-- 当结束回播通话
@@ -130,7 +247,7 @@ end
-- 当按了返回键时关闭自己返值为true时关闭
function TRPMakeCall.hideSelfOnKeyBack()
return true
return false
end
function TRPMakeCall.DoBackspace()

View File

@@ -46,6 +46,8 @@ function TRPNewCust:setData(paras)
else
self.isNewCust = true
self.mdata = {}
self.mdata.phoneNo = paras and paras.phoneNo or "" -- 可能已经把手机号带过来了
self.mdata._phoneNo = self.mdata.phoneNo
self.mdata.dealFlag = "0"
self.mdata.custType = "0"
self.mdata.custFrom = "0"

View File

@@ -79,20 +79,37 @@ function TRPResetPasswordStep1:setEventDelegate()
d.oprType = "updatePho"
elseif self.mData.isAuth then
end
NetProto.sendVerMsg(
d,
function(data, orgs)
if data.code == NetSuccess then
getPanelAsy("PanelResetPasswordStep2", onLoadedPanelTT, d)
if self.mData.isBindPhone then
NetProto.send.preUpdatePho(
d.phoneNo,
function(content)
if content.success then
self:goNext(d)
end
end
end
)
)
else
self:goNext(d)
end
end,
ButtonDelPhoneNum = function()
uiobjs.InputPhoneNum.value = ""
end
}
end
function TRPResetPasswordStep1:goNext(d)
NetProto.sendVerMsg(
d,
function(data, orgs)
if data.code == NetSuccess then
getPanelAsy("PanelResetPasswordStep2", onLoadedPanelTT, d)
end
end
)
end
-- 处理ui上的事件例如点击等
function TRPResetPasswordStep1:uiEventDelegate(go)
local func = self.EventDelegate[go.name]