Files
tianrunCRM/Assets/trCRM/upgradeRes4Dev/priority/lua/ui/panel/TRPEditPrice.lua
2020-07-14 22:04:03 +08:00

78 lines
2.1 KiB
Lua
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---@type IDBasePanel
local TRBasePanel = require("ui.panel.TRBasePanel")
---@class TRPEditPrice:TRBasePanel 邮件列表
local TRPEditPrice = class("TRPEditPrice", TRBasePanel)
local uiobjs = {}
local callback
-- 初始化,只会调用一次
function TRPEditPrice:init(csObj)
TRPEditPrice.super.init(self, csObj)
self:setEventDelegate()
---@type CLUIFormRoot
uiobjs.formRoot = self.csSelf:GetComponent("CLUIFormRoot")
end
-- 设置数据
---@param paras _ParamTRPEditPrice
function TRPEditPrice:setData(paras)
self.mdata = paras.data
callback = paras.callback
end
-- 显示在c#中。show为调用refreshshow和refresh的区别在于当页面已经显示了的情况当页面再次出现在最上层时只会调用refresh
function TRPEditPrice:show()
uiobjs.formRoot:setValue(self.mdata)
end
-- 刷新
function TRPEditPrice:refresh()
end
-- 关闭页面
function TRPEditPrice:hide()
end
-- 网络请求的回调cmd指命succ成功失败msg消息paras服务器下行数据
function TRPEditPrice:procNetwork(cmd, succ, msg, paras)
if (succ == NetSuccess) then
--[[
if cmd == xx then
end
]]
end
end
function TRPEditPrice:setEventDelegate()
self.EventDelegate = {
ButtonCancel = function()
hideTopPanel(self.csSelf)
end,
ButtonOkay = function()
hideTopPanel(self.csSelf)
self.mdata = uiobjs.formRoot:getValue(self.mdata, true)
if tonumber(self.mdata.productNum) <= 0 then
MyUtl.toastW("数量不能低于1")
return
end
Utl.doCallback(callback, self.mdata)
end
}
end
-- 处理ui上的事件例如点击等
function TRPEditPrice:uiEventDelegate(go)
local func = self.EventDelegate[go.name]
if func then
func()
end
end
-- 当顶层页面发生变化时回调
function TRPEditPrice:onTopPanelChange(topPanel)
end
--------------------------------------------
return TRPEditPrice