审核模式增加mall_treasure表

This commit is contained in:
CloudJ 2023-05-30 10:38:07 +08:00
parent d280b4ef3d
commit b64ea50f65
4 changed files with 256 additions and 31 deletions

View File

@ -11,6 +11,9 @@ function ConfigManager:_getConfig(configName)
end
function ConfigManager:getConfig(configName)
if CS.BF.BFMain.IsShenhe and configName == "mall_treasure" then
return self:getMallTreasureConfig().data
end
local config = self.configs[configName]
if config == nil then
config = self:_getConfig(configName)
@ -121,4 +124,222 @@ function ConfigManager:clearConfigCache(configName)
package.loaded[CONFIG_PATH .. configName] = nil
end
function ConfigManager:getMallTreasureConfig()
local mallTreasure = {
[1]={
["recharge_id"]=1,
["reward"]={
{
["type"]=1,
["id"]=2,
["num"]=30
}
},
["limit"]=1
},
[2]={
["recharge_id"]=2,
["reward"]={
{
["type"]=1,
["id"]=2,
["num"]=60
}
},
["limit"]=1
},
[3]={
["recharge_id"]=3,
["reward"]={
{
["type"]=1,
["id"]=2,
["num"]=90
}
},
["limit"]=2
},
[4]={
["recharge_id"]=4,
["reward"]={
{
["type"]=1,
["id"]=2,
["num"]=120
}
},
["limit"]=2
},
[5]={
["recharge_id"]=5,
["reward"]={
{
["type"]=1,
["id"]=2,
["num"]=150
}
},
["limit"]=2
},
[6]={
["recharge_id"]=6,
["reward"]={
{
["type"]=1,
["id"]=2,
["num"]=180
}
},
["limit"]=3
},
[7]={
["recharge_id"]=7,
["reward"]={
{
["type"]=1,
["id"]=2,
["num"]=210
}
},
["limit"]=3
},
[8]={
["recharge_id"]=8,
["reward"]={
{
["type"]=1,
["id"]=2,
["num"]=240
}
},
["limit"]=3
},
[9]={
["recharge_id"]=9,
["reward"]={
{
["type"]=1,
["id"]=2,
["num"]=270
}
},
["limit"]=3
},
[10]={
["recharge_id"]=10,
["reward"]={
{
["type"]=1,
["id"]=2,
["num"]=300
}
},
["limit"]=3
},
[11]={
["recharge_id"]=11,
["reward"]={
{
["type"]=1,
["id"]=2,
["num"]=360
}
},
["limit"]=3
},
[12]={
["recharge_id"]=12,
["reward"]={
{
["type"]=1,
["id"]=2,
["num"]=450
}
},
["limit"]=3
},
[13]={
["recharge_id"]=13,
["reward"]={
{
["type"]=1,
["id"]=2,
["num"]=600
}
},
["limit"]=3
},
[14]={
["recharge_id"]=14,
["reward"]={
{
["type"]=1,
["id"]=2,
["num"]=750
}
},
["limit"]=3
},
[15]={
["recharge_id"]=15,
["reward"]={
{
["type"]=1,
["id"]=2,
["num"]=900
}
},
["limit"]=3
},
[16]={
["recharge_id"]=16,
["reward"]={
{
["type"]=1,
["id"]=2,
["num"]=1500
}
},
["limit"]=3
},
[17]={
["recharge_id"]=17,
["reward"]={
{
["type"]=1,
["id"]=2,
["num"]=2100
}
},
["limit"]=3
},
[18]={
["recharge_id"]=18,
["reward"]={
{
["type"]=1,
["id"]=2,
["num"]=3000
}
},
["limit"]=3
},
[19]={
["recharge_id"]=19,
["reward"]={
{
["type"]=1,
["id"]=2,
["num"]=6000
}
},
["limit"]=3
}
}
local config = {
data=mallTreasure,count=12
}
return config
end
return ConfigManager

View File

@ -839,26 +839,22 @@ function MainCityUI:checkTutorial()
end
end
-- 检查礼包
-- 检查礼包(首充/章节/新手/助力/成长/金币顺序)
function MainCityUI:checkGift()
-- 引导其间不处理
if DataManager.TutorialData:getIsHaveTutorial() then
return
end
-- 章节礼包
local popUpGift = DataManager.ShopData:getPopUpGiftByType(PayManager.PURCHARSE_TYPE.CHAPTER_GIFT)
if popUpGift and #popUpGift > 0 then
ModuleManager.ShopManager:triggerGiftPopUI(PayManager.PURCHARSE_TYPE.CHAPTER_GIFT, popUpGift[1])
return true
end
local chapterPopUpGifts = DataManager.ShopData:getPopUpGiftByType(PayManager.PURCHARSE_TYPE.CHAPTER_GIFT)
-- 通用礼包
local popUpGift = DataManager.ShopData:getPopUpGiftByType(PayManager.PURCHARSE_TYPE.ACT_GIFT)
if popUpGift and #popUpGift > 0 then
local beginnerGiftIds = {}
local levelUpGiftIds = {}
local firstRechargeIds = {}
local actPopUpGifts = DataManager.ShopData:getPopUpGiftByType(PayManager.PURCHARSE_TYPE.ACT_GIFT)
if actPopUpGifts and #actPopUpGifts > 0 then
-- 先遍历找出符合弹出的类型
local beginnerGiftIds = {}
local levelUpGiftIds = {}
local firstRechargeIds = {}
for _, actId in ipairs(popUpGift) do
for _, actId in ipairs(actPopUpGifts) do
local cfgInfo = DataManager.ShopData:getActGiftConfig()[actId]
if cfgInfo then
-- 新手礼包
@ -875,26 +871,33 @@ function MainCityUI:checkGift()
end
end
end
-- 首充礼包
if #firstRechargeIds then
ModuleManager.ShopManager:triggerGiftPopUI(PayManager.PURCHARSE_TYPE.ACT_GIFT, firstRechargeIds[1])
return true
end
-- 新手礼包
if #beginnerGiftIds > 0 then
ModuleManager.ShopManager:triggerGiftPopUI(PayManager.PURCHARSE_TYPE.ACT_GIFT, beginnerGiftIds[1])
return true
end
-- 助力礼包
if #levelUpGiftIds then
ModuleManager.ShopManager:triggerGiftPopUI(PayManager.PURCHARSE_TYPE.ACT_GIFT, levelUpGiftIds[1])
return true
end
end
-- 特殊的 成长礼包
local popUpGift = DataManager.ShopData:getPopUpGiftByType(PayManager.PURCHARSE_TYPE.GROW_UP_GIFT)
if popUpGift and #popUpGift > 0 then
ModuleManager.ShopManager:triggerGiftPopUI(PayManager.PURCHARSE_TYPE.GROW_UP_GIFT, popUpGift[1])
local growUpPopUpGifts = DataManager.ShopData:getPopUpGiftByType(PayManager.PURCHARSE_TYPE.GROW_UP_GIFT)
-- 按顺序弹出(首充/章节/新手/助力/成长/金币顺序)
-- 首充礼包
if #firstRechargeIds then
ModuleManager.ShopManager:triggerGiftPopUI(PayManager.PURCHARSE_TYPE.ACT_GIFT, firstRechargeIds[1])
return true
end
-- 章节礼包
if chapterPopUpGifts and #chapterPopUpGifts > 0 then
ModuleManager.ShopManager:triggerGiftPopUI(PayManager.PURCHARSE_TYPE.CHAPTER_GIFT, chapterPopUpGifts[1])
return true
end
-- 新手礼包
if #beginnerGiftIds > 0 then
ModuleManager.ShopManager:triggerGiftPopUI(PayManager.PURCHARSE_TYPE.ACT_GIFT, beginnerGiftIds[1])
return true
end
-- 助力礼包
if #levelUpGiftIds then
ModuleManager.ShopManager:triggerGiftPopUI(PayManager.PURCHARSE_TYPE.ACT_GIFT, levelUpGiftIds[1])
return true
end
-- 成长礼包
if growUpPopUpGifts and #growUpPopUpGifts > 0 then
ModuleManager.ShopManager:triggerGiftPopUI(PayManager.PURCHARSE_TYPE.GROW_UP_GIFT, growUpPopUpGifts[1])
return true
end
end

View File

@ -33,7 +33,7 @@ function FirstRechargePopUI:onLoadRootComplete()
end
self.descText = self.uiMap["first_recharge_pop_ui.bg.desc_text"]
self.titleTx:setText(I18N:getGlobalText(I18N.GlobalConst.SHOP_DESC_35)) -- 充值购买任意商品,即可获得如下奖励,仅此一次!
self.descText:setText(I18N:getGlobalText(I18N.GlobalConst.SHOP_DESC_35)) -- 充值购买任意商品,即可获得如下奖励,仅此一次!
self.funcBtn = self.uiMap["first_recharge_pop_ui.bg.func_btn"]
self.btnJumpText = self.uiMap["first_recharge_pop_ui.bg.func_btn.jump_text"]

View File

@ -119,6 +119,7 @@ function ShopData:markPopUpGift(actType, actId)
self.needPopUpGift[actType] = {}
end
table.insert(self.needPopUpGift[actType], actId)
table.sort(self.needPopUpGift[actType])
end
function ShopData:removePopUpGift(actType, actId)