local UIAttention = require "View/Welfare/Attention/UIAttention" local UIPushInterfaceAttention = UIViewClass(UIAttention) -------------------------- function UIPushInterfaceAttention:OnOpened(context) self:RegistSystemEvent(EventID.FunctionUnlockUpdate, self.OnFunctionUnlockUpdate) end function UIPushInterfaceAttention:OnBackButtonPressed() self:OnButtonClicked(self.btn_Close) end function UIPushInterfaceAttention:OnButtonClicked(comp) if self.btn_Close == comp then self:ClosePushAttention() elseif comp == self.btn_Go then local state = MDL.Attention.GetAttentionState(CTL.Welfare.WelfareType.AttentionReward) if state == MDL.Attention.AttentionState.CanReceive then MDL.Attention.PushInterfaceOptReq(CTL.Welfare.WelfareType.AttentionReward, MDL.Attention.OptType.Receive) self:ClosePushAttention() else SDKUtil.OpenPlatWebUrl(self.accountLink, nil) MDL.Attention.PushInterfaceOptReq(CTL.Welfare.WelfareType.AttentionReward, MDL.Attention.OptType.SetReceive) end else UIAttention.OnButtonClicked(self, comp) end end -------------------------- function UIPushInterfaceAttention:ClosePushAttention() CTL.PushInterface.HidePushInterface(self.__viewClassPath) self:CloseView() end function UIPushInterfaceAttention:OnFunctionUnlockUpdate(funcId, isUnlock) if funcId == MDL.Unlock.FunctionType.Attention and not isUnlock then self:ClosePushAttention() end end return UIPushInterfaceAttention