local UIDouYinRechargeReward = UIViewClass() function UIDouYinRechargeReward:OnOpened(context) self:RegistSystemEvent(EventID.UI_DouYinRechargeReward_Update, self.RefreshUI) if not context or not context.isEntry then MDL.DouYinRechargeReward.SetPushInterface() end self:RefreshUI() end function UIDouYinRechargeReward:RefreshUI() local cfgData = DataSheetManager.Channel:GetDataByChannelId(SDKUtil.ChannelID) UIUtils.SetImageByAssetBundle(self.img_Title, cfgData.Path) UIUtils.SetLabelText(self.lab_Info_1, Const_IDS[cfgData.IDS]) self.lab_TimeNum.text = MDL.DouYinRechargeReward.GetActivityTime() self.lab_Info_LyNum.text = (MDL.DouYinRechargeReward.GetDragonJadeRatio()*100).."%" self.lab_Tips_Num01.text = MDL.DouYinRechargeReward.GetChargeSum() self.lab_Tips_Num02.text = MDL.DouYinRechargeReward.GetChargeReward() self.lab_Tips_Num03.text = MDL.DouYinRechargeReward.GetLeftReward() self.btn_Get:SetRedPoint(CTL.RedPoint.GetRedPointActive(CTL.RedPoint.RedPointKey.DouYinRechargeReward)) end function UIDouYinRechargeReward:OnBackButtonPressed() self:OnButtonClicked(self.btn_Close) end function UIDouYinRechargeReward:OnButtonClicked(comp) if comp == self.btn_Close or comp == self.Bottom then CTL.PushInterface.HidePushInterface(self.__viewClassPath) self:CloseView() elseif comp == self.btn_Get then if MDL.DouYinRechargeReward.GetLeftReward() > 0 then MDL.DouYinRechargeReward.GetDouYinRechargeRewardReq() else CTL.Tips.AddTipsMsg(Const_IDS["IDS_ClimbTower_NoRewardTip"]) end end end return UIDouYinRechargeReward