CSMainExploitRankDailyRewardView = CSMainExploitRankDailyRewardView or BaseClass(BaseView)
|
|
local CSMainExploitRankDailyRewardView = CSMainExploitRankDailyRewardView
|
|
|
|
function CSMainExploitRankDailyRewardView:__init()
|
|
self.base_file = "csMain"
|
|
self.layout_file = "CSMainExploitRankDailyRewardView"
|
|
self.layer_name = "Activity"
|
|
self.destroy_imm = true
|
|
self.use_background = true
|
|
self.change_scene_close = true
|
|
self.hide_maincancas = true --是否隐藏主界面
|
|
self.append_to_ctl_queue = false --是否要添加进界面堆栈
|
|
self.need_show_money = false --是否要显示顶部的金钱栏
|
|
self.click_bg_toClose = true
|
|
self.is_set_zdepth = true
|
|
|
|
|
|
self.model = CSMainModel:getInstance()
|
|
|
|
|
|
self.load_callback = function ()
|
|
self:LoadSuccess()
|
|
self:AddEvent()
|
|
end
|
|
self.open_callback = function ( )
|
|
self:OpenSuccess()
|
|
end
|
|
self.destroy_callback = function ( )
|
|
self:DestroySuccess()
|
|
end
|
|
end
|
|
|
|
function CSMainExploitRankDailyRewardView:Open()
|
|
BaseView.Open(self)
|
|
end
|
|
|
|
function CSMainExploitRankDailyRewardView:LoadSuccess()
|
|
local nodes = {
|
|
"bg:raw",
|
|
"ScrollView", "ScrollView/Viewport/Content",
|
|
}
|
|
self:GetChildren(nodes)
|
|
|
|
lua_resM:setOutsideRawImage(self,self.bg_raw,GameResPath.GetViewBigBg("cs_main_daily_reward_bg"))
|
|
|
|
end
|
|
|
|
function CSMainExploitRankDailyRewardView:AddEvent()
|
|
|
|
|
|
local function on_update_reward_view()
|
|
self:UpdateView()
|
|
end
|
|
self:BindEvent(self.model, CSMainConst.UPDATE_EXPLOIT_DAILY_REWARD_VIEW, on_update_reward_view)
|
|
|
|
local function CLICK_GET_WAY_ITEM( )
|
|
self:Close()
|
|
end
|
|
self:BindEvent(GlobalEventSystem, EventName.CLICK_GET_WAY_ITEM, CLICK_GET_WAY_ITEM)
|
|
end
|
|
|
|
function CSMainExploitRankDailyRewardView:OpenSuccess()
|
|
self:UpdateView()
|
|
end
|
|
|
|
function CSMainExploitRankDailyRewardView:UpdateView( )
|
|
local reward_cfg = self.model:GetCSMainSortExploitRankRewardCfg()
|
|
if not self.item_list_com then
|
|
self.item_list_com = self:AddUIComponent(UI.ItemListCreator)
|
|
end
|
|
local info = {
|
|
data_list = reward_cfg,
|
|
item_con = self.Content,
|
|
item_class = CSMainExploitRankDailyRewardItem,
|
|
item_width = 683,
|
|
item_height = 80,
|
|
-- space_x = 0,
|
|
space_y = 0,
|
|
start_x = 5,
|
|
start_y = 5,
|
|
scroll_view = self.ScrollView,
|
|
create_frequency = 0.01,
|
|
on_update_item = function(item, i, v)
|
|
item:SetData(v,i)
|
|
end,
|
|
}
|
|
self.item_list_com:UpdateItems(info)
|
|
end
|
|
|
|
function CSMainExploitRankDailyRewardView:DestroySuccess( )
|
|
|
|
end
|