Files
tianrunCRM/Assets/trCRM/upgradeRes4Dev/priority/lua/ui/cell/TRCellProccessHis.lua
2020-07-26 11:12:32 +08:00

59 lines
1.6 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.

-- xx单元
local _cell = {}
---@type Coolape.CLCellLua
local csSelf = nil
local transform = nil
local mData = nil
local uiobjs = {}
-- 初始化,只调用一次
function _cell.init(csObj)
csSelf = csObj
transform = csSelf.transform
---@type CLUIFormRoot
uiobjs.formRoot = csSelf:GetComponent("CLUIFormRoot")
---@type UIPopupList
uiobjs.LabelServerNo = getCC(transform, "LabelServerNo", "UIPopupList")
uiobjs.SpriteHeadIcon = getCC(transform, "SpriteHeadBg/SpriteHeadIcon", "UITexture")
---@type UISprite
uiobjs.SpriteLine2 = getChild(transform, "SpriteLine2")
end
-- 显示,
-- 注意c#侧不会在调用show时调用refresh
function _cell.show(go, data)
mData = data
local optionInfor = DBUser.getPopList(DBUser.FilterGroup.user)
uiobjs.LabelServerNo:refreshItems(optionInfor.options, optionInfor.values)
uiobjs.formRoot:setValue(mData)
---@type _DBUser
local user = DBUser.getUserById(mData.loginNo)
if user then
DBUser.getIcon(
mData.loginNo,
function(texture)
if texture and texture.name == user.imageUrl then
uiobjs.SpriteHeadIcon.mainTexture = texture
end
end
)
end
if csSelf.name == "000000" then
SetActive(uiobjs.SpriteLine2.gameObject, false)
else
SetActive(uiobjs.SpriteLine2.gameObject, true)
end
end
-- 取得数据
function _cell.getData()
return mData
end
--------------------------------------------
return _cell