upgrade
This commit is contained in:
@@ -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为调用refresh,show和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
|
||||
Reference in New Issue
Block a user