This commit is contained in:
2020-07-21 22:50:03 +08:00
parent 4730b841ae
commit 3f114a6fca
69 changed files with 4668 additions and 1192 deletions

View File

@@ -0,0 +1,63 @@
-- 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.LabelStatus = getCC(transform, "LabelStatus", "UIPopupList")
---@type UIPopupList
uiobjs.LabelServerNo = getCC(transform, "LabelServerNo", "UIPopupList")
uiobjs.SpriteHeadIcon = getCC(transform, "SpriteHeadBg/SpriteHeadIcon", "UITexture")
uiobjs.SpriteStatus = getCC(transform, "SpriteStatus", "UISprite")
uiobjs.LabelDate = getCC(transform, "LabelDate", "UILabel")
end
-- 显示,
-- 注意c#侧不会在调用show时调用refresh
function _cell.show(go, data)
mData = data
local optionInfor = DBCust.getFilter4Popup(DBCust.FilterGroup.dealFlagList)
uiobjs.LabelStatus:refreshItems(optionInfor.options, optionInfor.values)
local optionInfor = DBUser.getPopList()
uiobjs.LabelServerNo:refreshItems(optionInfor.options, optionInfor.values)
if tostring(mData.dealFlag) == "0" then
SetActive(uiobjs.SpriteStatus.gameObject, true)
else
SetActive(uiobjs.SpriteStatus.gameObject, false)
end
uiobjs.LabelDate.text = string.sub(mData.createTime, 1, 10)
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
end
-- 取得数据
function _cell.getData()
return mData
end
--------------------------------------------
return _cell

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: b5e8ea8ac07cd437dab3b0229f3888b0
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -21,7 +21,9 @@ end
function _cell.show(go, data)
mData = data
uiobjs.formRoot:setValue(mData.data, true)
_cell.selected(mData.isSelected)
if uiobjs.Toggle then
_cell.selected(mData.isSelected)
end
end
-- 取得数据