This commit is contained in:
2020-07-26 11:12:32 +08:00
parent 67a1f974bf
commit 53e9c8d4ce
69 changed files with 15012 additions and 105 deletions

View File

@@ -0,0 +1,58 @@
-- 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