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