Files
tianrunCRM/Assets/trCRM/upgradeRes4Dev/priority/lua/ui/panel/TRPCallLogDetail.lua

108 lines
3.5 KiB
Lua
Raw Normal View History

2020-08-26 19:56:45 +08:00
---@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