@@ -0,0 +1,78 @@
-- xx单元
local _cell = { }
---@type Coolape.CLCellLua
local csSelf = nil
local transform = nil
---@type _DBCust
local mData = nil
local uiobjs = { }
-- 初始化,只调用一次
function _cell . init ( csObj )
csSelf = csObj
transform = csSelf.transform
-- uiobjs.LabelCompanyName = getCC(transform, "LabelCompanyName", "UILabel")
-- uiobjs.LabelTime = getCC(transform, "LabelTime", "UILabel")
---@type UIPopupList
uiobjs.LabelStatus = getCC ( transform , " LabelStatus " , " UIPopupList " )
-- uiobjs.LabelCustName = getCC(transform, "LabelCustName", "UILabel")
-- uiobjs.SpriteStatus = getCC(transform, "SpriteStatus", "UISprite")
uiobjs.LabelServerNo = getCC ( transform , " LabelServerNo " , " UILabel " )
---@type CLUIFormRoot
uiobjs.formRoot = csSelf : GetComponent ( " CLUIFormRoot " )
uiobjs.SpriteStatus = getChild ( transform , " SpriteStatus " )
uiobjs.SpriteHeadIcon = getCC ( transform , " SpriteHeadBg/SpriteHeadIcon " , " UITexture " )
end
-- 显示,
-- 注意, c#侧不会在调用show时, 调用refresh
function _cell . show ( go , data )
mData = data
mData._phoneNo = MyUtl.hidePhone ( mData.phoneNo )
mData.lastFollowUpTime = isNilOrEmpty ( mData.lastFollowUpTime ) and " 无 " or mData.lastFollowUpTime
local optionInfor = DBCust.getFilter4Popup ( DBCust.FilterGroup . dealFlagList )
uiobjs.LabelStatus : refreshItems ( optionInfor.options , optionInfor.values )
uiobjs.formRoot : setValue ( mData )
if tostring ( mData.dealFlag ) == " 0 " then
SetActive ( uiobjs.SpriteStatus . gameObject , true )
else
SetActive ( uiobjs.SpriteStatus . gameObject , false )
end
_cell.setHeadIcon ( )
end
function _cell . setHeadIcon ( )
---@type _DBUser
local user = DBUser.getUserById ( mData.serviceNo )
if user then
uiobjs.LabelServerNo . text = user.loginName
DBUser.getIcon (
mData.serviceNo ,
function ( texture )
if texture and texture.name == user.imageUrl then
uiobjs.SpriteHeadIcon . mainTexture = texture
end
end
)
end
end
-- 取得数据
function _cell . getData ( )
return mData
end
function _cell . uiEventDelegate ( go )
local goName = go.name
if goName == " ButtonFollow " then
getPanelAsy ( " PanelNewFollow " , onLoadedPanelTT , mData )
elseif goName == " ButtonTask " then
getPanelAsy ( " PanelNewFollowTask " , onLoadedPanelTT , mData )
elseif goName == " ButtonContact " then
MyUtl.callCust ( mData )
end
end
--------------------------------------------
return _cell