MailAwardItem = MailAwardItem or BaseClass(AwardItem)
|
|
function MailAwardItem:__init()
|
|
self.model = SocialityModel:getInstance()
|
|
end
|
|
|
|
function MailAwardItem:Load_callback()
|
|
AwardItem.Load_callback(self)
|
|
if self.need_refreData then
|
|
self:SetData(self.is_got,self.typeId,self.num,self.param1,self.param2,self.islock)
|
|
end
|
|
end
|
|
|
|
function MailAwardItem:__delete()
|
|
|
|
end
|
|
|
|
function MailAwardItem:SetData(is_got,typeId, num, param1, param2, islock)
|
|
self.typeId = typeId
|
|
self.num = num
|
|
self.param1 = param1
|
|
self.param2 = param2
|
|
self.islock = islock
|
|
self.is_got = is_got
|
|
if self.is_loaded then
|
|
local equip_data = EquipModel:getInstance():GetBagEquipAwaraItemInfo(param2)
|
|
if equip_data then
|
|
equip_data.equip_key = "EquipView"
|
|
end
|
|
if is_got == 1 then
|
|
AwardItem.SetData(self,typeId, num, param1, equip_data, islock,nil,nil,nil,nil,true)
|
|
else
|
|
AwardItem.SetData(self,typeId, num, param1, equip_data, islock)
|
|
end
|
|
self:ChangeState(is_got == 1 and true or false)
|
|
else
|
|
self.need_refreData = true
|
|
end
|
|
end
|
|
|
|
function MailAwardItem:ChangeState(bool)
|
|
self:SetIconGray(bool)
|
|
--新UI样式已领取角标不要了,这里先注释,后面找时间干掉整个类
|
|
-- if bool then
|
|
-- if not self.gotObj then
|
|
-- self.gotObj = UiFactory.createChild(self.transform,UIType.Image)
|
|
-- self.gotImg = self.gotObj.transform:GetComponent("Image")
|
|
-- end
|
|
-- local function call_back()
|
|
-- SetSizeDelta(self.gotObj.transform,64,49)
|
|
-- SetAnchoredPosition(self.gotObj.transform,-34,35)
|
|
-- end
|
|
-- lua_resM:setImageSprite(self, self.gotImg,"sociality_asset","sociality_mail_got",false,call_back)
|
|
-- else
|
|
-- lua_resM:setImageSprite(self, self.gotImg,"uiComponent_asset","com_empty",true)
|
|
-- end
|
|
-- if self.gotObj then
|
|
-- self.gotObj.gameObject:SetActive(bool)
|
|
-- end
|
|
end
|