设置界面里的邮箱加一个开启限制

This commit is contained in:
chenxi 2023-05-30 18:17:51 +08:00
parent 40fef6069a
commit 284f7ce3c7
6 changed files with 34 additions and 16 deletions

View File

@ -65,6 +65,7 @@ ModuleManager.MODULE_KEY = {
DAILY_CHALLENGE = "daily_challenge", -- 每日挑战
FUND = "act_level_gift", -- 成长基金
ACT_GIFT_SHOW_OPEN = "act_gift_show_open", -- 弹窗礼包通用开启条件
MAIL = "mail_open", -- 邮件
}
local _moduleMgrs = {}

View File

@ -190,7 +190,7 @@ local const = {
["value"]=7
},
["model_daily_challenge"]={
["value"]=8000
["value"]=6000
},
["level_fund_hero_1"]={
["value"]=24001

View File

@ -54,9 +54,13 @@ local func_open = {
["new_player_gift"]={
["stage"]=2,
["pop_ups"]=1
},
["mail_open"]={
["stage"]=2,
["pop_ups"]=1
}
}
local config = {
data=func_open,count=14
data=func_open,count=15
}
return config

View File

@ -1,5 +1,8 @@
local SelectOtherBtnUI = class("SelectOtherBtnUI", BaseUI)
local BTN_OFFSET = 32
local BTN_INTERVAL = 16
function SelectOtherBtnUI:ctor()
end
@ -21,24 +24,37 @@ function SelectOtherBtnUI:onLoadRootComplete()
ModuleManager.MailManager:showMailUI()
end)
local redPoint, isAdRedPoint = DataManager.MailData:getRedPoint()
if redPoint then
if isAdRedPoint then
self.uiMap["select_other_btn_ui.bg.mail_btn"]:addRedPoint(124, 35, 1, "common_ad_3", nil, true)
local cellHeight = self.uiMap["select_other_btn_ui.bg.setting_btn"]:getRectHeight()
local cellCount = 0
local y = -BTN_OFFSET
if DataManager.MailData:getIsOpen() then
cellCount = cellCount + 1
self.uiMap["select_other_btn_ui.bg.mail_btn"]:setVisible(true)
self.uiMap["select_other_btn_ui.bg.mail_btn"]:setAnchoredPositionY(y)
y = y - BTN_INTERVAL - cellHeight
local redPoint, isAdRedPoint = DataManager.MailData:getRedPoint()
if redPoint then
if isAdRedPoint then
self.uiMap["select_other_btn_ui.bg.mail_btn"]:addRedPoint(124, 35, 1, "common_ad_3", nil, true)
else
self.uiMap["select_other_btn_ui.bg.mail_btn"]:addRedPoint(124, 35, 0.8)
end
else
self.uiMap["select_other_btn_ui.bg.mail_btn"]:addRedPoint(124, 35, 0.8)
self.uiMap["select_other_btn_ui.bg.mail_btn"]:removeRedPoint()
end
self.uiMap["select_other_btn_ui.bg.mail_btn.text"]:setText(I18N:getGlobalText(I18N.GlobalConst.MAIL_NAME))
else
self.uiMap["select_other_btn_ui.bg.mail_btn"]:removeRedPoint()
self.uiMap["select_other_btn_ui.bg.mail_btn"]:setVisible(false)
end
self.uiMap["select_other_btn_ui.bg.mail_btn.text"]:setText(I18N:getGlobalText(I18N.GlobalConst.MAIL_NAME))
cellCount = cellCount + 1
self.uiMap["select_other_btn_ui.bg.setting_btn"]:setAnchoredPositionY(y)
self.uiMap["select_other_btn_ui.bg.setting_btn"]:addClickListener(function()
self:closeUI()
ModuleManager.GameSettingManager:showSettingUI()
end)
self.uiMap["select_other_btn_ui.bg.setting_btn.text"]:setText(I18N:getGlobalText(I18N.GlobalConst.SETTING_DESC))
self.uiMap["select_other_btn_ui.bg"]:setSizeDeltaY(cellCount*cellHeight + (cellCount - 1)*BTN_INTERVAL + BTN_OFFSET*2)
end
return SelectOtherBtnUI

View File

@ -787,7 +787,7 @@ function MainCityUI:refreshBottomRp()
end
function MainCityUI:refreshSettingBtn()
if DataManager.MailData:getRedPoint() then
if DataManager.MailData:getIsOpen() and DataManager.MailData:getRedPoint() then
self.settingbtn:addRedPoint(40, 40, 0.7)
else
self.settingbtn:removeRedPoint()

View File

@ -247,10 +247,7 @@ function MailData:setLastMailId()
end
function MailData:getIsOpen()
if not self.mailIsOpen then
self.mailIsOpen = ModuleManager:getIsOpen(ModuleManager.MODULE_KEY.MAIL_OPEN, true)
end
return self.mailIsOpen
return ModuleManager:getIsOpen(ModuleManager.MODULE_KEY.MAIL, true)
end
return MailData