102 lines
2.8 KiB
Lua
102 lines
2.8 KiB
Lua
---@type IDBasePanel
|
||
local TRBasePanel = require("ui.panel.TRBasePanel")
|
||
---@class TRPBatchGetCusts:TRBasePanel 邮件列表
|
||
local TRPBatchGetCusts = class("TRPBatchGetCusts", TRBasePanel)
|
||
|
||
local uiobjs = {}
|
||
-- 初始化,只会调用一次
|
||
function TRPBatchGetCusts:init(csObj)
|
||
TRPBatchGetCusts.super.init(self, csObj)
|
||
|
||
self:setEventDelegate()
|
||
---@type UIToggle
|
||
uiobjs.Toggle10 = getCC(self.transform, "Toggle10", "UIToggle")
|
||
end
|
||
|
||
-- 设置数据
|
||
---@param paras _ParamTRPBatchGetCusts
|
||
function TRPBatchGetCusts:setData(paras)
|
||
self.mdata = paras
|
||
end
|
||
|
||
-- 显示,在c#中。show为调用refresh,show和refresh的区别在于,当页面已经显示了的情况,当页面再次出现在最上层时,只会调用refresh
|
||
function TRPBatchGetCusts:show()
|
||
uiobjs.Toggle10:Set(true)
|
||
end
|
||
|
||
-- 刷新
|
||
function TRPBatchGetCusts:refresh()
|
||
end
|
||
|
||
-- 关闭页面
|
||
function TRPBatchGetCusts:hide()
|
||
end
|
||
|
||
-- 网络请求的回调;cmd:指命,succ:成功失败,msg:消息;paras:服务器下行数据
|
||
function TRPBatchGetCusts:procNetwork(cmd, succ, msg, paras)
|
||
if (succ == NetSuccess) then
|
||
--[[
|
||
if cmd == xx then
|
||
end
|
||
]]
|
||
end
|
||
end
|
||
|
||
function TRPBatchGetCusts:setEventDelegate()
|
||
self.EventDelegate = {
|
||
Toggle10 = function(go)
|
||
---@type UIToggle
|
||
local toggle = go:GetComponent("UIToggle")
|
||
if toggle and toggle.value then
|
||
self.number = 10
|
||
end
|
||
end,
|
||
Toggle20 = function(go)
|
||
---@type UIToggle
|
||
local toggle = go:GetComponent("UIToggle")
|
||
if toggle and toggle.value then
|
||
self.number = 20
|
||
end
|
||
end,
|
||
Toggle100 = function(go)
|
||
---@type UIToggle
|
||
local toggle = go:GetComponent("UIToggle")
|
||
if toggle and toggle.value then
|
||
self.number = 100
|
||
end
|
||
end,
|
||
ButtonCancel = function()
|
||
hideTopPanel(self.csSelf)
|
||
end,
|
||
ButtonOkay = function()
|
||
showHotWheel()
|
||
local params = {
|
||
getNum = self.number,
|
||
oprType = "byNum"
|
||
}
|
||
NetProto.send.getFromGH(
|
||
params,
|
||
function(content)
|
||
if content.success then
|
||
hideTopPanel(self.csSelf)
|
||
end
|
||
end
|
||
)
|
||
end
|
||
}
|
||
end
|
||
-- 处理ui上的事件,例如点击等
|
||
function TRPBatchGetCusts:uiEventDelegate(go)
|
||
local func = self.EventDelegate[go.name]
|
||
if func then
|
||
func(go)
|
||
end
|
||
end
|
||
|
||
-- 当顶层页面发生变化时回调
|
||
function TRPBatchGetCusts:onTopPanelChange(topPanel)
|
||
end
|
||
|
||
--------------------------------------------
|
||
return TRPBatchGetCusts
|