local ZPZhanJiView = class("ZPZhanJiView", cc.UIView) function ZPZhanJiView:ctor() ZPZhanJiView.super.ctor(self); local ui = loadUI("res/ui/ui_zhanji/zhanji_view.ui"); self.ui = ui; self:addChild(ui); end function ZPZhanJiView:onEnter() ZPZhanJiView.super.onEnter(self) self.ui.Items.Button:registerClick(handler(self, self.onClickClose)) local protocolZhanJi = app:getProtocolZhanJi(app.gameId) if not protocolZhanJi then return end local zhanjiInfoList = protocolZhanJi.zhanjiInfoList local listView = import("zp_base.luaScript.Views.ZhanJi.ZPZhanJiList"):new(zhanjiInfoList) if listView then self.ui.Items.Layout_Content:removeAllChildren(); self.ui.Items.Layout_Content:addChild(listView.ui) end end function ZPZhanJiView:onClickClose() playBtnEffect() self:removeFromParent() end return ZPZhanJiView