|
|
ActEnterView = ActEnterView or BaseClass(BaseView)
|
|
function ActEnterView:__init()
|
|
self.base_file = "common"
|
|
self.layout_file = "ActEnterView"
|
|
self.layer_name = "Activity"
|
|
-- self.use_local_view = true
|
|
self.destroy_imm = true
|
|
self.is_set_zdepth = true
|
|
self.hide_maincancas = false
|
|
self.change_scene_close = true
|
|
self.is_hide_skill_black_bg = true
|
|
self.load_callback = function ()
|
|
self:LoadSuccess()
|
|
self:InitEvent()
|
|
|
|
end
|
|
self.open_callback = function ()
|
|
self:SetData()
|
|
end
|
|
self.close_callback = function ()
|
|
self:Remove()
|
|
end
|
|
end
|
|
|
|
function ActEnterView:Remove()
|
|
|
|
end
|
|
|
|
function ActEnterView:Open( winId, subId )
|
|
self.winId = winId
|
|
self.subId = subId
|
|
if not winId or not subId then
|
|
print("ActEnterView:Open winId",winId,"subId",subId)
|
|
return
|
|
end
|
|
BaseView.Open(self)
|
|
end
|
|
|
|
function ActEnterView:LoadSuccess()
|
|
self.btnEnter
|
|
= GetChildGameObjects(self.transform, {
|
|
"btnEnter"
|
|
})
|
|
|
|
self.title_text,
|
|
self.des_text
|
|
= GetChildTexts(self.transform, {
|
|
"Window/windowTitleCon/windowTitleText",
|
|
"rect/text"
|
|
})
|
|
self.des_text_tr = self.des_text.transform
|
|
self.icon = GetChildImages(self.transform, {
|
|
"icon"
|
|
})
|
|
|
|
end
|
|
|
|
function ActEnterView:InitEvent()
|
|
AddClickEvent(self.btnEnter, function ()
|
|
self:Close()
|
|
OpenFun.Open(self.winId,self.subId)
|
|
end)
|
|
end
|
|
|
|
--des 是无的话就是没有配置
|
|
function ActEnterView:SetData( )
|
|
local key = self.winId.."@"..self.subId
|
|
local info = OpenFun.LinkWin[key]
|
|
local icon_res = ""
|
|
local des = ""
|
|
local title = ""
|
|
if info then
|
|
title = info.name
|
|
icon_res = info.icon_res
|
|
des = info.act_des or "无"
|
|
else
|
|
print("OpenFun 没有"..key.."配置")
|
|
return
|
|
end
|
|
lua_resM:setImageSprite(self,self.icon,"activityIcon_asset",icon_res,false)
|
|
self.title_text.text = title
|
|
self.des_text.text = des
|
|
self.des_text_tr.sizeDelta = Vector2(self.des_text_tr.sizeDelta.x,self.des_text.preferredHeight)
|
|
end
|