diff --git a/lua/app/common/event_manager.lua b/lua/app/common/event_manager.lua
index d03ded0a..5f4fd13f 100644
--- a/lua/app/common/event_manager.lua
+++ b/lua/app/common/event_manager.lua
@@ -27,6 +27,7 @@ EventManager.CUSTOM_EVENT = {
BOSS_ENTER_ANI_OVER = "BOSS_ENTER_ANI_OVER",
TIME_TRIGGERED_NEW_EMAIL = "TIME_TRIGGERED_NEW_EMAIL", -- 邮件到时间请求是否有新邮件
SKILL_REFRESH_SUCC = "SKILL_REFRESH_SUCC",
+ GO_SHOP = "GO_SHOP", -- 跳转商店
-- BORAD_TOUCH_BEGIN = "BORAD_TOUCH_BEGIN",
-- BORAD_TOUCH_OVER = "BORAD_TOUCH_OVER"
}
diff --git a/lua/app/module/maincity/maincity_const.lua b/lua/app/module/maincity/maincity_const.lua
index a8fa62c0..23ba40e6 100644
--- a/lua/app/module/maincity/maincity_const.lua
+++ b/lua/app/module/maincity/maincity_const.lua
@@ -25,6 +25,7 @@ MainCityConst.LEFT_SIDE_BARS = {
MainCityConst.RIGHT_SIDE_BARS = {
"app/ui/main_city/cell/side_bar_gold_pig_cell",
"app/ui/main_city/cell/side_bar_growth_fund_cell",
+ "app/ui/main_city/cell/side_bar_first_recharge_cell",
"app/ui/main_city/cell/side_bar_beginner_gift_cell",
"app/ui/main_city/cell/side_bar_grow_up_gift_1_cell",
"app/ui/main_city/cell/side_bar_grow_up_gift_2_cell",
diff --git a/lua/app/module/shop/shop_const.lua b/lua/app/module/shop/shop_const.lua
index 02eee668..94e2b4ed 100644
--- a/lua/app/module/shop/shop_const.lua
+++ b/lua/app/module/shop/shop_const.lua
@@ -1,5 +1,6 @@
local ShopConst = {}
+ShopConst.FIRST_RECHARGE_ID = 10102 -- 首充礼包ID
ShopConst.BEGINNER_GIFT_ID = 40102 -- 新手礼包ID
ShopConst.MAIN_UI_POP_TYPE = { -- 当触发弹窗时,相关联的类型礼包也要触发
[PayManager.PURCHARSE_TYPE.ACT_GIFT] = {
diff --git a/lua/app/ui/main_city/cell/side_bar_beginner_gift_cell.lua b/lua/app/ui/main_city/cell/side_bar_beginner_gift_cell.lua
index c1dd3bd1..26ab3ff1 100644
--- a/lua/app/ui/main_city/cell/side_bar_beginner_gift_cell.lua
+++ b/lua/app/ui/main_city/cell/side_bar_beginner_gift_cell.lua
@@ -6,7 +6,7 @@ function SideBarBeginnerGiftCell:getIsOpen()
end
function SideBarBeginnerGiftCell:getIconRes()
- return "main_btn_gift_1" -- TODOJ
+ return "main_btn_gift_1"
end
function SideBarBeginnerGiftCell:onClick()
diff --git a/lua/app/ui/main_city/cell/side_bar_first_recharge_cell.lua b/lua/app/ui/main_city/cell/side_bar_first_recharge_cell.lua
new file mode 100644
index 00000000..30233d01
--- /dev/null
+++ b/lua/app/ui/main_city/cell/side_bar_first_recharge_cell.lua
@@ -0,0 +1,20 @@
+local SideBarBaseCellComp = require "app/ui/main_city/cell/side_bar_base_cell"
+local SideBarFirstRechargeCell = class("SideBarFirstRechargeCell", SideBarBaseCellComp)
+
+function SideBarFirstRechargeCell:getIsOpen()
+ return DataManager.ShopData:getShowFirstRechargeSideBar()
+end
+
+function SideBarFirstRechargeCell:getIconRes()
+ return "main_btn_gift_3"
+end
+
+function SideBarFirstRechargeCell:onClick()
+ ModuleManager.ShopManager:showGiftPopUI(PayManager.PURCHARSE_TYPE.ACT_GIFT, GConst.ShopConst.FIRST_RECHARGE_ID)
+end
+
+function SideBarFirstRechargeCell:getIsShowRedPoint()
+ return false
+end
+
+return SideBarFirstRechargeCell
\ No newline at end of file
diff --git a/lua/app/ui/main_city/cell/side_bar_first_recharge_cell.lua.meta b/lua/app/ui/main_city/cell/side_bar_first_recharge_cell.lua.meta
new file mode 100644
index 00000000..09f7fa0a
--- /dev/null
+++ b/lua/app/ui/main_city/cell/side_bar_first_recharge_cell.lua.meta
@@ -0,0 +1,10 @@
+fileFormatVersion: 2
+guid: 19280ea11e6e84d4a8e2c067c3127203
+ScriptedImporter:
+ internalIDToNameTable: []
+ externalObjects: {}
+ serializedVersion: 2
+ userData:
+ assetBundleName:
+ assetBundleVariant:
+ script: {fileID: 11500000, guid: 3b8b241bab4a4ac9a22fcce9c64f1242, type: 3}
diff --git a/lua/app/ui/main_city/cell/side_bar_grow_up_gift_1_cell.lua b/lua/app/ui/main_city/cell/side_bar_grow_up_gift_1_cell.lua
index 4e33bd44..f0e1a329 100644
--- a/lua/app/ui/main_city/cell/side_bar_grow_up_gift_1_cell.lua
+++ b/lua/app/ui/main_city/cell/side_bar_grow_up_gift_1_cell.lua
@@ -6,7 +6,7 @@ function SideBarGrowUpGift1Cell:getIsOpen()
end
function SideBarGrowUpGift1Cell:getIconRes()
- return "main_btn_gift_2" -- TODOJ
+ return "main_btn_gift_2"
end
function SideBarGrowUpGift1Cell:onClick()
diff --git a/lua/app/ui/main_city/cell/side_bar_grow_up_gift_2_cell.lua b/lua/app/ui/main_city/cell/side_bar_grow_up_gift_2_cell.lua
index 5e4dcd1a..e0edbbcb 100644
--- a/lua/app/ui/main_city/cell/side_bar_grow_up_gift_2_cell.lua
+++ b/lua/app/ui/main_city/cell/side_bar_grow_up_gift_2_cell.lua
@@ -6,7 +6,7 @@ function SideBarGrowUpGift2Cell:getIsOpen()
end
function SideBarGrowUpGift2Cell:getIconRes()
- return "main_btn_gift_2" -- TODOJ
+ return "main_btn_gift_2"
end
function SideBarGrowUpGift2Cell:onClick()
diff --git a/lua/app/ui/main_city/main_city_ui.lua b/lua/app/ui/main_city/main_city_ui.lua
index a5e20f6c..93d022a8 100644
--- a/lua/app/ui/main_city/main_city_ui.lua
+++ b/lua/app/ui/main_city/main_city_ui.lua
@@ -130,6 +130,18 @@ function MainCityUI:_addListeners()
-- 引导完成时 检测主界面的弹窗是否要触发
self:checkGift()
end)
+ self:addEventListener(EventManager.CUSTOM_EVENT.GO_SHOP, function(params)
+ if ModuleManager:getIsOpen(ModuleManager.MODULE_KEY.MALL, false) then
+ if self.selectedIndex == MainCityUI.CLICK_BTN_TYPE[3] then
+ return
+ end
+ BIReport:postHomeBtnCilck(BIReport.CLICK_BTN_TYPE[MainCityUI.CLICK_BTN_TYPE[3]])
+ self.bottomBtnSpines[3]:playAnimComplete("born", false, false, function()
+ self.bottomBtnSpines[3]:playAnim("idle", false, false)
+ end)
+ self:refreshBottom(3, true)
+ end
+ end)
DataManager.MailData:checkNewMail()
end
@@ -206,6 +218,11 @@ function MainCityUI:initBottomUI()
for i = 1, 3 do
local cellCom = CellManager:addCellComp(uiMap["main_ui.bottom_node.bottom_btn_cell_" .. i], BOTTOM_BTN_CELL)
cellCom:addClickListener(function()
+ if i == 3 then -- 商城有开启条件
+ if not ModuleManager:getIsOpen(ModuleManager.MODULE_KEY.MALL, false) then
+ return
+ end
+ end
if self.selectedIndex == i then
return
end
@@ -833,6 +850,7 @@ function MainCityUI:checkGift()
-- 先遍历找出符合弹出的类型
local beginnerGiftIds = {}
local levelUpGiftIds = {}
+ local firstRechargeIds = {}
for _, actId in ipairs(popUpGift) do
local cfgInfo = DataManager.ShopData:getActGiftConfig()[actId]
if cfgInfo then
@@ -844,8 +862,17 @@ function MainCityUI:checkGift()
if cfgInfo.type == PayManager.PURCHARSE_ACT_TYPE.LEVEL_UP_GIFT then
table.insert(levelUpGiftIds, actId)
end
+ -- 首充礼包
+ if cfgInfo.type == PayManager.PURCHARSE_ACT_TYPE.FIRST_RECHARGE then
+ table.insert(firstRechargeIds, actId)
+ 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])
@@ -856,8 +883,6 @@ function MainCityUI:checkGift()
ModuleManager.ShopManager:triggerGiftPopUI(PayManager.PURCHARSE_TYPE.ACT_GIFT, levelUpGiftIds[1])
return true
end
-
- return true
end
-- 特殊的 成长礼包
local popUpGift = DataManager.ShopData:getPopUpGiftByType(PayManager.PURCHARSE_TYPE.GROW_UP_GIFT)
diff --git a/lua/app/ui/shop/box_hero_ui.lua b/lua/app/ui/shop/box_hero_ui.lua
index 5e12fde3..b001c724 100644
--- a/lua/app/ui/shop/box_hero_ui.lua
+++ b/lua/app/ui/shop/box_hero_ui.lua
@@ -1,12 +1,12 @@
local BoxHeroUI = class("BoxHeroUI", BaseUI)
local TITLE_TEXT = {
- [GConst.SummonConst.SUMMON_TYPE.LV_1] = "普通宝箱TD", -- TODOJ
- [GConst.SummonConst.SUMMON_TYPE.LV_2] = "精致宝箱TD",
- [GConst.SummonConst.SUMMON_TYPE.LV_3] = "珍贵宝箱TD"
+ [GConst.SummonConst.SUMMON_TYPE.LV_1] = I18N:getGlobalText(I18N.GlobalConst.SHOP_DESC_1), -- 普通宝箱
+ [GConst.SummonConst.SUMMON_TYPE.LV_2] = I18N:getGlobalText(I18N.GlobalConst.SHOP_DESC_2), -- 精致宝箱
+ [GConst.SummonConst.SUMMON_TYPE.LV_3] = I18N:getGlobalText(I18N.GlobalConst.SHOP_DESC_3), -- 珍贵宝箱
}
local ICON_NAME = {
- [GConst.SummonConst.SUMMON_TYPE.LV_1] = "shop_chest_1", -- TODOJ
+ [GConst.SummonConst.SUMMON_TYPE.LV_1] = "shop_chest_1",
[GConst.SummonConst.SUMMON_TYPE.LV_2] = "shop_chest_2",
[GConst.SummonConst.SUMMON_TYPE.LV_3] = "shop_chest_3"
}
diff --git a/lua/app/ui/shop/box_level_ui.lua b/lua/app/ui/shop/box_level_ui.lua
index 5d202806..0112b1d7 100644
--- a/lua/app/ui/shop/box_level_ui.lua
+++ b/lua/app/ui/shop/box_level_ui.lua
@@ -36,7 +36,7 @@ function BoxLevelUI:onLoadRootComplete()
self.box1Add2ItemCell = CellManager:addCellComp(self.uiMap["box_level_ui.bg.box_1.add_node_2.item_cell"], GConst.TYPEOF_LUA_CLASS.ITEM_CELL)
self.box1Add2Text = self.uiMap["box_level_ui.bg.box_1.add_node_2.text"]
self.box1Desc = self.uiMap["box_level_ui.bg.box_1.none_text"]
- self.box1Desc:setText("无额外奖励加成TD") -- TODOJ
+ self.box1Desc:setText(I18N:getGlobalText(I18N.GlobalConst.SHOP_DESC_4)) -- 无额外奖励加成
self.box2Node = self.uiMap["box_level_ui.bg.box_2"]
self.box2Add1Node = self.uiMap["box_level_ui.bg.box_2.add_node_1"]
@@ -46,7 +46,7 @@ function BoxLevelUI:onLoadRootComplete()
self.box2Add2ItemCell = CellManager:addCellComp(self.uiMap["box_level_ui.bg.box_2.add_node_2.item_cell"], GConst.TYPEOF_LUA_CLASS.ITEM_CELL)
self.box2Add2Text = self.uiMap["box_level_ui.bg.box_2.add_node_2.text"]
self.box2Desc = self.uiMap["box_level_ui.bg.box_2.none_text"]
- self.box2Desc:setText("无额外奖励加成TD") -- TODOJ
+ self.box2Desc:setText(I18N:getGlobalText(I18N.GlobalConst.SHOP_DESC_4)) -- 无额外奖励加成
self.box3Node = self.uiMap["box_level_ui.bg.box_3"]
self.box3Add1Node = self.uiMap["box_level_ui.bg.box_3.add_node_1"]
@@ -56,10 +56,10 @@ function BoxLevelUI:onLoadRootComplete()
self.box3Add2ItemCell = CellManager:addCellComp(self.uiMap["box_level_ui.bg.box_3.add_node_2.item_cell"], GConst.TYPEOF_LUA_CLASS.ITEM_CELL)
self.box3Add2Text = self.uiMap["box_level_ui.bg.box_3.add_node_2.text"]
self.box3Desc = self.uiMap["box_level_ui.bg.box_3.none_text"]
- self.box3Desc:setText("无额外奖励加成TD") -- TODOJ
+ self.box3Desc:setText(I18N:getGlobalText(I18N.GlobalConst.SHOP_DESC_4)) -- 无额外奖励加成
self.bottomDesc = self.uiMap["box_level_ui.bg.title"]
- self.bottomDesc:setText("开宝箱提升等级,增加宝箱奖励TD") -- TODOJ
+ self.bottomDesc:setText(I18N:getGlobalText(I18N.GlobalConst.SHOP_DESC_5)) -- 开宝箱提升等级,增加宝箱奖励
self.leftArrow:addClickListener(function()
self.level = self.level - 1
diff --git a/lua/app/ui/shop/box_level_up_ui.lua b/lua/app/ui/shop/box_level_up_ui.lua
index 033a0420..25fae603 100644
--- a/lua/app/ui/shop/box_level_up_ui.lua
+++ b/lua/app/ui/shop/box_level_up_ui.lua
@@ -30,7 +30,7 @@ function BoxLevelUpUI:onLoadRootComplete()
self.box1Add2ItemCell = CellManager:addCellComp(self.uiMap["box_level_up_ui.box_1.add_node_2.item_cell"], GConst.TYPEOF_LUA_CLASS.ITEM_CELL)
self.box1Add2Text = self.uiMap["box_level_up_ui.box_1.add_node_2.text"]
self.box1Desc = self.uiMap["box_level_up_ui.box_1.none_text"]
- self.box1Desc:setText("无额外奖励加成TD") -- TODOJ
+ self.box1Desc:setText(I18N:getGlobalText(I18N.GlobalConst.SHOP_DESC_4)) -- 无额外奖励加成
self.box2Node = self.uiMap["box_level_up_ui.box_2"]
self.box2Add1Node = self.uiMap["box_level_up_ui.box_2.add_node_1"]
@@ -40,7 +40,7 @@ function BoxLevelUpUI:onLoadRootComplete()
self.box2Add2ItemCell = CellManager:addCellComp(self.uiMap["box_level_up_ui.box_2.add_node_2.item_cell"], GConst.TYPEOF_LUA_CLASS.ITEM_CELL)
self.box2Add2Text = self.uiMap["box_level_up_ui.box_2.add_node_2.text"]
self.box2Desc = self.uiMap["box_level_up_ui.box_2.none_text"]
- self.box2Desc:setText("无额外奖励加成TD") -- TODOJ
+ self.box2Desc:setText(I18N:getGlobalText(I18N.GlobalConst.SHOP_DESC_4)) -- 无额外奖励加成
self.box3Node = self.uiMap["box_level_up_ui.box_3"]
self.box3Add1Node = self.uiMap["box_level_up_ui.box_3.add_node_1"]
@@ -50,7 +50,7 @@ function BoxLevelUpUI:onLoadRootComplete()
self.box3Add2ItemCell = CellManager:addCellComp(self.uiMap["box_level_up_ui.box_3.add_node_2.item_cell"], GConst.TYPEOF_LUA_CLASS.ITEM_CELL)
self.box3Add2Text = self.uiMap["box_level_up_ui.box_3.add_node_2.text"]
self.box3Desc = self.uiMap["box_level_up_ui.box_3.none_text"]
- self.box3Desc:setText("无额外奖励加成TD") -- TODOJ
+ self.box3Desc:setText(I18N:getGlobalText(I18N.GlobalConst.SHOP_DESC_4)) -- 无额外奖励加成
self.closeTx = self.uiMap["box_level_up_ui.close_tx"]
@@ -58,9 +58,9 @@ function BoxLevelUpUI:onLoadRootComplete()
end
function BoxLevelUpUI:refresh()
- self.titleTx:setText("宝箱等级提升!TD") -- TODOJ
+ self.titleTx:setText(I18N:getGlobalText(I18N.GlobalConst.SHOP_DESC_6)) -- 宝箱等级提升!
self.lvTx:setText("Lv." .. tostring(self.level))
- self.closeTx:setText("点击继续TD") -- TODOJ
+ self.closeTx:setText(I18N:getGlobalText(I18N.GlobalConst.CLICK_TO_CONTINUE)) -- 点击继续
self.box1Add1Node:setVisible(false)
self.box1Add2Node:setVisible(false)
diff --git a/lua/app/ui/shop/box_open_ui.lua b/lua/app/ui/shop/box_open_ui.lua
index c091b969..e6cf95ef 100644
--- a/lua/app/ui/shop/box_open_ui.lua
+++ b/lua/app/ui/shop/box_open_ui.lua
@@ -1,7 +1,7 @@
local BoxOpenUI = class("BoxOpenUI", BaseUI)
local ICON_NAME = {
- [GConst.SummonConst.SUMMON_TYPE.LV_1] = "shop_chest_1", -- TODOJ
+ [GConst.SummonConst.SUMMON_TYPE.LV_1] = "shop_chest_1",
[GConst.SummonConst.SUMMON_TYPE.LV_2] = "shop_chest_2",
[GConst.SummonConst.SUMMON_TYPE.LV_3] = "shop_chest_3"
}
@@ -28,7 +28,7 @@ function BoxOpenUI:onLoadRootComplete()
self.btnText = self.uiMap["box_open_ui.open_btn.text"]
self.boxImg:setSprite(GConst.ATLAS_PATH.SHOP, ICON_NAME[self.summonType])
- self.btnText:setText("立即打开") -- TODOJ
+ self.btnText:setText(I18N:getGlobalText(I18N.GlobalConst.SHOP_DESC_7)) -- 立即打开
self.openBtn:addClickListener(function()
ModuleManager.ShopManager:showBoxRewardUI(self.params)
diff --git a/lua/app/ui/shop/box_reward_ui.lua b/lua/app/ui/shop/box_reward_ui.lua
index df9fa8be..222e0523 100644
--- a/lua/app/ui/shop/box_reward_ui.lua
+++ b/lua/app/ui/shop/box_reward_ui.lua
@@ -35,7 +35,7 @@ function BoxRewardUI:onLoadRootComplete()
self.uiMap = self.root:genAllChildren()
self.titleTx = self.uiMap["box_reward_ui.title.text"]
- self.titleTx:setText("恭喜获得TD") -- TODOJ
+ self.titleTx:setText(I18N:getGlobalText(I18N.GlobalConst.SHOP_DESC_8)) -- 恭喜获得
self.scrollRectObj = self.uiMap["box_reward_ui.scroll_rect"]
self.scrollRect = self.scrollRectObj:addLuaComponent(GConst.TYPEOF_LUA_CLASS.SCROLL_RECT_BASE)
@@ -60,7 +60,7 @@ function BoxRewardUI:onLoadRootComplete()
end
self.closeTx = self.uiMap["box_reward_ui.close_tx"]
- self.closeTx:setText("点击关闭TD") -- TODOJ
+ self.closeTx:setText(I18N:getGlobalText(I18N.GlobalConst.CLICK_CLOSE_DESC))
self.mask = self.uiMap["box_reward_ui.mask"]
self.mask:addClickListener(function()
diff --git a/lua/app/ui/shop/cell/beginner_sell_cell.lua b/lua/app/ui/shop/cell/beginner_sell_cell.lua
index d0674590..10c20019 100644
--- a/lua/app/ui/shop/cell/beginner_sell_cell.lua
+++ b/lua/app/ui/shop/cell/beginner_sell_cell.lua
@@ -51,9 +51,9 @@ function BeginnerSellCell:refresh()
self.offImg:setVisible(false)
end
-- 限购
- self.limitText:setText("限购1次TD") -- 章节礼包默认限购1次 TODOJ
+ self.limitText:setText(I18N:getGlobalText(I18N.GlobalConst.SHOP_DESC_18, 1)) -- 限购1次
-- 标题
- self.titleText:setText("新手礼包TD") -- TODOJ
+ self.titleText:setText(I18N:getGlobalText(I18N.GlobalConst.SHOP_DESC_11)) -- 新手礼包
-- 奖励
local rewardList = cfgInfo.reward
local count = rewardList and #rewardList or 0
diff --git a/lua/app/ui/shop/cell/box_sell_cell.lua b/lua/app/ui/shop/cell/box_sell_cell.lua
index 46c1de02..2b1a4aaf 100644
--- a/lua/app/ui/shop/cell/box_sell_cell.lua
+++ b/lua/app/ui/shop/cell/box_sell_cell.lua
@@ -8,24 +8,24 @@ function BoxSellCell:init()
local uiMap = self.baseObject:genAllChildren()
self.bg = uiMap["box_sell_cell.bg"]
local boxNameTx1 = uiMap["box_sell_cell.bg.box_1.name_tx"]
- boxNameTx1:setText("临时文本:普通宝箱")
+ boxNameTx1:setText(I18N:getGlobalText(I18N.GlobalConst.SHOP_DESC_1)) -- 普通宝箱
local boxDescTx1 = uiMap["box_sell_cell.bg.box_1.desc_tx"]
- boxDescTx1:setText("临时文本:必出普通英雄")
+ boxDescTx1:setText(I18N:getGlobalText(I18N.GlobalConst.SHOP_DESC_24)) -- 必出普通英雄
self.boxBuyBtn1 = uiMap["box_sell_cell.bg.box_1.buy_btn"]
self.boxBuyBtnCoin1 = uiMap["box_sell_cell.bg.box_1.buy_btn.coin"]
self.boxBuyBtnTx1 = uiMap["box_sell_cell.bg.box_1.buy_btn.buy_tx"]
local boxNameTx2 = uiMap["box_sell_cell.bg.box_2.name_tx"]
- boxNameTx2:setText("临时文本:精致宝箱")
+ boxNameTx2:setText(I18N:getGlobalText(I18N.GlobalConst.SHOP_DESC_2)) -- 精致宝箱
local boxDescTx2 = uiMap["box_sell_cell.bg.box_2.desc_tx"]
- boxDescTx2:setText("临时文本:必出稀有英雄")
+ boxDescTx2:setText(I18N:getGlobalText(I18N.GlobalConst.SHOP_DESC_25)) -- 必出稀有英雄
self.boxBuyBtn2 = uiMap["box_sell_cell.bg.box_2.buy_btn"]
self.boxBuyBtnCoin2 = uiMap["box_sell_cell.bg.box_2.buy_btn.coin"]
self.boxBuyBtnTx2 = uiMap["box_sell_cell.bg.box_2.buy_btn.buy_tx"]
self.box3 = uiMap["box_sell_cell.bg.box_3"]
local boxNameTx3 = uiMap["box_sell_cell.bg.box_3.name_tx"]
- boxNameTx3:setText("临时文本:珍贵")
+ boxNameTx3:setText(I18N:getGlobalText(I18N.GlobalConst.SHOP_DESC_3)) -- 珍贵宝箱
local boxDescTx3 = uiMap["box_sell_cell.bg.box_3.desc_tx"]
- boxDescTx3:setText("临时文本:必出史诗英雄")
+ boxDescTx3:setText(I18N:getGlobalText(I18N.GlobalConst.SHOP_DESC_26)) -- 必出史诗英雄
self.boxBuyBtn3 = uiMap["box_sell_cell.bg.box_3.buy_btn"]
self.boxBuyBtnCoin3 = uiMap["box_sell_cell.bg.box_3.buy_btn.coin"]
self.boxBuyBtnTx3 = uiMap["box_sell_cell.bg.box_3.buy_btn.buy_tx"]
@@ -34,7 +34,7 @@ function BoxSellCell:init()
self.progressTx = uiMap["box_sell_cell.bg.progress_tx"]
self.helpBtn = uiMap["box_sell_cell.bg.help_btn"]
local titleTx = uiMap["box_sell_cell.title_bg.text"]
- titleTx:setText("临时文本:宝箱")
+ titleTx:setText(I18N:getGlobalText(I18N.GlobalConst.SHOP_DESC_27)) -- 宝箱
self.boxBuyBtn1:addClickListener(function()
self:onClickBox(GConst.SummonConst.SUMMON_TYPE.LV_1)
@@ -72,12 +72,12 @@ function BoxSellCell:refreshLv()
local lv = DataManager.SummonData:getSummonLevel()
local exp = DataManager.SummonData:getSummonExp()
local maxExp = DataManager.SummonData:getSummonMaxExp()
- self.progressLv:setText("Lv." .. tostring(lv)) -- TODOJ
+ self.progressLv:setText("Lv." .. tostring(lv))
if maxExp and maxExp > 0 then
- self.progressTx:setText(tostring(exp) .. "/" .. tostring(maxExp)) -- TODOJ
+ self.progressTx:setText(tostring(exp) .. "/" .. tostring(maxExp))
self.progressSlider.value = exp / maxExp
else
- self.progressTx:setText("MAX") -- TODOJ
+ self.progressTx:setText(I18N:getGlobalText(I18N.GlobalConst.STR_MAX))
self.progressSlider.value = 1
end
end
diff --git a/lua/app/ui/shop/cell/chapter_cell.lua b/lua/app/ui/shop/cell/chapter_cell.lua
index ceb58a85..3d7f187e 100644
--- a/lua/app/ui/shop/cell/chapter_cell.lua
+++ b/lua/app/ui/shop/cell/chapter_cell.lua
@@ -67,9 +67,9 @@ function ChapterCell:refresh(idx, cfgInfo, totalCount, arrowCallback)
-- 超值
self.offText:setText(tostring(cfgInfo.value * 100) .. "%")
-- 限购
- self.limitText:setText("限购1次TD") -- 章节礼包默认限购1次 TODOJ
+ self.limitText:setText(I18N:getGlobalText(I18N.GlobalConst.SHOP_DESC_18, 1)) -- 限购1次
-- 标题
- self.titleText:setText("第" .. tostring(cfgInfo.chapter) .. "章礼包TD") -- TODOJ
+ self.titleText:setText(I18N:getGlobalText(I18N.GlobalConst.SHOP_DESC_19, tostring(cfgInfo.chapter))) -- 第{0}章礼包
-- 奖励
local rewardList = cfgInfo.reward
local count = rewardList and #rewardList or 0
diff --git a/lua/app/ui/shop/cell/coin_sell_cell.lua b/lua/app/ui/shop/cell/coin_sell_cell.lua
index 914eb2be..5989b888 100644
--- a/lua/app/ui/shop/cell/coin_sell_cell.lua
+++ b/lua/app/ui/shop/cell/coin_sell_cell.lua
@@ -47,9 +47,9 @@ function CoinSellCell:refresh()
-- 超值
self.offText:setText(tostring(cfgInfo.value) .. "%")
-- 限购
- self.limitText:setText("限购" .. tostring(cfgInfo.limit) .. "次TD") -- TODOJ
+ self.limitText:setText(I18N:getGlobalText(I18N.GlobalConst.SHOP_DESC_18, tostring(cfgInfo.limit))) -- 限购{0}次
-- 标题
- self.titleText:setText("金币礼包TD") -- TODOJ
+ self.titleText:setText(I18N:getGlobalText(I18N.GlobalConst.SHOP_DESC_14))
-- 奖励
local rewardList = cfgInfo.reward
local count = rewardList and #rewardList or 0
diff --git a/lua/app/ui/shop/cell/gem_cell.lua b/lua/app/ui/shop/cell/gem_cell.lua
index 721e4cd2..bd43350f 100644
--- a/lua/app/ui/shop/cell/gem_cell.lua
+++ b/lua/app/ui/shop/cell/gem_cell.lua
@@ -17,7 +17,7 @@ function GemCell:init()
self.adText = uiMap["gem_cell.ad.desc"]
self.sellOutText = uiMap["gem_cell.sell_out"]
- self.sellOutText:setText("已购买TD") -- TODOJ
+ self.sellOutText:setText(I18N:getGlobalText(I18N.GlobalConst.SHOP_DESC_20))
end
function GemCell:refresh(id, cfgInfo)
@@ -39,7 +39,7 @@ function GemCell:refresh(id, cfgInfo)
GFunc.setAdsSprite(self.adImg)
local adLeftCount = adMaxTimes - bought
if adLeftCount > 0 then
- self.adText:setText("免费(" .. tostring(adLeftCount) .. ")TD") -- TODOJ
+ self.adText:setText(I18N:getGlobalText(I18N.GlobalConst.STR_FREE) .. "(" .. tostring(adLeftCount) .. ")") -- 免费(x)
GFunc.centerImgAndTx(self.adImg, self.adText, 5)
self.sellOutText:setVisible(false)
@@ -56,7 +56,7 @@ function GemCell:refresh(id, cfgInfo)
if hasDoubleTimes then -- 有双倍效果
self.doubleNode:setVisible(true)
- self.doubleDesc:setText("剩余次数:" .. tostring(leftDoubleTimes) .. "TD") -- TODOJ
+ self.doubleDesc:setText(I18N:getGlobalText(I18N.GlobalConst.SHOP_DESC_21, tostring(leftDoubleTimes))) -- 剩余次数:{0}
self.doubleText:setText("+" .. tostring(reward.num * 2))
GFunc.centerImgAndTx(self.doubleImg, self.doubleText, 5)
self.doubleOriginText:setText(reward.num)
diff --git a/lua/app/ui/shop/cell/gem_sell_cell.lua b/lua/app/ui/shop/cell/gem_sell_cell.lua
index 204a79ff..ce9930fc 100644
--- a/lua/app/ui/shop/cell/gem_sell_cell.lua
+++ b/lua/app/ui/shop/cell/gem_sell_cell.lua
@@ -3,13 +3,13 @@ local GemSellCell = class("GemSellCell", BaseCell)
function GemSellCell:init()
local uiMap = self.baseObject:genAllChildren()
local titleTx = uiMap["gem_sell_cell.title_bg.text"]
- titleTx:setText("临时文本:钻石")
+ titleTx:setText(ModuleManager.ItemManager:getItemName(GConst.ItemConst.ITEM_ID_GEM))
self.cells = {}
self.cellHeight = 0
local cellHeight = nil
- local cfg = ConfigManager:getConfig("mall_treasure")
- for i = 1, 19 do -- 正常9个 提审19个 暂未处理提审模式 -- TODOJ
+ local cfg = DataManager.ShopData:getMallTreasureConfig() -- 审核模式读取另一张表
+ for i = 1, 19 do -- 正常9个 提审19个
local cell = uiMap["gem_sell_cell.cell_" .. i]
if cellHeight == nil then
local w, h = cell:fastGetSizeDelta()
@@ -30,7 +30,7 @@ function GemSellCell:init()
end
function GemSellCell:refresh()
- local cfg = ConfigManager:getConfig("mall_treasure")
+ local cfg = DataManager.ShopData:getMallTreasureConfig()
for k, v in ipairs(self.cells) do
local id = k -- 目前配置表结构如此
v:refresh(id, cfg[id])
@@ -49,8 +49,4 @@ function GemSellCell:setVisible(visible)
self.baseObject:setVisible(visible)
end
-function GemSellCell:onClickGift(id)
- Logger.logHighlight("Click id:%s", id) -- TODOJ
-end
-
return GemSellCell
\ No newline at end of file
diff --git a/lua/app/ui/shop/cell/gold_cell.lua b/lua/app/ui/shop/cell/gold_cell.lua
index 995d99af..7825e5fe 100644
--- a/lua/app/ui/shop/cell/gold_cell.lua
+++ b/lua/app/ui/shop/cell/gold_cell.lua
@@ -14,7 +14,7 @@ function GoldCell:init()
self.descText = uiMap["gold_cell.desc"]
self.sellOutText = uiMap["gold_cell.sell_out"]
- self.sellOutText:setText("已购买TD") -- TODOJ
+ self.sellOutText:setText(I18N:getGlobalText(I18N.GlobalConst.SHOP_DESC_20)) -- 已购买
end
function GoldCell:refresh(id, cfgInfo)
@@ -33,7 +33,7 @@ function GoldCell:refresh(id, cfgInfo)
local bought = DataManager.ShopData:getCommonDailyCoinAdBuyCount() -- 金币礼包购买次数
local adLeftCount = adMaxTimes - bought
if adLeftCount > 0 then
- self.adText:setText("免费(" .. tostring(adLeftCount) .. ")TD") -- TODOJ
+ self.adText:setText(I18N:getGlobalText(I18N.GlobalConst.STR_FREE) .. "(" .. tostring(adLeftCount) .. ")") -- 免费(x)
GFunc.centerImgAndTx(self.adImg, self.adText, 5)
self.sellOutText:setVisible(false)
@@ -54,7 +54,7 @@ function GoldCell:refresh(id, cfgInfo)
end
self.nameText:setText(GFunc.num2Str(goldNum))
- self.descText:setText("金币礼包:" .. tostring(id) .. "TD") -- TODOJ
+ self.descText:setText(I18N:getGlobalText(I18N.GlobalConst.SHOP_DESC_14)) -- 金币礼包
self:addClickListener(function()
self:onClickGift(id, isFree)
diff --git a/lua/app/ui/shop/cell/gold_sell_cell.lua b/lua/app/ui/shop/cell/gold_sell_cell.lua
index d3a3904c..7cd52e9c 100644
--- a/lua/app/ui/shop/cell/gold_sell_cell.lua
+++ b/lua/app/ui/shop/cell/gold_sell_cell.lua
@@ -3,7 +3,7 @@ local GoldSellCell = class("GoldSellCell", BaseCell)
function GoldSellCell:init()
local uiMap = self.baseObject:genAllChildren()
local titleTx = uiMap["gold_sell_cell.title_bg.text"]
- titleTx:setText("临时文本:金币")
+ titleTx:setText(ModuleManager.ItemManager:getItemName(GConst.ItemConst.ITEM_ID_GOLD))
self.cells = {}
self.cellHeight = 0
diff --git a/lua/app/ui/shop/cell/grow_cell.lua b/lua/app/ui/shop/cell/grow_cell.lua
index 6abd2af5..63a8adbe 100644
--- a/lua/app/ui/shop/cell/grow_cell.lua
+++ b/lua/app/ui/shop/cell/grow_cell.lua
@@ -46,9 +46,9 @@ function GrowCell:refresh(idx, gift)
-- 超值
self.offText:setText(tostring(cfgInfo.value) .. "%")
-- 限购
- self.limitText:setText("限购" .. tostring(cfgInfo.limit) .. "次TD") -- TODOJ
+ self.limitText:setText(I18N:getGlobalText(I18N.GlobalConst.SHOP_DESC_18, tostring(cfgInfo.limit))) -- 限购{0}次
-- 标题
- self.titleText:setText("成长礼包TD") -- TODOJ
+ self.titleText:setText(I18N:getGlobalText(I18N.GlobalConst.SHOP_DESC_13)) -- 成长礼包
-- 奖励
local rewardList = cfgInfo.reward
local count = rewardList and #rewardList or 0
diff --git a/lua/app/ui/shop/cell/hot_cell.lua b/lua/app/ui/shop/cell/hot_cell.lua
index 35ddc775..9859c8aa 100644
--- a/lua/app/ui/shop/cell/hot_cell.lua
+++ b/lua/app/ui/shop/cell/hot_cell.lua
@@ -21,7 +21,7 @@ function HotCell:init()
self.heroNumText = uiMap["hot_cell.hero.num_tx"]
self.sellOutText = uiMap["hot_cell.sell_out"]
- self.sellOutText:setText("已购买TD") -- TODOJ
+ self.sellOutText:setText(I18N:getGlobalText(I18N.GlobalConst.SHOP_DESC_20)) -- 已购买
end
function HotCell:refresh(data)
@@ -57,7 +57,7 @@ function HotCell:refresh(data)
GFunc.setAdsSprite(self.adImg)
local adLeftCount = DataManager.ShopData:getMallDailyFirstItemAdMaxCount() - bought
if adLeftCount > 0 then
- self.adText:setText("免费(" .. tostring(adLeftCount) .. ")TD") -- TODOJ
+ self.adText:setText(I18N:getGlobalText(I18N.GlobalConst.STR_FREE) .. "(" .. tostring(adLeftCount) .. ")") -- 免费(x)
GFunc.centerImgAndTx(self.adImg, self.adText, 5)
self.sellOutText:setVisible(false)
diff --git a/lua/app/ui/shop/cell/hot_sell_cell.lua b/lua/app/ui/shop/cell/hot_sell_cell.lua
index f255de99..b9aec6fd 100644
--- a/lua/app/ui/shop/cell/hot_sell_cell.lua
+++ b/lua/app/ui/shop/cell/hot_sell_cell.lua
@@ -6,9 +6,9 @@ function HotSellCell:init()
local uiMap = self.baseObject:genAllChildren()
self.cellHeight = self.baseObject:fastGetSizeDeltaY() + 20
- uiMap["hot_sell_cell.title_bg.text"]:setText("临时文本:每日特惠")
+ uiMap["hot_sell_cell.title_bg.text"]:setText(I18N:getGlobalText(I18N.GlobalConst.SHOP_DESC_28)) -- 每日特惠
uiMap["hot_sell_cell.help_btn"]:addClickListener(function()
-
+ ModuleManager.TipsManager:showDescTips(I18N:getGlobalText(I18N.GlobalConst.SHOP_DESC_29), uiMap["hot_sell_cell.help_btn"]:getBaseObject())
end)
self.timeTx = uiMap["hot_sell_cell.time_tx"]
self.cells = {}
@@ -30,25 +30,24 @@ end
function HotSellCell:refresh()
local goods = DataManager.ShopData:getMallDailyGoods()
- local freeRefreshCount = DataManager.ShopData:getMallDailyAdLeftCount() -- 免费刷新次数
- local gemRefreshCount = DataManager.ShopData:getMallDailyDiamondLeftCount() -- 钻石刷新次数
+ local freeRefreshCount = DataManager.ShopData:getMallDailyAdLeftCount() -- 剩余免费刷新次数
+ local gemRefreshCount = DataManager.ShopData:getMallDailyDiamondLeftCount() -- 剩余钻石刷新次数
local gemRefreshCost = DataManager.ShopData:getMallDailyDiamondResetCost() -- 钻石刷新消耗
-
if freeRefreshCount > 0 then
- self.refreshBtn:setVisible(true)
+ self.refreshBtn:setActive(true)
self.refreshAdImg:setVisible(true)
GFunc.setAdsSprite(self.refreshAdImg)
self.refreshGemImg:setVisible(false)
- self.refreshText:setText("刷新TD") -- TODOJ
- self.refreshBtn:addRedPoint(70, 30, 0.6)
+ self.refreshText:setText(I18N:getGlobalText(I18N.GlobalConst.STR_REFRESH))
+ self.refreshBtn:addRedPoint(80, 30, 0.6)
elseif gemRefreshCount > 0 then
- self.refreshBtn:setVisible(true)
+ self.refreshBtn:setActive(true)
self.refreshAdImg:setVisible(false)
self.refreshGemImg:setVisible(true)
self.refreshText:setText(gemRefreshCost)
self.refreshBtn:removeRedPoint()
else
- self.refreshBtn:setVisible(false)
+ self.refreshBtn:setActive(false)
self.refreshBtn:removeRedPoint()
end
@@ -68,7 +67,7 @@ function HotSellCell:refreshTime()
if remainTime < 0 then
remainTime = 0
end
- self.timeTx:setText("刷新时间TD:" .. GFunc.getTimeStrWithHMS(remainTime)) -- TODOJ
+ self.timeTx:setText(I18N:getGlobalText(I18N.GlobalConst.SHOP_DESC_22, GFunc.getTimeStrWithHMS(remainTime)))-- 刷新时间:{0}
end
function HotSellCell:getCellHeight()
diff --git a/lua/app/ui/shop/cell/level_cell.lua b/lua/app/ui/shop/cell/level_cell.lua
index 95f716e0..99325557 100644
--- a/lua/app/ui/shop/cell/level_cell.lua
+++ b/lua/app/ui/shop/cell/level_cell.lua
@@ -43,9 +43,9 @@ function LevelCell:refresh(idx, cfgInfo, clickCallback)
-- 超值
self.offText:setText(tostring(cfgInfo.value) .. "%")
-- 限购
- self.limitText:setText("限购1次TD") -- 默认限购1次 TODOJ
+ self.limitText:setText(I18N:getGlobalText(I18N.GlobalConst.SHOP_DESC_18, 1)) -- 限购1次
-- 标题
- self.titleText:setText(tostring(cfgInfo.parameter) .. "级助力礼包TD") -- TODOJ
+ self.titleText:setText(I18N:getGlobalText(I18N.GlobalConst.SHOP_DESC_23, tostring(cfgInfo.parameter))) -- {0}级助力礼包
-- 奖励
local rewardList = cfgInfo.reward
local count = rewardList and #rewardList or 0
diff --git a/lua/app/ui/shop/gift_pop_ui.lua b/lua/app/ui/shop/gift_pop_ui.lua
index 3026ef52..381fdc14 100644
--- a/lua/app/ui/shop/gift_pop_ui.lua
+++ b/lua/app/ui/shop/gift_pop_ui.lua
@@ -2,21 +2,23 @@ local GiftPopUI = class("GiftPopUI", BaseUI)
local GIFT_BG_NAME = {
[PayManager.PURCHARSE_TYPE.ACT_GIFT] = {
- [PayManager.PURCHARSE_ACT_TYPE.BEGINNER_GIFT] = "assets/arts/textures/background/shop/shop_gift_banner_2_1.png", -- TODOJ
- [PayManager.PURCHARSE_ACT_TYPE.COIN_GIFT] = "assets/arts/textures/background/shop/shop_gift_banner_5_1.png", -- TODOJ
- [PayManager.PURCHARSE_ACT_TYPE.LEVEL_UP_GIFT] = "assets/arts/textures/background/shop/shop_gift_banner_3_1.png", -- TODOJ
+ [PayManager.PURCHARSE_ACT_TYPE.FIRST_RECHARGE] = "assets/arts/textures/background/shop/shop_gift_banner_1_1.png",
+ [PayManager.PURCHARSE_ACT_TYPE.BEGINNER_GIFT] = "assets/arts/textures/background/shop/shop_gift_banner_3_1.png",
+ [PayManager.PURCHARSE_ACT_TYPE.LEVEL_UP_GIFT] = "assets/arts/textures/background/shop/shop_gift_banner_4_1.png",
+ [PayManager.PURCHARSE_ACT_TYPE.COIN_GIFT] = "assets/arts/textures/background/shop/shop_gift_banner_6_1.png",
},
- [PayManager.PURCHARSE_TYPE.CHAPTER_GIFT] = "assets/arts/textures/background/shop/shop_gift_banner_1_1.png", -- TODOJ
- [PayManager.PURCHARSE_TYPE.GROW_UP_GIFT] = "assets/arts/textures/background/shop/shop_gift_banner_4_1.png", -- TODOJ
+ [PayManager.PURCHARSE_TYPE.CHAPTER_GIFT] = "assets/arts/textures/background/shop/shop_gift_banner_2_1.png",
+ [PayManager.PURCHARSE_TYPE.GROW_UP_GIFT] = "assets/arts/textures/background/shop/shop_gift_banner_5_1.png",
}
local GIFT_TITLE_TEXT = {
[PayManager.PURCHARSE_TYPE.ACT_GIFT] = {
- [PayManager.PURCHARSE_ACT_TYPE.BEGINNER_GIFT] = "新手礼包TD", -- TODOJ
- [PayManager.PURCHARSE_ACT_TYPE.COIN_GIFT] = "金币礼包TD", -- TODOJ
- [PayManager.PURCHARSE_ACT_TYPE.LEVEL_UP_GIFT] = "助力礼包TD", -- TODOJ
+ [PayManager.PURCHARSE_ACT_TYPE.FIRST_RECHARGE] = I18N:getGlobalText(I18N.GlobalConst.SHOP_DESC_9),
+ [PayManager.PURCHARSE_ACT_TYPE.BEGINNER_GIFT] = I18N:getGlobalText(I18N.GlobalConst.SHOP_DESC_11),
+ [PayManager.PURCHARSE_ACT_TYPE.LEVEL_UP_GIFT] = I18N:getGlobalText(I18N.GlobalConst.SHOP_DESC_12),
+ [PayManager.PURCHARSE_ACT_TYPE.COIN_GIFT] = I18N:getGlobalText(I18N.GlobalConst.SHOP_DESC_14),
},
- [PayManager.PURCHARSE_TYPE.CHAPTER_GIFT] = "章节礼包TD", -- TODOJ
- [PayManager.PURCHARSE_TYPE.GROW_UP_GIFT] = "成长礼包TD", -- TODOJ
+ [PayManager.PURCHARSE_TYPE.CHAPTER_GIFT] = I18N:getGlobalText(I18N.GlobalConst.SHOP_DESC_10),
+ [PayManager.PURCHARSE_TYPE.GROW_UP_GIFT] = I18N:getGlobalText(I18N.GlobalConst.SHOP_DESC_13),
}
local MAX_ITEM_NUM = 4
@@ -148,6 +150,21 @@ function GiftPopUI:refresh(needCheck)
self.buyBtnTx:setText(GFunc.getFormatPrice(rechargeId))
end
+ -- 对于首充礼包,有跳转商店和领取2个分支
+ if self.actType == PayManager.PURCHARSE_TYPE.ACT_GIFT and self.actId == GConst.ShopConst.FIRST_RECHARGE_ID then
+ local canGet = DataManager.ShopData:getHasFirstRechargeReward()
+ if canGet then
+ self.buyBtnTx:setText(I18N:getGlobalText(I18N.GlobalConst.BTN_CLAIM))
+ else
+ local hasGet = DataManager.ShopData:getHasGotFirstRechargeReward()
+ if hasGet then
+ self:closeUI()
+ else
+ self.buyBtnTx:setText(I18N:getGlobalText(I18N.GlobalConst.SHOP_DESC_15)) -- 前往商店
+ end
+ end
+ end
+
self:updateTime()
end
@@ -157,10 +174,7 @@ function GiftPopUI:updateTime()
if self.actType == PayManager.PURCHARSE_TYPE.ACT_GIFT then
local cfgInfo = DataManager.ShopData:getActGiftConfig()[self.actId]
if cfgInfo then
- if cfgInfo.type == PayManager.PURCHARSE_ACT_TYPE.FIRST_RECHARGE then -- 首充礼包
- hasTime = true
- self.timeText:setText("TODOJ") -- TODOJ
- elseif cfgInfo and cfgInfo.type == PayManager.PURCHARSE_ACT_TYPE.COIN_GIFT then -- 金币礼包
+ if cfgInfo and cfgInfo.type == PayManager.PURCHARSE_ACT_TYPE.COIN_GIFT then -- 金币礼包
hasTime = true
local remainTime = 0
local triggerTime = DataManager.ShopData:getCoinGiftTriggerTime()
@@ -187,7 +201,18 @@ function GiftPopUI:updateTime()
end
function GiftPopUI:onClickGift()
- PayManager:purchasePackage(self.actId, self.actType)
+ -- 对于首充礼包,有跳转商店和领取2个分支
+ if self.actType == PayManager.PURCHARSE_TYPE.ACT_GIFT and self.actId == GConst.ShopConst.FIRST_RECHARGE_ID then
+ local canGet = DataManager.ShopData:getHasFirstRechargeReward()
+ if canGet then
+ PayManager:purchasePackage(self.actId, self.actType)
+ else
+ EventManager:dispatchEvent(EventManager.CUSTOM_EVENT.GO_SHOP)
+ self:closeUI()
+ end
+ else
+ PayManager:purchasePackage(self.actId, self.actType)
+ end
end
-- 如果还有需要显示的 则直接刷新而不是关闭本界面
diff --git a/lua/app/ui/shop/shop_comp.lua b/lua/app/ui/shop/shop_comp.lua
index 14eabb26..e031b27d 100644
--- a/lua/app/ui/shop/shop_comp.lua
+++ b/lua/app/ui/shop/shop_comp.lua
@@ -38,10 +38,10 @@ function ShopComp:initTitlePage()
self.subTitleIcon2 = self.uiMap["shop_comp.title_node.btn_cell_2.icon"]
self.subTitleBtn2 = self.uiMap["shop_comp.title_node.btn_cell_2"]
- self.subTitleText1:setText("特惠商品TD") -- TODOJ 特惠商品
- self.subTitleSelectText1:setText("特惠商品TD") -- TODOJ 特惠商品
- self.subTitleText2:setText("主要商品TD") -- TODOJ 主要商品
- self.subTitleSelectText2:setText("主要商品TD") -- TODOJ 主要商品
+ self.subTitleText1:setText(I18N:getGlobalText(I18N.GlobalConst.SHOP_DESC_16)) -- 特惠商品
+ self.subTitleSelectText1:setText(I18N:getGlobalText(I18N.GlobalConst.SHOP_DESC_16)) -- 特惠商品
+ self.subTitleText2:setText(I18N:getGlobalText(I18N.GlobalConst.SHOP_DESC_17)) -- 主要商品
+ self.subTitleSelectText2:setText(I18N:getGlobalText(I18N.GlobalConst.SHOP_DESC_17)) -- 主要商品
self.subTitleBtn1:addClickListener(function()
self:switchPage(PAGE_DISCOUNT)
diff --git a/lua/app/userdata/shop/shop_data.lua b/lua/app/userdata/shop/shop_data.lua
index 9afcaec6..cd7f598c 100644
--- a/lua/app/userdata/shop/shop_data.lua
+++ b/lua/app/userdata/shop/shop_data.lua
@@ -6,6 +6,7 @@ end
function ShopData:initBase()
self:initActChapterStoreData()
+ self:initFirstRecharge()
self:initCrossDay()
end
@@ -117,9 +118,6 @@ function ShopData:markPopUpGift(actType, actId)
if not self.needPopUpGift[actType] then
self.needPopUpGift[actType] = {}
end
-
- Logger.logHighlight("markPopUpGift -- actType:%s actId:%s",actType, actId)
-
table.insert(self.needPopUpGift[actType], actId)
end
@@ -128,9 +126,6 @@ function ShopData:removePopUpGift(actType, actId)
if self.needPopUpGift[actType] then
for index, id in ipairs(self.needPopUpGift[actType]) do
if id == actId then
-
- Logger.logHighlight("removePopUpGift -- actType:%s actId:%s",actType, actId)
-
table.remove(self.needPopUpGift[actType], index)
break
end
@@ -262,7 +257,7 @@ function ShopData:addMallDailyAdResetCount()
end
function ShopData:getMallDailyAdLeftCount()
- return 1 - self.mallDailyAdResetCount -- TODOJ 目前无配置表
+ return 1 - self.mallDailyAdResetCount -- 目前无配置表
end
function ShopData:getMallDailyDiamondResetCount()
@@ -274,7 +269,7 @@ function ShopData:addMallDailyDiamondResetCount()
end
function ShopData:getMallDailyDiamondLeftCount()
- return 1 - self.mallDailyDiamondResetCount -- TODOJ 目前无配置表
+ return 1 - self.mallDailyDiamondResetCount -- 目前无配置表
end
function ShopData:getMallDailyGoods()
@@ -282,17 +277,17 @@ function ShopData:getMallDailyGoods()
end
function ShopData:getMallDailyDiamondResetCost()
- return 30 -- TODOJ 目前无配置表
+ return 30 -- 目前无配置表
end
-- 每日特惠 广告商品最大购买次数
function ShopData:getMallDailyFirstItemAdMaxCount()
- return 1 -- TODOJ 目前无配置表
+ return 1 -- 目前无配置表
end
-- 每日特惠 常规商品最大购买次数
function ShopData:getMallDailyGoodsLimitCount()
- return 1 -- TODOJ 目前无配置表
+ return 1 -- 目前无配置表
end
-- 每日特惠 是否开启
@@ -356,7 +351,7 @@ end
-- 常驻钻石礼包 **********************************************************************************************
function ShopData:getMallTreasureConfig()
- return ConfigManager:getConfig("mall_treasure")
+ return ConfigManager:getConfig("mall_treasure") -- 审核模式会去读另一张表 TODOJ
end
-- 常驻钻石礼包结束 ----------------------------------------------------------------------------------------------
@@ -421,8 +416,9 @@ function ShopData:getBeginnerGiftHasBuy()
end
end
+-- 新手礼包侧边栏展示时间
function ShopData:getBeginnerGiftSideBarDurationTime()
- return 3 * 24 * 3600 -- 暂无配置表 TODOJ
+ return 3 * 24 * 3600 -- 目前无配置表
end
-- 未购买且在开服的3天内
@@ -717,4 +713,44 @@ end
-- 成长礼包结束 ----------------------------------------------------------------------------------------------
+-- 首充 **********************************************************************************************
+
+-- 用于标记是否弹窗 要求等级不低于2 未领取该奖励
+function ShopData:initFirstRecharge()
+ local lv = DataManager.PlayerData:getLv()
+ if lv > 1 and not self:getHasGotFirstRechargeReward() then
+ self:markPopUpGift(PayManager.PURCHARSE_TYPE.ACT_GIFT, GConst.ShopConst.FIRST_RECHARGE_ID)
+ end
+end
+
+-- 是否有首充奖励 有支付且未领取
+function ShopData:getHasFirstRechargeReward()
+ local pay = DataManager.PlayerData:getTotalPayAmount()
+ if pay > 0 and not self:getHasGotFirstRechargeReward() then
+ return true
+ else
+ return false
+ end
+end
+
+-- 是否已领取首充奖励
+function ShopData:getHasGotFirstRechargeReward()
+ -- 通用act礼包中是否有已购
+ local boughtNum = self:getGiftBoughtNum(PayManager.PURCHARSE_TYPE.ACT_GIFT, GConst.ShopConst.FIRST_RECHARGE_ID)
+ return boughtNum > 0
+end
+
+-- 侧边栏是否展示 要求等级不低于2 未领取该奖励
+function ShopData:getShowFirstRechargeSideBar()
+ local lv = DataManager.PlayerData:getLv()
+ if lv > 1 and not self:getHasGotFirstRechargeReward() then
+ return true
+ else
+ return false
+ end
+end
+
+-- 首充结束 ----------------------------------------------------------------------------------------------
+
+
return ShopData
\ No newline at end of file