GuildSupportDescTipItem = GuildSupportDescTipItem or BaseClass(BaseItem)
|
|
|
|
local GuildSupportDescTipItem = GuildSupportDescTipItem
|
|
GuildSupportDescTipItem.Width = 312
|
|
GuildSupportDescTipItem.Height = 43
|
|
function GuildSupportDescTipItem:__init()
|
|
self.base_file = "guild"
|
|
self.layout_file = "GuildSupportDescTipItem"
|
|
self.is_delay_callback = true
|
|
self.model = GuildModel:getInstance()
|
|
self:Load()
|
|
end
|
|
|
|
function GuildSupportDescTipItem:Load_callback()
|
|
self.nodes = {
|
|
"lb:txt","click_bg:obj",
|
|
}
|
|
self:GetChildren(self.nodes)
|
|
|
|
if self.need_refreshData then
|
|
self:SetData(self.data,self.index)
|
|
end
|
|
self:InitEvent()
|
|
end
|
|
|
|
function GuildSupportDescTipItem:InitEvent()
|
|
local function clickHandler(target)
|
|
if target == self.click_bg_obj then--选择
|
|
self.model:Fire(GuildModel.UPDATE_GUILD_SUPPOR_THANK_DESC,self.index)
|
|
end
|
|
end
|
|
AddClickEvent(self.click_bg_obj, clickHandler, LuaSoundManager.SOUND_UI.SWITCH)
|
|
end
|
|
|
|
function GuildSupportDescTipItem:__delete()
|
|
|
|
end
|
|
|
|
function GuildSupportDescTipItem:SetData(data,index)
|
|
self.data = data
|
|
self.index = index
|
|
if self.is_loaded then
|
|
self.need_refreshData = false
|
|
else
|
|
self.need_refreshData = true
|
|
return
|
|
end
|
|
if not self.data then return end
|
|
self.lb_txt.text = self.data
|
|
end
|