UpSuccessAttrItem = UpSuccessAttrItem or BaseClass(BaseItem)
|
|
local UpSuccessAttrItem = UpSuccessAttrItem
|
|
|
|
function UpSuccessAttrItem:__init()
|
|
self.base_file = "upSuccess"
|
|
self.layout_file = "UpSuccessAttrItem"
|
|
self.model = DailyModel:GetInstance()
|
|
|
|
self:Load()
|
|
end
|
|
|
|
function UpSuccessAttrItem:Load_callback()
|
|
self.nodes = {
|
|
"attr_2:tmp","up:obj","name:tmp","attr_1:tmp",
|
|
"attr_1_special:tmp","name_special:tmp","icon:img",
|
|
}
|
|
self:GetChildren(self.nodes)
|
|
|
|
self:AddEvents()
|
|
if self.need_refreshData then
|
|
self:UpdateView()
|
|
end
|
|
end
|
|
|
|
function UpSuccessAttrItem:AddEvents( )
|
|
|
|
end
|
|
|
|
function UpSuccessAttrItem:UpdateView( )
|
|
self.name_tmp.text = ""
|
|
self.attr_1_tmp.text = ""
|
|
self.attr_1_special_tmp.text = ""
|
|
self.name_special_tmp.text = ""
|
|
|
|
local _, name1, _, val1 = WordManager:GetPropertyInfo(self.data[1], self.data[2])
|
|
if WordManager:GetAttrIsSpecial(self.data[1]) then
|
|
self.name_special_tmp.text = name1 .. ":"
|
|
self.attr_1_special_tmp.text = val1
|
|
else
|
|
self.name_tmp.text = name1 .. ":"
|
|
self.attr_1_tmp.text = val1
|
|
end
|
|
|
|
if self.next_data and self.next_data[2] > self.data[2] then
|
|
local _, name2, _, val2 = WordManager:GetPropertyInfo(self.data[1], (self.next_data[2] - self.data[2]))
|
|
self.attr_2_tmp.text = val2
|
|
self.up_obj:SetActive(true)
|
|
else
|
|
self.up_obj:SetActive(false)
|
|
self.attr_2_tmp.text = ""
|
|
end
|
|
SetAttrIconByColorType(self, self.icon_img, self.data[1], nil, 1)
|
|
end
|
|
|
|
function UpSuccessAttrItem:SetData( index, data, next_data )
|
|
self.index = index
|
|
self.data = data
|
|
self.next_data = next_data
|
|
if self.is_loaded then
|
|
self.need_refreshData = false
|
|
self:UpdateView()
|
|
else
|
|
self.need_refreshData = true
|
|
end
|
|
end
|
|
|
|
function UpSuccessAttrItem:__delete( )
|
|
|
|
end
|