83 lines
2.6 KiB
Lua
83 lines
2.6 KiB
Lua
---@type IDBasePanel
|
||
local TRBasePanel = require("ui.panel.TRBasePanel")
|
||
---@class TRPSysMsgDetail:TRBasePanel
|
||
local TRPSysMsgDetail = class("TRPSysMsgDetail", TRBasePanel)
|
||
|
||
local uiobjs = {}
|
||
-- 初始化,只会调用一次
|
||
function TRPSysMsgDetail:init(csObj)
|
||
TRPSysMsgDetail.super.init(self, csObj)
|
||
|
||
self:setEventDelegate()
|
||
self.uiobjs = {}
|
||
---@type UIScrollView
|
||
self.uiobjs.scrollView = getCC(self.transform, "PanelContent", "UIScrollView")
|
||
MyUtl.setContentView(self.uiobjs.scrollView, 132 + 100 + 56 + 25 + 30 + 45, 0)
|
||
self.uiobjs.LabelContent = getCC(self.uiobjs.scrollView.transform, "LabelContent", "UILabel")
|
||
self.uiobjs.LabelTitle = getCC(self.transform, "LabelTitle", "UILabel")
|
||
self.uiobjs.LabelTime = getCC(self.transform, "LabelTime", "UILabel")
|
||
end
|
||
|
||
-- 设置数据
|
||
---@param paras _ParamTRPSysMsgDetail
|
||
function TRPSysMsgDetail:setData(paras)
|
||
---@type _DBMessage
|
||
self.mdata = paras
|
||
end
|
||
|
||
---public 当有通用背板显示时的回调
|
||
---@param cs Coolape.CLPanelLua
|
||
function TRPSysMsgDetail:onShowFrame(cs)
|
||
if cs.frameObj then
|
||
---@type _BGFrame1Param
|
||
local d = {}
|
||
-- d.title = LGet(cs.titleKeyName)
|
||
d.title = self.mdata.PanelTitle or "公告详情"
|
||
d.panel = cs
|
||
cs.frameObj:init(d)
|
||
end
|
||
end
|
||
-- 显示,在c#中。show为调用refresh,show和refresh的区别在于,当页面已经显示了的情况,当页面再次出现在最上层时,只会调用refresh
|
||
function TRPSysMsgDetail:show()
|
||
self.uiobjs.LabelContent.text = joinStr(" ", self.mdata.CONTENT)
|
||
self.uiobjs.LabelTime.text = self.mdata.CREATETIME and DateEx.formatByMs(tonumber(self.mdata.CREATETIME) * 1000) or ""
|
||
self.uiobjs.LabelTitle.text = self.mdata.TITLE
|
||
self.uiobjs.scrollView:ResetPosition()
|
||
end
|
||
|
||
-- 刷新
|
||
function TRPSysMsgDetail:refresh()
|
||
end
|
||
|
||
-- 关闭页面
|
||
function TRPSysMsgDetail:hide()
|
||
end
|
||
|
||
-- 网络请求的回调;cmd:指命,succ:成功失败,msg:消息;paras:服务器下行数据
|
||
function TRPSysMsgDetail:procNetwork(cmd, succ, msg, paras)
|
||
if (succ == NetSuccess) then
|
||
--[[
|
||
if cmd == xx then
|
||
end
|
||
]]
|
||
end
|
||
end
|
||
|
||
function TRPSysMsgDetail:setEventDelegate()
|
||
self.EventDelegate = {}
|
||
end
|
||
-- 处理ui上的事件,例如点击等
|
||
function TRPSysMsgDetail:uiEventDelegate(go)
|
||
local func = self.EventDelegate[go.name]
|
||
if func then
|
||
func()
|
||
end
|
||
end
|
||
|
||
-- 当顶层页面发生变化时回调
|
||
function TRPSysMsgDetail:onTopPanelChange(topPanel)
|
||
end
|
||
|
||
--------------------------------------------
|
||
return TRPSysMsgDetail
|