local UITotalTopUpBase = UIViewClass() local Charge_FunctionId = 8001 function UITotalTopUpBase:OnOpened(context) self:RegistSystemEvent(EventID.FunctionUnlockUpdate, self.RefreshByGMSwitch) UIUtils.SetLabelText(self.UITemplateTitlePanel.lab_Title, Const_IDS["IDS_Store_RechargeButton"]) UIUtils.SetActive(self.UITemplateTitlePanel.btn_Info, false) self.subView_TotalTopUp:OpenView(GetViewClass(Const_UI_Lua.UIEnum.UIRechargeView)) end function UITotalTopUpBase:OnClosed() UIUtils.SetActive(self.UITemplateTitlePanel.btn_Info, true) end function UITotalTopUpBase:RefreshByGMSwitch(funcId, isUnlock) if funcId == Charge_FunctionId and isUnlock == false then self:CloseView(true) end end function UITotalTopUpBase:OnBackButtonPressed() self:OnButtonClicked(self.UITemplateTitlePanel.btn_close) end function UITotalTopUpBase:OnButtonClicked(comp) if comp == self.UITemplateTitlePanel.btn_close then self:CloseView(true) elseif comp == self.UITemplateTitlePanel.btn_Home then CTL.HomeMain.CloseViewBackHomeMain() end end return UITotalTopUpBase