源战役客户端
Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 
 
 
 

155 wiersze
5.2 KiB

--[[@------------------------------------------------------------------
@description:社团协助信息收下谢礼列表界面
@author:huangcong
----------------------------------------------------------------------]]
GuildSupportInfoMainGiftView = GuildSupportInfoMainGiftView or BaseClass(BaseItem)
local GuildSupportInfoMainGiftView = GuildSupportInfoMainGiftView
function GuildSupportInfoMainGiftView:__init()
self.base_file = "guild"
self.layout_file = "GuildSupportInfoMainGiftView"
self.model = GuildModel:getInstance()
self.main_vo = RoleManager:getInstance():GetMainRoleVo()
MsgManager:getInstance():Remove(Config.ConfigMainIcon.TipType.supportThank)
self:Load()
end
function GuildSupportInfoMainGiftView:Load_callback()
local nodes = {
"itemScroll","itemScroll/Viewport/itemCon",
"nodata_bg:obj:raw","nodata_bg/nodata_desc:tmp","nodata_bg/nodata_desc_click:tmp:obj","nodata_bg/nodata_desc_click2:tmp:obj",
}
self:GetChildren(nodes)
lua_resM:setOutsideRawImage(self, self.nodata_bg_raw, GameResPath.GetViewBigBg("guild_support_empty_bg"),false)
if self.main_vo.guild_id > 0 then
self.nodata_desc_click_obj:SetActive(false)
self.nodata_desc_click2_obj:SetActive(true)
self.nodata_bg_obj:SetActive(false)
self.nodata_desc_tmp.text = ""
else--显示超链接
self.nodata_bg_obj:SetActive(true)
self.nodata_desc_click_obj:SetActive(true)
self.nodata_desc_click2_obj:SetActive(false)
self.nodata_desc_tmp.text = "未加入社团~\n请前往 加入或创建社团."
end
self.nodata_desc_click_tmp.text = "<u>社团列表</u>"
self.model:Fire(GuildModel.REQUEST_CCMD_EVENT,40069)
if self.need_refreshData then
self:SetData(self.speaciel_data)
end
self:InitEvent()
end
function GuildSupportInfoMainGiftView:__delete()
end
function GuildSupportInfoMainGiftView:InitEvent()
local function onBtnClickHandler(target,x,y)
if target == self.nodata_desc_click_obj then--加入社团
self.model:Fire(GuildModel.CLOSE_GUILD_SUPPORT_IFNO_VIEW)
OpenFun.Open(400,0)
elseif target == self.nodata_desc_click2_obj then--更多协助
self.model:Fire(GuildModel.OPEN_GUILD_SUPPORT_IFNO_VIEW,GuildModel.SupportTab.List)
end
end
AddClickEvent(self.nodata_desc_click_obj, onBtnClickHandler, LuaSoundManager.SOUND_UI.NONE)
AddClickEvent(self.nodata_desc_click2_obj, onBtnClickHandler, LuaSoundManager.SOUND_UI.NONE)
local function updateDataInfo( )
if not self.is_loaded then
return
end
if self.main_vo.guild_id > 0 then
self:UpdateItemList()
end
end
self:BindEvent(self.model, GuildModel.UPDATE_SUPPORT_GIFT_LIST, updateDataInfo)--刷新协助信息列表
end
function GuildSupportInfoMainGiftView:SetData(speaciel_data)
self.speaciel_data = speaciel_data or self.speaciel_data
if self.is_loaded then
self.need_refreshData = false
else
self.need_refreshData = true
return
end
if self.main_vo.guild_id > 0 then
self:UpdateItemList()
end
end
--更新协助信息item
function GuildSupportInfoMainGiftView:UpdateItemList( )
local item_list = self.model:GetSupportGiftList() or {}
-- print("huangcong:GuildSupportInfoMainGiftView [start:132] :", item_list)
-- PrintTable(item_list)
-- print("huangcong:GuildSupportInfoMainGiftView [end]")
if not item_list or TableSize(item_list) == 0 then
self.nodata_bg_obj:SetActive(true)
self.nodata_desc_tmp.text = "未收到感谢~\n快前往 帮助他人吧~"
self.nodata_desc_click2_tmp.text = "<u>协助列表</u>"
else
self.nodata_bg_obj:SetActive(false)
self.nodata_desc_tmp.text = ""
self.nodata_desc_click2_tmp.text = ""
end
if self.speaciel_data then
for i,v in ipairs(item_list) do
if self.speaciel_data.support_id == v.support_id and self.speaciel_data.type == v.type
and v.is_get == 0 then
self.speaciel_data = nil
local data = DeepCopy(v)
data.role_list = {
{
name = v.name,
picture = v.picture,
role_id = v.role_id,
sex = v.sex,
sup_vip_type = v.sup_vip_type,
vip_flag = v.vip_flag,
chat_msg = v.chat_msg,
profile_photo_id = v.profile_photo_id,
dress_board_id = v.dress_board_id,
}
}
self.model:Fire(GuildModel.OPEN_GUILD_SUPPORT_THANK_VIEW,GuildModel.SupportType.Award,data)
break
end
end
end
if not self.item_creator_com then
self.item_creator_com = self:AddUIComponent(UI.ItemListCreator)
else
-- self.item_creator_com:Reset()
end
local info = {
data_list = item_list,
item_con = self.itemCon,
item_class = GuildSupportInfoMainGiftItem,
item_height = GuildSupportInfoMainGiftItem.Height,
item_width = GuildSupportInfoMainGiftItem.Width,
start_x = 2,
start_y = -2,
space_x = 18,
space_y = 15,
scroll_view = self.itemScroll,
create_frequency = 0.02,
reuse_item_num = 12,
show_col = 4,
on_update_item = function(item, i, v)
item:SetData(v,i)
end,
}
self.item_creator_com:UpdateItems(info)
end
function GuildSupportInfoMainGiftView:BtnCloseEvt()--关闭按钮回调
self.model:Fire(GuildModel.CLOSE_GUILD_SUPPORT_IFNO_VIEW)
end