39 lines
1.0 KiB
Lua
39 lines
1.0 KiB
Lua
|
|
-- 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
|
|||
|
|
uiobjs.formRoot = csSelf:GetComponent("CLUIFormRoot")
|
|||
|
|
uiobjs.LabelPhoneNo = getCC(transform, "LabelPhoneNo", "UILabel")
|
|||
|
|
uiobjs.SpriteType = getCC(transform, "SpriteType", "UISprite")
|
|||
|
|
end
|
|||
|
|
|
|||
|
|
-- 显示,
|
|||
|
|
-- 注意,c#侧不会在调用show时,调用refresh
|
|||
|
|
function _cell.show(go, data)
|
|||
|
|
mData = data
|
|||
|
|
uiobjs.formRoot:setValue(mData)
|
|||
|
|
if mData.calltype == "out" then
|
|||
|
|
uiobjs.SpriteType.spriteName = "call_outgoingcall"
|
|||
|
|
uiobjs.LabelPhoneNo.text = MyUtl.hidePhone(mData.destno)
|
|||
|
|
else
|
|||
|
|
uiobjs.SpriteType.spriteName = "call_comingcall"
|
|||
|
|
uiobjs.LabelPhoneNo.text = MyUtl.hidePhone(mData.callerno)
|
|||
|
|
end
|
|||
|
|
end
|
|||
|
|
|
|||
|
|
-- 取得数据
|
|||
|
|
function _cell.getData()
|
|||
|
|
return mData
|
|||
|
|
end
|
|||
|
|
|
|||
|
|
--------------------------------------------
|
|||
|
|
return _cell
|