GetGoodsTips = GetGoodsTips or BaseClass(BaseView)
|
|
local GetGoodsTips = GetGoodsTips
|
|
|
|
function GetGoodsTips:__init()
|
|
self.base_file = "common"
|
|
self.layout_file = "GetGoodsTips"
|
|
self.layer_name = "Activity"
|
|
self.destroy_imm = true
|
|
self.change_scene_close = true
|
|
self.append_to_ctl_queue = false --是否要添加进界面堆栈
|
|
self.need_show_money = false --是否要显示顶部的金钱栏
|
|
self.is_set_zdepth = true
|
|
self.click_bg_toClose = true
|
|
------------------------
|
|
-- 一级全屏界面:
|
|
self.hide_maincancas = false --隐藏主界面
|
|
self.use_background = true --不一定显示遮罩
|
|
------------------------
|
|
|
|
self.model = GoodsModel:getInstance()
|
|
self.get_way_item_list = {}
|
|
|
|
self.load_callback = function ()
|
|
self:LoadSuccess()
|
|
self:AddEvent()
|
|
end
|
|
self.open_callback = function ( )
|
|
self:OpenSuccess()
|
|
end
|
|
self.close_win_callback = function ( )
|
|
self:Close()
|
|
end
|
|
self.destroy_callback = function ( )
|
|
self:DestroySuccess()
|
|
end
|
|
end
|
|
|
|
function GetGoodsTips:Open( type_id )
|
|
self.type_id = type_id
|
|
BaseView.Open(self)
|
|
end
|
|
|
|
function GetGoodsTips:LoadSuccess()
|
|
local nodes = {
|
|
"get_way_bg:raw","ScrollView/Viewport/Content"
|
|
}
|
|
self:GetChildren(nodes)
|
|
lua_resM:setOutsideRawImage(self,self.get_way_bg_raw,GameResPath.GetViewBigBg("tips_comm_bg4"),false)
|
|
end
|
|
|
|
function GetGoodsTips:AddEvent()
|
|
|
|
end
|
|
|
|
function GetGoodsTips:OpenSuccess()
|
|
self:UpdateView()
|
|
end
|
|
|
|
function GetGoodsTips:UpdateView()
|
|
local function callback( )
|
|
self:Close()
|
|
end
|
|
local basic = GoodsModel:getInstance():GetGoodsBasicByTypeId(self.type_id)
|
|
if basic and basic.getway_url and Trim(basic.getway_url) ~= "[]" then
|
|
local getway = ErlangParser:GetInstance():Parse( basic.getway_url)
|
|
for i,v in ipairs(getway) do
|
|
local item = self.get_way_item_list[i]
|
|
if not item then
|
|
item = self:CreateItem(GetGoodsItem, self.Content, self.layer_name)
|
|
self.get_way_item_list[i] = item
|
|
item:SetPosition(0, -96 * (i - 1))
|
|
end
|
|
item:SetVisible(true)
|
|
item:SetData(v, basic.type_id, callback)
|
|
end
|
|
end
|
|
end
|
|
|
|
function GetGoodsTips:DestroySuccess( )
|
|
end
|