This commit is contained in:
puxuan 2025-10-08 16:02:30 +08:00
parent 45e600be69
commit 920aa71690
44 changed files with 1871 additions and 52 deletions

View File

@ -86,7 +86,6 @@ BIReport.ITEM_GET_TYPE = {
MALL_TREASURE = "MallTreasure", -- 常驻钻石礼包
MALL_DAILY = "MallDaily", -- 每日特惠
MALL_DAILY_RESET = "MallDailyReset",
FIRST_RECHARGE = "FirstRecharge",
COIN_GIFT = "CoinGift",
BEGINNER_GIFT = "BeginnerGift",
LEVEL_UP_GIFT = "LevelUpGift",
@ -96,8 +95,6 @@ BIReport.ITEM_GET_TYPE = {
BATTLE_SKILL_REFRESH = "BattleSkillRefresh",
GROWTH_FUND = "GrowthFund",
GROW_UP_GIFT_NEW = "GrowUpGiftNew", -- 新成长礼包
SEVEN_DAY_TASK = "SevenDayTask",
SEVEN_DAY_STEP_REWARD = "SevenDayStepReward",
DAILY_CHALLENGE = "DailyChallenge", -- 每日挑战进入战斗扣体力
DAILY_CHALLENGE_END = "DailyChallengeEnd", -- 每日挑战结算
DAILY_CHALLENGE_RESET = "DailyChallengeReset", -- 每日挑战重置
@ -218,6 +215,20 @@ BIReport.ITEM_GET_TYPE = {
SIGN_BOUNTY_RESIGH = "sign_bounty_resigh",
SIGN_BOUNTY_SIGH = "sign_bounty_sigh",
SIGN_MONTH_ACCUM_CLAIM = "signin_30_accum_claim",
-- 首充
FIRST_RECHARGE = "first_recharge",
-- 特权卡
PRIVILEGE_CARD = "privilege_card",
-- 七日乐
ACT_SEVEN_DAY_SIGN = "seven_day_sign",
SEVEN_DAY_RESIGN = "seven_day_resign",
SEVEN_DAY_TASK = "seven_day_task",
SEVEN_DAY_TASK_2 = "seven_day_task_2",
SEVEN_DAY_SCORE = "seven_day_score",
SEVEN_DAY_SCORE_2 = "seven_day_score_2",
SEVEN_DAY_GIFT = "seven_day_gift",
}
BIReport.ADS_CLICK_TYPE = {
@ -240,6 +251,8 @@ BIReport.ADS_CLICK_TYPE = {
MALL_TREASURE = "MallTreasure",
MAIL = "Mail",
SUMMON_AD = "SummonAd",
AD_ACT_SEVEN_DAY_GIFT = "AdActSevenDayGift",
}
BIReport.FIGHT_OPT_TYPE = {
@ -324,6 +337,10 @@ BIReport.GIFT_TYPE = {
FUND_GROW = "fund_grow",-- 成长基金
SIGN_BOUNTY = "sign_bounty",
PRIVILEGE_CARD = "privilege_card",
SEVEN_DAY_GIFT = "seven_day_gift",
}
BIReport.COIN_TYPE = {
@ -424,6 +441,11 @@ BIReport.VIDEO_AD_OPT_TYPE = {
GET_REWARD_SKIP_AD = "get_reward_skip_ad",
}
BIReport.SEVEN_DAY_GIFT_OPT = {
CLICK = "Click",
REWARD = "Reward",
}
-- b6
local EVENT_NAME_EXIT = "client_exit"
local EVENT_NAME_FIGHT = "client_fight"
@ -458,6 +480,10 @@ local EVENT_ACT_OPT = "client_act_opt"
local EVENT_NAME_RUNES = "client_runes"
local EVENT_NAME_PAY_ORDER_REPEAT = "client_pay_order_repeat"
local EVENT_NAME_VIDEO_AD_OPT = "client_ad_opt"
local EVENT_NAME_SEVEN_DAY_OPT = "client_seven_day_opt" -- 七天乐任务
local EVENT_NAME_SEVEN_DAY_GIFT_OPT = "client_seven_day_gift_opt" -- 七天乐礼包
local EVENT_NAME_SEVEN_DAY_LOOP_OPT = "client_seven_day_loop_opt" -- 循环七天乐任务
local EVENT_NAME_SEVEN_DAY_LOOP_GIFT_OPT = "client_seven_day_loop_gift_opt" -- 循环七天乐任务
BIReport.TASK_OPT = {
TASK_REWARD = "TaskReward",
@ -2090,4 +2116,60 @@ function BIReport:postVideoAdOpt(optType, adName, result)
self:report(EVENT_NAME_VIDEO_AD_OPT, args)
end
function BIReport:postSevenDayTask(optType, ids, rewards, period)
local idsStr = ""
if ids then
for i, id in ipairs(ids) do
idsStr = idsStr .. id .. ";"
end
end
local args = {
opt_type = optType,
period = period,
ids = idsStr,
reward_str = rewards and GFunc.getRewardsStr(rewards) or nil,
task_score = DataManager.ActSevenDayData:getScore(period),
}
self:report(EVENT_NAME_SEVEN_DAY_OPT, args)
end
function BIReport:postSevenDayGift(optType, id, giftType, rewards, dayn)
local args = {
opt_type = optType,
id = id,
type = giftType,
reward_str = rewards,
dayn = dayn,
}
self:report(EVENT_NAME_SEVEN_DAY_GIFT_OPT, args)
end
function BIReport:postSevenDayLoopTask(optType, ids, rewards, taskScore, actId)
local idsStr = ""
if ids then
for i, id in ipairs(ids) do
idsStr = idsStr .. id .. ";"
end
end
local args = {
act_id = actId,
opt_type = optType,
ids = idsStr,
reward_str = rewards and GFunc.getRewardsStr(rewards) or nil,
task_score = taskScore,
}
self:report(EVENT_NAME_SEVEN_DAY_LOOP_OPT, args)
end
function BIReport:postSevenDayLoopGift(optType, id, giftType, rewards, dayn)
local args = {
opt_type = optType,
id = id,
type = giftType,
reward_str = rewards,
dayn = dayn,
}
self:report(EVENT_NAME_SEVEN_DAY_LOOP_GIFT_OPT, args)
end
return BIReport

View File

@ -47,7 +47,8 @@ function DataManager:init()
self:initManager("ActGiftData", "app/userdata/activity/act_gift_data")
self:initManager("ActSprintData", "app/userdata/activity/act_sprint/act_sprint_data")
self:initManager("ActSprintSummonDataAll", "app/userdata/activity/act_sprint/act_sprint_summon_data_all")
-- 特权卡
self:initManager("PrivilegeCardData", "app/userdata/privilege_card/privilege_card_data")
end
function DataManager:initManager(name, path)
@ -153,6 +154,7 @@ function DataManager:initWithServerData(data)
self.IdleData:init(data.idle)
self.ShopData:init()
self.ShopData:refreshDailyShop(data.mall_daily_store)
self.PrivilegeCardData:init(data.card)
-- self.ShopData:refreshGoldShop(data.mall_gold)
-- self.ShopData:refreshEmblemShop(data.mall_mythic_store)
-- self.ShopData:initVit(data.energy_limit)
@ -175,7 +177,7 @@ function DataManager:initWithServerData(data)
self.ActivityData:initExchangeData(data.activity_exchange)
self.ActTaskData:initTaskData(data.activity_score_task, data.activity_task)
self.ActSprintData:init(data.activity_rush_exchange)
self.ActSevenDayData:initData(data.seven_days, true)
self.ActSevenDayData:initData(data.seven_day)
-- self.ActSprintSummonDataAll:initTaskData(data.activity_score_task, data.activity_task)
-- 商店礼包都初始化完了后检查一下每日红点

View File

@ -73,6 +73,7 @@ EventManager.CUSTOM_EVENT = {
-- b13
FORCE_SUMMON_WISH_HERO_ID = "FORCE_SUMMON_WISH_HERO_ID",--心愿英雄设置
FORCE_SUMMON_WISH_CLAIM = "FORCE_SUMMON_WISH_CLAIM",--心愿奖励领取
NO_AD_ACTIVE = "NO_AD_ACTIVE", -- 免广告卡激活
-- b10
FORCE_SUMMON = "FORCE_SUMMON",
FORCE_SUMMON_NEXT = "FORCE_SUMMON_NEXT",

View File

@ -9,6 +9,7 @@ local LOCAL_DATA_KEY = {
SELECTED_LANGUAGE = "SELECTED_LANGUAGE",
GM_SHOW_FLOATING_ICON = "GM_SHOW_FLOATING_ICON",
MESSAGE_BOX_SHOW_TODAY = "MESSAGE_BOX_SHOW_TODAY",
MESSAGE_BOX_SHOW_TODAY_VALUE = "MESSAGE_BOX_SHOW_TODAY_VALUE",
GAME_QUALITY_LEVEL = "GAME_QUALITY_LEVEL", -- 游戏设置品质等级
LAST_LOGIN_URL = "LAST_LOGIN_URL",
LAST_LOGIN_NAME = "LAST_LOGIN_NAME",
@ -157,6 +158,14 @@ function LocalData:setMessageBoxShowTodayTime(key, value)
self:setInt(LOCAL_DATA_KEY.MESSAGE_BOX_SHOW_TODAY .. key, value)
end
function LocalData:getMessageBoxShowTodayValue(key)
return self:getInt(LOCAL_DATA_KEY.MESSAGE_BOX_SHOW_TODAY_VALUE .. key, 0)
end
function LocalData:setMessageBoxShowTodayValue(key, value)
self:setInt(LOCAL_DATA_KEY.MESSAGE_BOX_SHOW_TODAY_VALUE .. key, value)
end
function LocalData:getGameQualityLevel()
return self:getInt(LOCAL_DATA_KEY.GAME_QUALITY_LEVEL, 0)
end

View File

@ -84,6 +84,8 @@ local MODULE_PATHS = {
SignManager = "app/module/sign/sign_manager",
-- 活动七天乐
ActSevenDayManager = "app/module/activity/act_seven_day/act_seven_day_manager",
-- 特权卡
PrivilegeCardManager = "app/module/privilege/privilege_card_manager",
-- 冲刺活动
ActSprintManager = "app/module/activity/act_sprint/act_sprint_manager",
}
@ -130,6 +132,8 @@ ModuleManager.MODULE_KEY = {
-- 七天乐
ACT_SEVENDAY = "act_sevenday",
ACT_SEVENDAY_2 = "act_sevenday_2",
-- 免广告卡
CARD_AD = "card_ad",
}
local _moduleMgrs = {}

View File

@ -32,6 +32,8 @@ PayManager.PURCHARSE_ACT_TYPE = {
-- RUNES_GIFT = 21,
-- TOURN_WAVE_GIFT = 23,
-- TOURN_ARENA_GIFT = 24,
FIRST_RECHARGE = 1,
PRIVILEGE_CARD = 2,
BOUNTY = 3,
FUND = 4,
SIGN_BOUNTY = 5,
@ -58,11 +60,14 @@ PayManager.PURCHARSE_TYPE_CONFIG = {
PayManager.BI_ITEM_GET_TYPE = {
[PayManager.PURCHARSE_TYPE.ACT_GIFT] = {
[PayManager.PURCHARSE_ACT_TYPE.FIRST_RECHARGE] = BIReport.ITEM_GET_TYPE.FIRST_RECHARGE,
[PayManager.PURCHARSE_ACT_TYPE.PRIVILEGE_CARD] = BIReport.ITEM_GET_TYPE.PRIVILEGE_CARD,
[PayManager.PURCHARSE_ACT_TYPE.BOUNTY] = BIReport.ITEM_GET_TYPE.BOUNTY,
[PayManager.PURCHARSE_ACT_TYPE.FUND] = BIReport.ITEM_GET_TYPE.FUND_GROW,
[PayManager.PURCHARSE_ACT_TYPE.SIGN_BOUNTY] = BIReport.ITEM_GET_TYPE.SIGN_BOUNTY,
[PayManager.PURCHARSE_ACT_TYPE.GIFT_POP_CHAPTER] = BIReport.ITEM_GET_TYPE.GIFT_POP_CHAPTER,
[PayManager.PURCHARSE_ACT_TYPE.ACT_COMMON] = {},
[PayManager.PURCHARSE_ACT_TYPE.ACT_SEVEN_DAY] = BIReport.ITEM_GET_TYPE.SEVEN_DAY_GIFT,
-- [PayManager.PURCHARSE_ACT_TYPE.FIRST_RECHARGE] = BIReport.ITEM_GET_TYPE.FIRST_RECHARGE,
-- [PayManager.PURCHARSE_ACT_TYPE.COIN_GIFT] = BIReport.ITEM_GET_TYPE.COIN_GIFT,
-- [PayManager.PURCHARSE_ACT_TYPE.INTRODUCTORY_GIFT] = BIReport.ITEM_GET_TYPE.INTRODUCTORY_GIFT,
@ -93,11 +98,14 @@ PayManager.BI_ITEM_GET_TYPE = {
PayManager.BI_GIFT_TYPE = {
[PayManager.PURCHARSE_TYPE.ACT_GIFT] = {
[PayManager.PURCHARSE_ACT_TYPE.FIRST_RECHARGE] = BIReport.GIFT_TYPE.FIRST_RECHARGE,
[PayManager.PURCHARSE_ACT_TYPE.PRIVILEGE_CARD] = BIReport.GIFT_TYPE.PRIVILEGE_CARD,
[PayManager.PURCHARSE_ACT_TYPE.BOUNTY] = BIReport.GIFT_TYPE.BOUNTY_PRO_REWARD,
[PayManager.PURCHARSE_ACT_TYPE.FUND] = BIReport.GIFT_TYPE.FUND_GROW,
[PayManager.PURCHARSE_ACT_TYPE.SIGN_BOUNTY] = BIReport.GIFT_TYPE.SIGN_BOUNTY,
[PayManager.PURCHARSE_ACT_TYPE.GIFT_POP_CHAPTER] = BIReport.GIFT_TYPE.GIFT_POP_CHAPTER,
[PayManager.PURCHARSE_ACT_TYPE.ACT_COMMON] = {},
[PayManager.PURCHARSE_ACT_TYPE.ACT_SEVEN_DAY] = BIReport.GIFT_TYPE.SEVEN_DAY_GIFT,
-- [PayManager.PURCHARSE_ACT_TYPE.FIRST_RECHARGE] = BIReport.GIFT_TYPE.FIRST_RECHARGE,
-- [PayManager.PURCHARSE_ACT_TYPE.COIN_GIFT] = BIReport.GIFT_TYPE.COIN_GIFT,
-- [PayManager.PURCHARSE_ACT_TYPE.INTRODUCTORY_GIFT] = BIReport.GIFT_TYPE.INTRODUCTORY_GIFT,

View File

@ -408,6 +408,12 @@ local const = {
}
}
},
["card_forever_dispatch_task_num"]={
["value"]=2.0
},
["card_forever_dispatch_task_reward_bonus"]={
["value"]=3000.0
},
["act_gogogo_round_limit_1"]={
["value"]=5
}

View File

@ -860,6 +860,30 @@ local LocalizationGlobalConst =
ACT_HERO_SUIT_DESC_5 = "ACT_HERO_SUIT_DESC_5",
ACT_HERO_SUIT_DESC_6 = "ACT_HERO_SUIT_DESC_6",
EQUIP_DESC_31 = "EQUIP_DESC_31",
ADS_DESC_13 = "ADS_DESC_13",
AD_FREE_DESC_9 = "AD_FREE_DESC_9",
MONTHLY_CARD_1 = "MONTHLY_CARD_1",
MONTHLY_CARD_2 = "MONTHLY_CARD_2",
MONTHLY_CARD_3 = "MONTHLY_CARD_3",
MONTHLY_CARD_4 = "MONTHLY_CARD_4",
MONTHLY_CARD_5 = "MONTHLY_CARD_5",
MONTHLY_CARD_6 = "MONTHLY_CARD_6",
MONTHLY_CARD_7 = "MONTHLY_CARD_7",
MONTHLY_CARD_8 = "MONTHLY_CARD_8",
MONTHLY_CARD_9 = "MONTHLY_CARD_9",
MONTHLY_CARD_10 = "MONTHLY_CARD_10",
MONTHLY_CARD_11 = "MONTHLY_CARD_11",
MONTHLY_CARD_12 = "MONTHLY_CARD_12",
MONTHLY_CARD_13 = "MONTHLY_CARD_13",
MONTHLY_CARD_14 = "MONTHLY_CARD_14",
MONTHLY_CARD_15 = "MONTHLY_CARD_15",
MONTHLY_CARD_16 = "MONTHLY_CARD_16",
MONTHLY_CARD_17 = "MONTHLY_CARD_17",
MONTHLY_CARD_DESC_1_1 = "MONTHLY_CARD_DESC_1_1",
MONTHLY_CARD_DESC_1_2 = "MONTHLY_CARD_DESC_1_2",
MONTHLY_CARD_DESC_1_3 = "MONTHLY_CARD_DESC_1_3",
MONTHLY_CARD_DESC_2_1 = "MONTHLY_CARD_DESC_2_1",
MONTHLY_CARD_DESC_2_2 = "MONTHLY_CARD_DESC_2_2",
}
return LocalizationGlobalConst

View File

@ -860,6 +860,32 @@ local localization_global =
["ACT_HERO_SUIT_DESC_5"] = "免费奖励",
["ACT_HERO_SUIT_DESC_6"] = "高级奖励",
["EQUIP_DESC_31"] = "等级",
["ADS_DESC_13"] = "是否观看广告?",
["ADS_DESC_15"] = "免广告卡",
["ADS_DESC_16"] = "免广告永久有效",
["AD_FREE_DESC_9"] = "看广告",
["MONTHLY_CARD_1"] = "月卡",
["MONTHLY_CARD_2"] = "超值月卡",
["MONTHLY_CARD_3"] = "特权月卡",
["MONTHLY_CARD_4"] = "购买立得",
["MONTHLY_CARD_5"] = "特权福利",
["MONTHLY_CARD_6"] = "续费",
["MONTHLY_CARD_7"] = "每日获得",
["MONTHLY_CARD_8"] = "好运成双",
["MONTHLY_CARD_9"] = "同时激活两张月卡可领取",
["MONTHLY_CARD_10"] = "开启战斗2倍加速",
["MONTHLY_CARD_11"] = "免看广告得奖励",
["MONTHLY_CARD_12"] = "已激活",
["MONTHLY_CARD_13"] = "未激活",
["MONTHLY_CARD_14"] = "剩余时间:{0}",
["MONTHLY_CARD_15"] = "有效期{0}天",
["MONTHLY_CARD_16"] = "1.购买月卡后,享30天每日奖励和特权。\n2.同时激活超值月卡和特权可领取好运成双奖励。",
["MONTHLY_CARD_17"] = "已达到当前购买上限",
["MONTHLY_CARD_DESC_1_1"] = "无限快速挂机",
["MONTHLY_CARD_DESC_1_2"] = "体力恢复速度+10%",
["MONTHLY_CARD_DESC_1_3"] = "精力上限+10",
["MONTHLY_CARD_DESC_2_1"] = "体力上限+20",
["MONTHLY_CARD_DESC_2_2"] = "每日体力购买次数+2",
}
return localization_global

View File

@ -2,6 +2,7 @@ local GConst = {}
GConst.DEFAULT_FACTOR = 10000
GConst.NOT_VISIBLE_POS = 10000000000
GConst.SECONDS_PRE_DAY = 86400
local CONST_PATHS = {
StageConst = "app/module/stage/stage_const",
@ -330,6 +331,7 @@ GConst.MESSAGE_BOX_SHOW_TODAY = {
ACTIVITY_BUY_LEVEL = 3,
RUNES_AUTO = 4,
ACT_PVP_BUY_BOUNTY_LEVE = 5,
MONTHLY_CARD_AD = 6,
}
GConst.QUALITY_TYPE =

View File

@ -336,6 +336,10 @@ function GFunc.showMessageBox(params)
MessageBox:showMessageBox(params)
end
function GFunc.showAdMesssageBox(params)
UIManager:showUI("app/ui/common/common_ad_ui", params)
end
function GFunc.showToast(params)
ModuleManager.ToastManager:showToast(params)
end

View File

@ -18,7 +18,7 @@ MainCityConst.BOTTOM_CLOSE_ICON = {
MainCityConst.LEFT_SIDE_BARS = {
-- "app/ui/main_city/cell/side_bar_gift_routine_cell", -- 礼包
-- "app/ui/main_city/cell/side_bar_privilege_cell", -- 特权
"app/ui/main_city/cell/side_bar_privilege_cell", -- 特权
"app/ui/main_city/cell/side_bar_fund_cell", -- 基金
"app/ui/main_city/cell/side_bar_first_recharge_cell", -- 首充
}

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: e0a3804d50f4a407e86cb65fe3aae51b
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,132 @@
local PrivilegeCardManager = class("MonthlyCardManager", BaseModule)
function PrivilegeCardManager:showPrivilegeUI(showPage)
local params = {
showPage = showPage,
}
UIManager:showUI("app/ui/privilege/privilege_main_ui", params)
end
function PrivilegeCardManager:getFreeDailyRewards()
if DataManager.PrivilegeCardData:getIsClaimedFreeDailyReward() then
return
end
self:sendMessage(ProtoMsgType.FromMsgEnum.CardDailyRewardReq, {}, self.onGetFreeDailyRewards, BIReport.ITEM_GET_TYPE.PRIVILEGE_FREE_DAILY_REWARD)
end
function PrivilegeCardManager:onGetFreeDailyRewards(result)
if result.err_code ~= GConst.ERROR_STR.SUCCESS then
return
end
DataManager.PrivilegeCardData:onClaimedFreeDailyReward()
if result.rewards then
GFunc.showRewardBox(result.rewards)
end
-- BI
BIReport:postPrivilegeCardGetDailyReward(result.rewards)
end
function PrivilegeCardManager:buyMonthlyCard()
local canBuyCard = DataManager.PrivilegeCardData:checkCanBuyMonthlyCard()
if canBuyCard then
local giftId = GConst.ShopConst.PRIVILEGE_CARD_ID.MONTHLY_CARD
PayManager:purchasePackage(giftId, PayManager.PURCHARSE_TYPE.ACT_GIFT, true)
else
GFunc.showToast(I18N:getGlobalText(I18N.GlobalConst.MONTHLY_CARD_17))
end
end
function PrivilegeCardManager:buyChallengeCard()
local canBuyCard = DataManager.PrivilegeCardData:checkCanBuyChallengeCard()
if canBuyCard then
local giftId = GConst.ShopConst.PRIVILEGE_CARD_ID.CHALLEGE_CARD
PayManager:purchasePackage(giftId, PayManager.PURCHARSE_TYPE.ACT_GIFT, true)
else
GFunc.showToast(I18N:getGlobalText(I18N.GlobalConst.MONTHLY_CARD_17))
end
end
function PrivilegeCardManager:buyAdCard()
local canBuyCard = DataManager.PrivilegeCardData:checkCanBuyAdCard()
if canBuyCard then
local giftId = GConst.ShopConst.PRIVILEGE_CARD_ID.AD_CARD
PayManager:purchasePackage(giftId, PayManager.PURCHARSE_TYPE.ACT_GIFT, true)
else
GFunc.showToast(I18N:getGlobalText(I18N.GlobalConst.MONTHLY_CARD_17))
end
end
function PrivilegeCardManager:buyLifetimeCard()
local canBuyCard = DataManager.PrivilegeCardData:checkCanBuyLifetimeCard()
if canBuyCard then
local giftId = GConst.ShopConst.PRIVILEGE_CARD_ID.LIFETIME_CARD
PayManager:purchasePackage(giftId, PayManager.PURCHARSE_TYPE.ACT_GIFT, true)
else
GFunc.showToast(I18N:getGlobalText(I18N.GlobalConst.MONTHLY_CARD_17))
end
end
function PrivilegeCardManager:getPurchaseCardDailyReward(id)
local itemGetType = BIReport.ITEM_GET_TYPE.PRIVILEGE_ALL_CARD_DAILY_REWARD
if id == GConst.ShopConst.PRIVILEGE_CARD_ID.MONTHLY_CARD then
itemGetType = BIReport.ITEM_GET_TYPE.PRIVILEGE_MONTHLY_CARD_DAILY_REWARD
elseif id == GConst.ShopConst.PRIVILEGE_CARD_ID.LIFETIME_CARD then
itemGetType = BIReport.ITEM_GET_TYPE.PRIVILEGE_LIFETIME_CARD_DAILY_REWARD
elseif id == 0 then
itemGetType = BIReport.ITEM_GET_TYPE.PRIVILEGE_ALL_CARD_DAILY_REWARD
else
return
end
self:sendMessage(ProtoMsgType.FromMsgEnum.CardRewardReq, {id = id}, self.onGetPurchaseCardDailyReward, itemGetType)
end
function PrivilegeCardManager:onGetPurchaseCardDailyReward(result)
if result.err_code ~= GConst.ERROR_STR.SUCCESS then
return
end
DataManager.PrivilegeCardData:onClaimedPurchaseCardDailyReward(result.reqData.id)
if result.reqData.id == 0 then
DataManager.PrivilegeCardData:onClaimedFreeDailyReward()
end
if result.rewards then
GFunc.showRewardBox(result.rewards)
end
-- BI
BIReport:postPrivilegeCardGetPurchaseDailyReward(result.rewards, result.reqData.id)
end
--region 上报
-- 特权卡
BIReport.ITEM_GET_TYPE.PRIVILEGE_CARD = "privilege_card"
BIReport.ITEM_GET_TYPE.PRIVILEGE_FREE_DAILY_REWARD = "privilege_free_daily_reward"
BIReport.ITEM_GET_TYPE.PRIVILEGE_CHALLENGE_CARD = "privilege_challenge_card"
BIReport.ITEM_GET_TYPE.PRIVILEGE_MONTHLY_CARD_DAILY_REWARD = "privilege_monthly_card_daily_reward"
BIReport.ITEM_GET_TYPE.PRIVILEGE_LIFETIME_CARD_DAILY_REWARD = "privilege_lifetime_card_daily_reward"
BIReport.ITEM_GET_TYPE.PRIVILEGE_ALL_CARD_DAILY_REWARD = "privilege_all_card_daily_reward"
BIReport.PRIVILEGE_CARD_OPT_TYPE = {
FREE_DAILY_REWARD = "FreeDailyReward",
PURCHASE_DAILY_REWARD = "PurchaseDailyReward",
}
local EVENT_NAME_PRIVILEGE_CARD = "event_privilege_card" -- 特权卡
function BIReport:postPrivilegeCardGetDailyReward(rewards)
local args = {
opt_type = BIReport.PRIVILEGE_CARD_OPT_TYPE.FREE_DAILY_REWARD,
reward_str = rewards and GFunc.getRewardsStr(rewards) or nil
}
self:report(EVENT_NAME_PRIVILEGE_CARD, args)
end
function BIReport:postPrivilegeCardGetPurchaseDailyReward(rewards, cardType)
local args = {
opt_type = BIReport.PRIVILEGE_CARD_OPT_TYPE.PURCHASE_DAILY_REWARD,
reward_str = rewards and GFunc.getRewardsStr(rewards) or nil,
cardType = cardType
}
self:report(EVENT_NAME_PRIVILEGE_CARD, args)
end
--endregion
return PrivilegeCardManager

View File

@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: f7502f35cc7c248a889d6b5299fd44a4
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 11500000, guid: 3b8b241bab4a4ac9a22fcce9c64f1242, type: 3}

View File

@ -1,17 +1,17 @@
local ShopConst = {}
ShopConst.PRIVILEGE_CARD_ID = {
AD_CARD = 20102,
MONTHLY_CARD = 20202,
LIFETIME_CARD = 20302,
CHALLEGE_CARD = 20402,
AD_CARD = 1053000001,
MONTHLY_CARD = 1053000101,
-- LIFETIME_CARD = 20302,
-- CHALLEGE_CARD = 20402,
}
ShopConst.PRIVILEGE_CARD_ID_MAP = {
[ShopConst.PRIVILEGE_CARD_ID.AD_CARD] = 1,
[ShopConst.PRIVILEGE_CARD_ID.MONTHLY_CARD] = 1,
[ShopConst.PRIVILEGE_CARD_ID.LIFETIME_CARD] = 1,
[ShopConst.PRIVILEGE_CARD_ID.CHALLEGE_CARD] = 1,
-- [ShopConst.PRIVILEGE_CARD_ID.LIFETIME_CARD] = 1,
-- [ShopConst.PRIVILEGE_CARD_ID.CHALLEGE_CARD] = 1,
}
--首充档位
@ -32,8 +32,8 @@ ShopConst.PRIVILEGE_SHOW_PAGE = {
FREE_DAILY_REWARDS = 1,
AD_CARD = 2,
MONTHLY_CARD = 3,
LIFETIME_CARD = 4,
CHALLEGE_CARD = 5,
-- LIFETIME_CARD = 4,
-- CHALLEGE_CARD = 5,
}
-- 脚本路径
@ -41,8 +41,8 @@ ShopConst.PRIVILEGE_COMP = {
FREE_DAILY_REWARDS = "app/ui/privilege/comp/free_daily_rewards_comp",
AD_CARD = "app/ui/privilege/comp/ad_card_comp",
MONTHLY_CARD = "app/ui/privilege/comp/monthly_card_comp",
LIFETIME_CARD = "app/ui/privilege/comp/lifetime_card_comp",
CHALLEGE_CARD = "app/ui/privilege/comp/challege_card_comp",
-- LIFETIME_CARD = "app/ui/privilege/comp/lifetime_card_comp",
-- CHALLEGE_CARD = "app/ui/privilege/comp/challege_card_comp",
}
ShopConst.PRIVILEGE_PAGE_BTN_ICON_ATLAS = {

View File

@ -0,0 +1,133 @@
local CommonAdUI = class("CommonAdUI", BaseUI)
function CommonAdUI:ctor(params)
params = params or {}
self.content = params.content or ""
self.okFunc = params.okFunc
self.showToday = params.showToday
end
function CommonAdUI:isFullScreen()
return false
end
function CommonAdUI:showCommonBG()
return false
end
function CommonAdUI:getPrefabPath()
return "assets/prefabs/ui/common/common_ad_ui.prefab"
end
function CommonAdUI:onPressBackspace()
self:closeUI()
end
function CommonAdUI:onLoadRootComplete()
self:addEventListener(EventManager.CUSTOM_EVENT.NO_AD_ACTIVE, function(params)
if not self:isClosed() then
self:hideAdNode()
end
end)
if self.showToday then -- 今天内不在提示
local time = LocalData:getMessageBoxShowTodayTime(self.showToday)
local todayTime = Time:getBeginningOfServerToday()
if time > 0 and time == todayTime then
local value = LocalData:getMessageBoxShowTodayValue(self.showToday)
if value == 1 then
if self.okFunc then
self.okFunc()
end
self:closeUI()
return
else
-- 不作处理
end
end
end
local selected = false
local uiMap = self.root:genAllChildren()
uiMap["message_box.title_bg_img.title_text"]:setText(I18N:getGlobalText(I18N.GlobalConst.MESSAGE_BOX_TITLE))
uiMap["message_box.title_bg_img.bg.content_tx"]:setText(self.content)
uiMap["message_box.content.close_btn"]:addClickListener(function()
if self.showToday and selected then
local todayTime = Time:getBeginningOfServerToday()
LocalData:setMessageBoxShowTodayTime(self.showToday, todayTime)
LocalData:setMessageBoxShowTodayValue(self.showToday, 0)
end
self:closeUI()
end)
uiMap["message_box.content.ad_btn"]:addClickListener(function()
if self.showToday and selected then
local todayTime = Time:getBeginningOfServerToday()
LocalData:setMessageBoxShowTodayTime(self.showToday, todayTime)
LocalData:setMessageBoxShowTodayValue(self.showToday, 1)
end
if self.okFunc then
self.okFunc()
end
self:closeUI()
end)
uiMap["common_ad_ui.content.cancel_btn"]:addClickListener(function()
if self.showToday and selected then
local todayTime = Time:getBeginningOfServerToday()
LocalData:setMessageBoxShowTodayTime(self.showToday, todayTime)
LocalData:setMessageBoxShowTodayValue(self.showToday, 0)
end
self:closeUI()
end)
if self.showToday then -- 今天内不在提示
uiMap["message_box.title_bg_img.bg"]:setSizeDeltaY(216)
uiMap["message_box.title_bg_img.today"]:setVisible(true)
uiMap["message_box.title_bg_img.today.check.select"]:setVisible(false)
local checkUI = uiMap["message_box.title_bg_img.today.check"]
checkUI:addClickListener(function()
selected = not selected
Logger.logHighlight("%s", selected)
uiMap["message_box.title_bg_img.today.check.select"]:setVisible(selected)
end)
local textUI = uiMap["message_box.title_bg_img.today.text"]
textUI:setText(I18N:getGlobalText(I18N.GlobalConst.CONFIRM_IGNORE))
GFunc.centerImgAndTx(checkUI, textUI, 5)
else
uiMap["message_box.title_bg_img.bg"]:setSizeDeltaY(246)
uiMap["message_box.title_bg_img.today"]:setVisible(false)
end
-- 广告提示
uiMap["common_ad_ui.content.cancel_btn.tx"]:setText(I18N:getGlobalText(I18N.GlobalConst.BTN_TEXT_CANCEL))
uiMap["message_box.content.ad_btn.tx"]:setText(I18N:getGlobalText(I18N.GlobalConst.AD_FREE_DESC_9))
if DataManager.PlayerData:getNoAdFuncOpen() and not DataManager.PlayerData:getNoAdActive() then
uiMap["message_box.no_ad_node"]:setVisible(true)
GFunc.setAdsSprite(uiMap["message_box.content.ad_btn.icon"])
uiMap["message_box.no_ad_node.tx_ad"]:setText(I18N:getGlobalText(I18N.GlobalConst.ADS_DESC_15))
uiMap["message_box.no_ad_node.tx_desc"]:setText(I18N:getGlobalText(I18N.GlobalConst.ADS_DESC_16))
uiMap["message_box.no_ad_node.btn_buy"]:addClickListener(function()
ModuleManager.PrivilegeCardManager:buyAdCard()
end)
uiMap["message_box.no_ad_node.btn_buy.tx_desc"]:setText(DataManager.PlayerData:getNoAdPrice())
else
self:hideAdNode()
end
end
function CommonAdUI:hideAdNode()
local uiMap = self.root:genAllChildren()
uiMap["message_box.no_ad_node"]:setVisible(false)
end
function CommonAdUI:onClose()
self.okFunc = nil
self.showToday = nil
end
return CommonAdUI

View File

@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: d755396ed761e4350a967956234cab42
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 11500000, guid: 3b8b241bab4a4ac9a22fcce9c64f1242, type: 3}

View File

@ -197,6 +197,7 @@ function GMToolUI:updateTime()
timeStr = timeStr .. "\n\n本地时间:\n" .. clientDate.year .. "/" .. clientDate.month .. "/" .. clientDate.day .. " " .. clientDate.hour .. ":" .. clientDate.min .. ":" .. clientDate.sec
uiMap["gm_tool_ui.time"]:setText(timeStr)
-- uiMap["gm_tool_ui.create_day"]:setText("开服第 ".. DataManager.PlayerData:getServerOpenDay().." 天\n建号第 ".. DataManager.PlayerData:getCreateDay().." 天")
uiMap["gm_tool_ui.create_day"]:setText("建号第 ".. DataManager.PlayerData:getCreateDay().."")
end
function GMToolUI:dealAddBuffGm(args)

View File

@ -83,6 +83,10 @@ function IdleDropUI:onLoadRootComplete()
self.adBtn:addClickListener(function()
ModuleManager.IdleManager:getIdleQuickRewrad(true)
end)
self.privilegeBtn = uiMap["idle_drop_ui.bg.privilege_btn"]
self.privilegeBtn:addClickListener(function()
ModuleManager.PrivilegeCardManager:showPrivilegeUI()
end)
uiMap["idle_drop_ui.bg.desc_tx"]:setText(I18N:getGlobalText(I18N.GlobalConst.CLICK_CLOSE_DESC))
uiMap["idle_drop_ui.bg.bg1.desc_tx"]:setText(I18N:getGlobalText(I18N.GlobalConst.IDLE_DROP_DESC_3))

View File

@ -0,0 +1,27 @@
local SideBarPrivilegeCell = class("SideBarPrivilegeCell", SideBarBaseCell)
function SideBarPrivilegeCell:getModuleKey()
-- return ModuleManager.MODULE_KEY.TASK
end
function SideBarPrivilegeCell:getIsOpen()
return DataManager.PrivilegeCardData:getIsOpen()
end
function SideBarPrivilegeCell:getSpineName()
return "ui_main_btn_shop"
end
function SideBarPrivilegeCell:onClick()
ModuleManager.PrivilegeCardManager:showPrivilegeUI()
end
function SideBarPrivilegeCell:getIsShowRedPoint()
return DataManager.PrivilegeCardData:getRedPoint()
end
function SideBarPrivilegeCell:getCellName()
return I18N:getGlobalText(I18N.GlobalConst.MONTHLY_CARD_5)
end
return SideBarPrivilegeCell

View File

@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 10de82eb58e58498b82654e1d7984c1e
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 11500000, guid: 3b8b241bab4a4ac9a22fcce9c64f1242, type: 3}

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: f09c74f8eb7344f44ac12f5ffc8806c1
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: a8b98a00a3b1b4f489369e305e7941e9
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 37301de2032f04f4a9f931f0d13e73f9
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,55 @@
local AdCardComp = class("AdCardComp", LuaComponent)
function AdCardComp:init()
local uiMap = self:getUIMap()
self.titleTx = uiMap["ad_card.title_tx"]
self.titleTx:setText(I18N:getGlobalText(I18N.GlobalConst.PRIVILEGE_CARD_NAME_2))
self.descTx = uiMap["ad_card.desc_tx"]
self.descTx:setText(I18N:getGlobalText(I18N.GlobalConst.PRIVILEGE_CARD_DESC_2))
self.descTx2 = uiMap["ad_card.desc_tx_2"]
self.rewardDescTx = uiMap["ad_card.reward_bg.text"]
self.rewardDescTx:setText(I18N:getGlobalText(I18N.GlobalConst.PRIVILEGE_CARD_DESC_3))
self.rewadCell = uiMap["ad_card.reward_bg.reward_cell"]:addLuaComponent(GConst.TYPEOF_LUA_CLASS.REWARD_CELL)
self.offImg = uiMap["ad_card.off_img"]
self.offText1 = uiMap["ad_card.off_img.text"]
self.offText2 = uiMap["ad_card.off_img.text_2"]
self.offText2:setText(I18N:getGlobalText(I18N.GlobalConst.VALUE_DESC))
uiMap["ad_card.ui_spine_obj"]:playAnim("idle", true, true)
self.payBtn = uiMap["ad_card.pay_btn"]
self.payBtn:addClickListener(function()
ModuleManager.PrivilegeCardManager:buyAdCard()
end)
self.payBtnTx = uiMap["ad_card.pay_btn.text"]
end
function AdCardComp:refresh()
local cfg = DataManager.ShopData:getActGiftConfig(GConst.ShopConst.PRIVILEGE_CARD_ID.AD_CARD)
if cfg == nil then
return
end
local isActive = DataManager.PrivilegeCardData:getIsCardActive(GConst.ShopConst.PRIVILEGE_CARD_ID.AD_CARD)
if isActive then
self.descTx2:setText("<color=#4BFF53>" .. I18N:getGlobalText(I18N.GlobalConst.MONTHLY_CARD_12) .. "</color>")
self.payBtn:setActive(false)
else
self.descTx2:setText(I18N:getGlobalText(I18N.GlobalConst.MONTHLY_CARD_13))
self.payBtn:setActive(true)
self.payBtnTx:setText(GFunc.getFormatPrice(cfg.recharge_id))
end
local rewards = cfg.reward
if rewards and rewards[1] then
self.rewadCell:refreshByConfig(rewards[1], isActive, isActive)
end
if cfg.value then
self.offImg:setVisible(true)
self.offText1:setText(cfg.value .. "%")
else
self.offImg:setVisible(false)
end
end
return AdCardComp

View File

@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 8fe1414b7b2974e85ba0cf751fa54fef
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 11500000, guid: 3b8b241bab4a4ac9a22fcce9c64f1242, type: 3}

View File

@ -0,0 +1,47 @@
local FreeDailyRewardsComp = class("FreeDailyRewardsComp", LuaComponent)
function FreeDailyRewardsComp:init()
local uiMap = self:getUIMap()
self.titleTx = uiMap["free_daily_rewards.title_tx"]
self.titleTx:setText(I18N:getGlobalText(I18N.GlobalConst.PRIVILEGE_CARD_NAME_1))
self.rewadCell = uiMap["free_daily_rewards.reward_cell"]:addLuaComponent(GConst.TYPEOF_LUA_CLASS.REWARD_CELL)
self.getBtn = uiMap["free_daily_rewards.btn_get"]
self.getBtn:addClickListener(function()
ModuleManager.PrivilegeCardManager:getFreeDailyRewards()
end)
self.getBtnTx = uiMap["free_daily_rewards.btn_get.text"]
self.getBtnGrey = uiMap["free_daily_rewards.btn_grey"]
self.getBtnGreyTx = uiMap["free_daily_rewards.btn_grey.text"]
end
function FreeDailyRewardsComp:refresh()
self.getBtnTx:setText(I18N:getGlobalText(I18N.GlobalConst.BTN_TEXT_CLAIM))
self.getBtnGreyTx:setText(I18N:getGlobalText(I18N.GlobalConst.ALREADY_GOT_DESC))
local isClaimed = DataManager.PrivilegeCardData:getIsClaimedFreeDailyReward()
local reward = GFunc.getConstCost("card_free_dailyreward")
if reward then
self.rewadCell:refreshByConfig(reward, isClaimed, isClaimed)
if isClaimed then
self.rewadCell:hideFrameAnimation()
self.rewadCell:setClickShowTips()
else
self.rewadCell:showFrameAnimation()
self.rewadCell:addClickListener(function()
ModuleManager.PrivilegeCardManager:getFreeDailyRewards()
end)
end
end
self.getBtn:setActive(not isClaimed)
if not isClaimed then
self.getBtn:addRedPoint(86, 36, 1)
else
self.getBtn:removeRedPoint()
end
self.getBtnGrey:setActive(isClaimed)
end
return FreeDailyRewardsComp

View File

@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 3417849d0efd2462587643d2c8337d92
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 11500000, guid: 3b8b241bab4a4ac9a22fcce9c64f1242, type: 3}

View File

@ -0,0 +1,180 @@
local MonthlyCardComp = class("MonthlyCardComp", LuaComponent)
function MonthlyCardComp:init()
local uiMap = self:getUIMap()
self.titleTx = uiMap["monthly_card.title_tx"]
self.titleTx:setText(I18N:getGlobalText(I18N.GlobalConst.PRIVILEGE_CARD_NAME_3))
self.descTx1 = uiMap["monthly_card.desc_bg_1.text"]
self.descTx1:setText(I18N:getGlobalText(I18N.GlobalConst.PRIVILEGE_CARD_DESC_4))
self.descTx2 = uiMap["monthly_card.desc_bg_2.text"]
self.descTx2:setText(I18N:getGlobalText(I18N.GlobalConst.PRIVILEGE_CARD_DESC_5))
self.descTx3 = uiMap["monthly_card.desc_bg_3.text"]
self.descTx3:setText(I18N:getGlobalText(I18N.GlobalConst.PRIVILEGE_CARD_DESC_6))
self.descTx4 = uiMap["monthly_card.desc_bg_4.text"]
self.descTx4:setText(I18N:getGlobalText(I18N.GlobalConst.PRIVILEGE_CARD_DESC_7))
self.descTx5 = uiMap["monthly_card.desc_tx_1"]
self.descTx6 = uiMap["monthly_card.desc_tx_2"]
self.descTx7 = uiMap["monthly_card.desc_tx_3"]
self.rewadCell1 = uiMap["monthly_card.reward_bg_1.reward_cell"]:addLuaComponent(GConst.TYPEOF_LUA_CLASS.REWARD_CELL)
self.rewadCell12 = uiMap["monthly_card.reward_bg_1.reward_cell_1"]:addLuaComponent(GConst.TYPEOF_LUA_CLASS.REWARD_CELL)
self.rewardDesc1 = uiMap["monthly_card.reward_bg_1.text"]
self.rewardDesc1:setText(I18N:getGlobalText(I18N.GlobalConst.MONTHLY_CARD_7))
self.rewadCell2 = uiMap["monthly_card.reward_bg_2.reward_cell"]:addLuaComponent(GConst.TYPEOF_LUA_CLASS.REWARD_CELL)
self.rewardDesc2 = uiMap["monthly_card.reward_bg_2.text"]
self.rewardDesc2:setText(I18N:getGlobalText(I18N.GlobalConst.PRIVILEGE_CARD_DESC_3))
self.payBtn = uiMap["monthly_card.btn_pay"]
self.payBtn:addClickListener(function()
local count = DataManager.PrivilegeCardData:getUnclaimedMonthlyCardDailyRewardCount()
if count > 0 then -- 还有奖励没领取完
ModuleManager.PrivilegeCardManager:getPurchaseCardDailyReward(GConst.ShopConst.PRIVILEGE_CARD_ID.MONTHLY_CARD)
else
local remainTime = DataManager.PrivilegeCardData:getCardRemainTime(GConst.ShopConst.PRIVILEGE_CARD_ID.MONTHLY_CARD)
if remainTime > 0 then
local isClaimed = DataManager.PrivilegeCardData:getIsClaimedMonthlyCardDailyReward()
if not isClaimed then
ModuleManager.PrivilegeCardManager:getPurchaseCardDailyReward(GConst.ShopConst.PRIVILEGE_CARD_ID.MONTHLY_CARD)
end
else
ModuleManager.PrivilegeCardManager:buyMonthlyCard()
end
end
end)
self.payBtnTx = uiMap["monthly_card.btn_pay.text"]
self.payBtnGrey = uiMap["monthly_card.btn_pay_grey"]
self.payBtnGreyTx = uiMap["monthly_card.btn_pay_grey.text"]
self.offImg = uiMap["monthly_card.off_img"]
self.offText1 = uiMap["monthly_card.off_img.text"]
self.offText2 = uiMap["monthly_card.off_img.text_2"]
self.offText2:setText(I18N:getGlobalText(I18N.GlobalConst.VALUE_DESC))
uiMap["monthly_card.ui_spine_obj"]:playAnim("idle", true, true)
end
function MonthlyCardComp:refresh()
local cfg = DataManager.ShopData:getActGiftConfig(GConst.ShopConst.PRIVILEGE_CARD_ID.MONTHLY_CARD)
if cfg == nil then
return
end
local remainTime = DataManager.PrivilegeCardData:getCardRemainTime(GConst.ShopConst.PRIVILEGE_CARD_ID.MONTHLY_CARD)
local isActive = remainTime > 0
local rewards = DataManager.PrivilegeCardData:getMonthlyCardDailyRewards()
if isActive then
self.descTx5:setText("<color=#4BFF53>" .. I18N:getGlobalText(I18N.GlobalConst.MONTHLY_CARD_12) .. "</color>")
self.descTx7:setText(I18N:getGlobalText(I18N.GlobalConst.MONTHLY_CARD_14, Time:formatNumTimeStr(remainTime)))
local isClaimed = DataManager.PrivilegeCardData:getIsClaimedMonthlyCardDailyReward()
if rewards and rewards[1] then
self.rewadCell1:refreshByConfig(rewards[1], isClaimed, isClaimed)
end
if rewards and rewards[2] then
self.rewadCell12:refreshByConfig(rewards[2], isClaimed, isClaimed)
end
if isClaimed then
self.payBtnGrey:setActive(true)
self.payBtnGreyTx:setText(I18N:getGlobalText(I18N.GlobalConst.ALREADY_GOT_DESC))
self.payBtn:setActive(false)
self.rewadCell1:hideFrameAnimation()
self.rewadCell1:clearClickListener()
self.rewadCell12:hideFrameAnimation()
self.rewadCell12:clearClickListener()
self.descTx6:setText(GConst.EMPTY_STRING)
self.payBtn:removeRedPoint()
else
self.payBtnGrey:setActive(false)
self.payBtn:setActive(true)
self.payBtnTx:setText(I18N:getGlobalText(I18N.GlobalConst.BTN_TEXT_CLAIM))
local count = DataManager.PrivilegeCardData:getUnclaimedMonthlyCardDailyRewardCount()
if count > 1 then
self.descTx6:setText("<color=#4BFF53>" .. I18N:getGlobalText(I18N.GlobalConst.PRIVILEGE_CARD_DESC_1, count) .. "</color>")
else
self.descTx6:setText(GConst.EMPTY_STRING)
end
if rewards and rewards[1] then
local num = count*rewards[1].num
self.rewadCell1:showRewardNum(GFunc.num2Str(num))
end
if rewards and rewards[2] then
local num = count*rewards[2].num
self.rewadCell12:showRewardNum(GFunc.num2Str(num))
end
self.rewadCell1:showFrameAnimation()
self.rewadCell1:addClickListener(function()
ModuleManager.PrivilegeCardManager:getPurchaseCardDailyReward(GConst.ShopConst.PRIVILEGE_CARD_ID.MONTHLY_CARD)
end)
self.rewadCell12:showFrameAnimation()
self.rewadCell12:addClickListener(function()
ModuleManager.PrivilegeCardManager:getPurchaseCardDailyReward(GConst.ShopConst.PRIVILEGE_CARD_ID.MONTHLY_CARD)
end)
self.payBtn:addRedPoint(86, 36, 1)
end
else
self.descTx5:setText(I18N:getGlobalText(I18N.GlobalConst.MONTHLY_CARD_13))
self.descTx7:setText(I18N:getGlobalText(I18N.GlobalConst.MONTHLY_CARD_15, 30))
local count = DataManager.PrivilegeCardData:getUnclaimedMonthlyCardDailyRewardCount()
if count > 0 then -- 还有奖励没领
if count > 1 then
self.descTx6:setText("<color=#4BFF53>" .. I18N:getGlobalText(I18N.GlobalConst.PRIVILEGE_CARD_DESC_1, count) .. "</color>")
else
self.descTx6:setText(GConst.EMPTY_STRING)
end
self.payBtnGrey:setActive(false)
self.payBtn:setActive(true)
self.payBtnTx:setText(I18N:getGlobalText(I18N.GlobalConst.BTN_TEXT_CLAIM))
if rewards and rewards[1] then
local num = count*rewards[1].num
self.rewadCell1:refreshByConfig(rewards[1], false, false)
self.rewadCell1:showRewardNum(GFunc.num2Str(num))
end
if rewards and rewards[2] then
local num = count*rewards[2].num
self.rewadCell12:refreshByConfig(rewards[2], false, false)
self.rewadCell12:showRewardNum(GFunc.num2Str(num))
end
self.rewadCell1:showFrameAnimation()
self.rewadCell1:addClickListener(function()
ModuleManager.PrivilegeCardManager:getPurchaseCardDailyReward(GConst.ShopConst.PRIVILEGE_CARD_ID.MONTHLY_CARD)
end)
self.rewadCell12:showFrameAnimation()
self.rewadCell12:addClickListener(function()
ModuleManager.PrivilegeCardManager:getPurchaseCardDailyReward(GConst.ShopConst.PRIVILEGE_CARD_ID.MONTHLY_CARD)
end)
else
self.descTx6:setText(GConst.EMPTY_STRING)
self.payBtnGrey:setActive(false)
self.payBtn:setActive(true)
self.payBtnTx:setText(GFunc.getFormatPrice(cfg.recharge_id))
if rewards and rewards[1] then
self.rewadCell1:refreshByConfig(rewards[1], false, false)
end
self.rewadCell1:hideFrameAnimation()
self.rewadCell1:clearClickListener()
if rewards and rewards[2] then
self.rewadCell12:refreshByConfig(rewards[2], false, false)
end
self.rewadCell12:hideFrameAnimation()
self.rewadCell12:clearClickListener()
self.payBtn:removeRedPoint()
end
end
if cfg.reward and cfg.reward[1] then
self.rewadCell2:refreshByConfig(cfg.reward[1], isActive, isActive)
end
if cfg.value then
self.offImg:setVisible(true)
self.offText1:setText(cfg.value .. "%")
else
self.offImg:setVisible(false)
end
end
function MonthlyCardComp:updateTime()
if DataManager.PrivilegeCardData:getIsMonthlyCardActive() then
local remainTime = DataManager.PrivilegeCardData:getCardRemainTime(GConst.ShopConst.PRIVILEGE_CARD_ID.MONTHLY_CARD)
self.descTx7:setText(I18N:getGlobalText(I18N.GlobalConst.MONTHLY_CARD_14, Time:formatNumTimeStr(remainTime)))
end
end
return MonthlyCardComp

View File

@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: d255b50b854e040968fd644488c3c723
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 11500000, guid: 3b8b241bab4a4ac9a22fcce9c64f1242, type: 3}

View File

@ -0,0 +1,90 @@
local MonthlyCardComp = class("MonthlyCardComp", LuaComponent)
local CELL = "app/ui/privilege/cell/card_cell"
function MonthlyCardComp:onClose()
if self.cardCell1 then
self.cardCell1:onClose()
end
if self.cardCell2 then
self.cardCell2:onClose()
end
DataManager.MonthlyCardData:markAlertTime() -- mark
end
function MonthlyCardComp:init()
local uiMap = self.baseObject:genAllChildren()
self.card1 = uiMap["monthly_card_comp.card_cell_1"]
self.card2 = uiMap["monthly_card_comp.card_cell_2"]
-- 双月卡奖励
self.doubleCardNode = uiMap["monthly_card_comp.double_card"]
self.txDoubleTitle = uiMap["monthly_card_comp.double_card.tx_title"]
self.txDoubleTips = uiMap["monthly_card_comp.double_card.tx_tips"]
self.doubleRewardCells = {}
for i = 1, 2 do
table.insert(self.doubleRewardCells, uiMap["monthly_card_comp.double_card.rewards.reward_cell_" .. i]:addLuaComponent(GConst.TYPEOF_LUA_CLASS.REWARD_CELL))
end
self.btnDoubleHelp = uiMap["monthly_card_comp.double_card.btn_help"]
self.cardCell1 = self.card1:addLuaComponent(CELL)
self.cardCell2 = self.card2:addLuaComponent(CELL)
self.btnDoubleHelp:addClickListener(function()
ModuleManager.TipsManager:showDescTips(I18N:getGlobalText(I18N.GlobalConst.MONTHLY_CARD_16), self.btnDoubleHelp)
end)
self:bind(DataManager.MonthlyCardData, "isDirty", function()
self:refresh()
end)
self:bind(DataManager.PaymentData, "isDirty", function()
self:refresh()
end)
end
function MonthlyCardComp:updateTime()
if self.cardCell1 and self.cardCell1.updateTime then
self.cardCell1:updateTime()
end
if self.cardCell2 and self.cardCell2.updateTime then
self.cardCell2:updateTime()
end
end
function MonthlyCardComp:refresh()
DataManager.MonthlyCardData:setPoped()
DataManager.MonthlyCardData:markAlertTime()-- mark
self.cardCell1:refresh(GConst.MonthlyCardConst.CARD_TYPE.CARD_1)
self.cardCell2:refresh(GConst.MonthlyCardConst.CARD_TYPE.CARD_2)
self:refreshDoubleCard()
end
function MonthlyCardComp:refreshDoubleCard()
self.txDoubleTitle:setText(I18N:getGlobalText(I18N.GlobalConst.MONTHLY_CARD_8))
self.txDoubleTips:setText(I18N:getGlobalText(I18N.GlobalConst.MONTHLY_CARD_9))
local received = DataManager.MonthlyCardData:getIsDoubleCardRewardClaimed()
local canGet = DataManager.MonthlyCardData:checkCanGetDoubleCardReward()
local rewards = DataManager.MonthlyCardData:getDoubleCardRewards()
for i, cell in ipairs(self.doubleRewardCells) do
if rewards and rewards[i] then
cell:getBaseObject():setActive(true)
cell:refreshByConfig(rewards[i], received, received)
if canGet then
cell:showFrameAnimation()
cell:addClickListener(function()
ModuleManager.MonthlyCardManager:reqGetDoubleCardReward()
end)
else
cell:hideFrameAnimation()
cell:setClickShowTips()
end
else
cell:getBaseObject():setActive(false)
end
end
end
return MonthlyCardComp

View File

@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: f5f23024c723d4c989385492f61ad3fd
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 11500000, guid: 3b8b241bab4a4ac9a22fcce9c64f1242, type: 3}

View File

@ -0,0 +1,227 @@
local MonthlyCardUI = class("MonthlyCardUI", BaseUI)
local IMG_BANNER = {
[GConst.MonthlyCardConst.CARD_TYPE.CARD_1] = "monthlycard_banner_2",
[GConst.MonthlyCardConst.CARD_TYPE.CARD_2] = "monthlycard_banner_1",
}
local IMG_TITLE = {
[GConst.MonthlyCardConst.CARD_TYPE.CARD_1] = "monthlycard_tattle_2",
[GConst.MonthlyCardConst.CARD_TYPE.CARD_2] = "monthlycard_tattle_1",
}
local TX_TITLE = {
[GConst.MonthlyCardConst.CARD_TYPE.CARD_1] = "MONTHLY_CARD_2",
[GConst.MonthlyCardConst.CARD_TYPE.CARD_2] = "MONTHLY_CARD_3",
}
local IMG_OFF = {
[GConst.MonthlyCardConst.CARD_TYPE.CARD_1] = "monthlycard_bg_4",
[GConst.MonthlyCardConst.CARD_TYPE.CARD_2] = "monthlycard_bg_3",
}
local IMG_SHOW = {
[GConst.MonthlyCardConst.CARD_TYPE.CARD_1] = {"monthlycard_dec_2" , "monthlycard_dec_3"},
[GConst.MonthlyCardConst.CARD_TYPE.CARD_2] = {"monthlycard_dec_4"},
}
local TX_SHOW = {
[GConst.MonthlyCardConst.CARD_TYPE.CARD_1] = {"MONTHLY_CARD_20" , "MONTHLY_CARD_DESC_1_1"},
[GConst.MonthlyCardConst.CARD_TYPE.CARD_2] = {"MONTHLY_CARD_2"},
}
function MonthlyCardUI:isFullScreen()
return false
end
function MonthlyCardUI:showCommonBG()
return false
end
function MonthlyCardUI:getPrefabPath()
return "assets/prefabs/ui/privilege/monthly_card_ui.prefab"
end
function MonthlyCardUI:onPressBackspace()
self:closeUI()
end
function MonthlyCardUI:onClose()
if self.callback then
self.callback()
end
end
function MonthlyCardUI:ctor(param)
self.cardType = param.cardType
self.callback = param.callback
self.showToday = param.showToday
end
function MonthlyCardUI:onLoadRootComplete()
local uiMap = self.root:genAllChildren()
self.banner = uiMap["monthly_card_ui.banner"]
self.card1Node = uiMap["monthly_card_ui.banner.card_1"]
self.txDesc1 = uiMap["monthly_card_ui.banner.card_1.tx_desc"]
self.txTips1 = uiMap["monthly_card_ui.banner.card_1.tx_tips"]
self.card2Node = uiMap["monthly_card_ui.banner.card_2"]
self.txDesc2 = uiMap["monthly_card_ui.banner.card_2.tx_desc"]
self.txTips2 = uiMap["monthly_card_ui.banner.card_2.tx_tips"]
self.titleNode = uiMap["monthly_card_ui.content.title"]
self.txTitle = uiMap["monthly_card_ui.content.title.tx_title"]
self.discountNode = uiMap["monthly_card_ui.content.discount"]
self.txDiscount = uiMap["monthly_card_ui.content.discount.tx_discount"]
self.imgShows = {}
self.txShows = {}
for i = 1, 2 do
table.insert(self.imgShows, uiMap['monthly_card_ui.content.show.img_show_' .. i])
table.insert(self.txShows, uiMap['monthly_card_ui.content.show.img_show_' .. i .. '.tx_show'])
end
self.listPrivilege = uiMap["monthly_card_ui.content.list_privilege"]
self.content = uiMap["monthly_card_ui.content.list_privilege.content"]
self.privilegeNodes = {}
self.txPrivilegeDescs = {}
for i = 1, 5 do
table.insert(self.privilegeNodes, uiMap['monthly_card_ui.content.list_privilege.content.privilege_' .. i])
table.insert(self.txPrivilegeDescs, uiMap['monthly_card_ui.content.list_privilege.content.privilege_' .. i .. '.tx_desc'])
end
self.txImmediate = uiMap["monthly_card_ui.content.immediate.tx_immediate"]
self.immediateRewardCell = uiMap["monthly_card_ui.content.immediate.reward_cell_immediate"]:addLuaComponent(GConst.TYPEOF_LUA_CLASS.REWARD_CELL)
self.txDaily = uiMap["monthly_card_ui.content.daily.tx_daily"]
self.dailyRewardCells = {}
for i = 1, 2 do
table.insert(self.dailyRewardCells, uiMap['monthly_card_ui.content.daily.reward_cell_daily_' .. i]:addLuaComponent(GConst.TYPEOF_LUA_CLASS.REWARD_CELL))
end
self.btnBuy = uiMap["monthly_card_ui.content.btn_buy"]
self.txBuy = uiMap["monthly_card_ui.content.btn_buy.tx_buy"]
self.btnClose = uiMap["monthly_card_ui.btn_close"]
-- 今日不再展示
self.todayNode = uiMap["monthly_card_ui.content.today"]
self.todatCheck = uiMap["monthly_card_ui.content.today.check"]
self.todaySelect = uiMap["monthly_card_ui.content.today.check.select"]
self.txToday = uiMap["monthly_card_ui.content.today.text"]
self.txDaily:setText(I18N:getGlobalText(I18N.GlobalConst.MONTHLY_CARD_7))
self.txImmediate:setText(I18N:getGlobalText(I18N.GlobalConst.MONTHLY_CARD_4))
self.txDesc1:setText(I18N:getGlobalText(I18N.GlobalConst.MONTHLY_CARD_20) .. "\n " .. I18N:getGlobalText(I18N.GlobalConst.MONTHLY_CARD_DESC_1_1))
self.txDesc2:setText(I18N:getGlobalText(I18N.GlobalConst.MONTHLY_CARD_21))
self.txTips1:setText(I18N:getGlobalText(I18N.GlobalConst.MONTHLY_CARD_22))
self.txTips2:setText(I18N:getGlobalText(I18N.GlobalConst.MONTHLY_CARD_22))
self.btnClose:addClickListener(function()
self:closeUI()
end)
self.btnBuy:addClickListener(function()
ModuleManager.MonthlyCardManager:buyMonthlyCard(self.cardType)
self:closeUI()
end)
self.todatCheck:addClickListener(function()
if ModuleManager.BattleManager.battleController and ModuleManager.BattleManager.battleController.battleData then
ModuleManager.BattleManager.battleController.battleData:setNotPopMonthlyCard(not LocalData:getMonthlyTodayNotShow())
end
LocalData:setMonthlyTodayNotShow(not LocalData:getMonthlyTodayNotShow())
self:onRefresh()
end)
end
function MonthlyCardUI:onRefresh()
self.banner:setSprite(GConst.ATLAS_PATH.UI_MONTHLY_CARD, IMG_BANNER[self.cardType])
self.card1Node:setActive(self.cardType == GConst.MonthlyCardConst.CARD_TYPE.CARD_1)
self.card2Node:setActive(self.cardType == GConst.MonthlyCardConst.CARD_TYPE.CARD_2)
self.titleNode:setSprite(GConst.ATLAS_PATH.UI_MONTHLY_CARD, IMG_TITLE[self.cardType])
self.discountNode:setSprite(GConst.ATLAS_PATH.UI_MONTHLY_CARD, IMG_OFF[self.cardType])
for i = 1, 2 do
if IMG_SHOW[self.cardType][i] then
self.imgShows[i]:setActive(true)
self.imgShows[i]:setSprite(GConst.ATLAS_PATH.UI_MONTHLY_CARD, IMG_SHOW[self.cardType][i], function()
self.imgShows[i]:getComponent(GConst.TYPEOF_UNITY_CLASS.UI_IMAGE):SetNativeSize()
end)
self.txShows[i]:setText(I18N:getGlobalText(I18N.GlobalConst[TX_SHOW[self.cardType][i]]))
else
self.imgShows[i]:setActive(false)
end
end
self.txTitle:setText(I18N:getGlobalText(I18N.GlobalConst[TX_TITLE[self.cardType]]))
local actGiftCfg = DataManager.MonthlyCardData:getActGiftConfig(self.cardType)
self.txBuy:setText(GFunc.getFormatPrice(actGiftCfg.recharge_id))
self.txDiscount:setText(I18N:getGlobalText(I18N.GlobalConst.ACT_MAGIC_DESC_9, actGiftCfg.value))
if self.cardType == GConst.MonthlyCardConst.CARD_TYPE.CARD_1 then
local totalHeight = 0
for i, node in ipairs(self.privilegeNodes) do
local key = I18N.GlobalConst["MONTHLY_CARD_DESC_1_" .. i]
if key then
local str = I18N:getGlobalText(key)
if str and str ~= "" then
node:setActive(true)
self.txPrivilegeDescs[i]:setText(str)
local curHeight = self.txPrivilegeDescs[i]:getComponent(GConst.TYPEOF_UNITY_CLASS.UI_TEXT_MESH_PRO).preferredHeight
curHeight = curHeight + 10
totalHeight = totalHeight + curHeight
self.txPrivilegeDescs[i]:setSizeDeltaY(curHeight)
node:setSizeDeltaY(curHeight)
else
node:setActive(false)
end
else
node:setActive(false)
end
end
self.content:setSizeDeltaY(totalHeight)
else
local totalHeight = 0
for i, node in ipairs(self.privilegeNodes) do
local key = I18N.GlobalConst["MONTHLY_CARD_DESC_2_" .. i]
if key then
local str = I18N:getGlobalText(key)
if str and str ~= "" then
node:setActive(true)
self.txPrivilegeDescs[i]:setText(str)
local curHeight = self.txPrivilegeDescs[i]:getComponent(GConst.TYPEOF_UNITY_CLASS.UI_TEXT_MESH_PRO).preferredHeight
curHeight = curHeight + 10
totalHeight = totalHeight + curHeight
self.txPrivilegeDescs[i]:setSizeDeltaY(curHeight)
node:setSizeDeltaY(curHeight)
else
node:setActive(false)
end
else
node:setActive(false)
end
end
self.content:setSizeDeltaY(totalHeight)
end
-- 每日奖励
local isActive = DataManager.MonthlyCardData:getIsCardActive(self.cardType)
local canGetDailyReward = DataManager.MonthlyCardData:checkCanGetDailyReward(self.cardType)
local dailyRewards = DataManager.MonthlyCardData:getCardDailyRewards(self.cardType)
for i, cell in ipairs(self.dailyRewardCells) do
if dailyRewards[i] then
cell:getBaseObject():setActive(true)
cell:refreshByConfig(dailyRewards[i], isActive and not canGetDailyReward, isActive and not canGetDailyReward)
if canGetDailyReward then
cell:showFrameAnimation()
cell:addClickListener(function()
ModuleManager.MonthlyCardManager:getDailyReward()
end)
else
cell:hideFrameAnimation()
cell:setClickShowTips()
end
else
cell:getBaseObject():setActive(false)
end
end
-- 购买立得
local immediateReward = DataManager.MonthlyCardData:getCardBuyReward()[1]
self.immediateRewardCell:refreshByConfig(immediateReward)
self.todayNode:setActive(self.showToday)
self.todaySelect:setActive(LocalData:getMonthlyTodayNotShow())
self.txToday:setText(I18N:getGlobalText(I18N.GlobalConst.CONFIRM_IGNORE))
GFunc.centerImgAndTx(self.todatCheck, self.txToday, 5)
end
return MonthlyCardUI

View File

@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 70ede8196ca5246a4bddd7fe446aefc2
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 11500000, guid: 3b8b241bab4a4ac9a22fcce9c64f1242, type: 3}

View File

@ -0,0 +1,240 @@
local PrivilegeMainUI = class("PrivilegeMainUI", BaseUI)
function PrivilegeMainUI:showCommonBG()
return false
end
function PrivilegeMainUI:onPressBackspace()
self:closeUI()
end
function PrivilegeMainUI:currencyParams()
local params = {}
params.showType = GConst.CURRENCY_TYPE.HORIZONTAL
params.itemIds = {
GConst.ItemConst.ITEM_ID_GOLD,
GConst.ItemConst.ITEM_ID_GEM,
GConst.ItemConst.ITEM_ID_VIT,
}
return params, true
end
function PrivilegeMainUI:getPrefabPath()
return "assets/prefabs/ui/privilege/privilege_main_ui.prefab"
end
function PrivilegeMainUI:onClose()
EventManager:dispatchEvent(EventManager.CUSTOM_EVENT.MAIN_UI_CHECK_POP)
end
function PrivilegeMainUI:ctor(param)
if param and param.showPage then
self.showPage = param.showPage
end
end
function PrivilegeMainUI:onLoadRootComplete()
local uiMap = self.root:genAllChildren()
self.btnClose = uiMap["privilege_main_ui.bottom.btn_close"]
self.scrollrectNode = uiMap["privilege_main_ui.scrollrect"]
self.content = uiMap["privilege_main_ui.scrollrect.viewport.content"]
self.freeDailyRewards = uiMap["privilege_main_ui.scrollrect.viewport.content.bg.free_daily_rewards"]
self.adCard = uiMap["privilege_main_ui.scrollrect.viewport.content.bg.ad_card"]
self.monthlyCard = uiMap["privilege_main_ui.scrollrect.viewport.content.bg.monthly_card"]
-- self.lifetimeCard = uiMap["privilege_main_ui.scrollrect.viewport.content.bg.lifetime_card"]
-- self.challegeCard = uiMap["privilege_main_ui.scrollrect.viewport.content.bg.challege_card"]
self.btnAll = uiMap["privilege_main_ui.bottom.btn_all"]
self.btnAll:addClickListener(function()
ModuleManager.PrivilegeCardManager:getPurchaseCardDailyReward(0)
end)
self.btnAllTx = uiMap["privilege_main_ui.bottom.btn_all.text"]
self.btnAllTx:setText(I18N:getGlobalText(I18N.GlobalConst.BTN_TEXT_CLAIMALL))
self.btnAllGrey = uiMap["privilege_main_ui.bottom.btn_all_grey"]
self.btnAllGreyTx = uiMap["privilege_main_ui.bottom.btn_all_grey.text"]
self.btnAllGreyTx:setText(I18N:getGlobalText(I18N.GlobalConst.ALREADY_GOT_DESC))
self:scheduleGlobal(function()
self:updateTime()
end, 1)
self.btnClose:addClickListener(function()
self:closeUI()
end)
self:bind(DataManager.PrivilegeCardData, "isDirty", function()
self:onRefresh()
self:updateCurrencyBar()
end)
self:bind(DataManager.PaymentData, "isDirty", function()
self:onRefresh()
end)
if self.page then
BIReportV2:postOperation(BIReportV2.OPERATION_UI_NAME["PRIVILEGE_CARD_" .. self.page])
else
BIReportV2:postOperation(BIReportV2.OPERATION_UI_NAME.PRIVILEGE_CARD)
end
end
function PrivilegeMainUI:updateTime()
if self.monthlyCardComp then
self.monthlyCardComp:updateTime()
end
if self.challegeCardComp then
self.challegeCardComp:updateTime()
end
end
function PrivilegeMainUI:onRefresh()
local height = -20
height = self:updateFreeDailyRewards(height)
height = self:updateAdCard(height)
height = self:updateMonthlyCard(height)
-- height = self:updateLifetimeCard(height)
-- height = self:updateChallegeCard(height)
height = height - 50
self.content:setSizeDeltaY(math.abs(height))
local scrollHeight = self.scrollrectNode:getRectHeight()
local maxPosY = math.abs(height) - scrollHeight
if self.beginPosY then
self.content:setAnchoredPositionY(math.min(maxPosY, self.beginPosY))
end
self.beginPosY = nil
self.showPage = nil
local haveUnclaimedRewards = false
if not DataManager.PrivilegeCardData:getIsClaimedFreeDailyReward() then
haveUnclaimedRewards = true
end
if DataManager.PrivilegeCardData:getIsMonthlyCardOpen() then
if DataManager.PrivilegeCardData:getIsMonthlyCardActive() then
local remainTime = DataManager.PrivilegeCardData:getCardRemainTime(GConst.ShopConst.PRIVILEGE_CARD_ID.MONTHLY_CARD)
if remainTime > 0 then
local isClaimed = DataManager.PrivilegeCardData:getIsClaimedMonthlyCardDailyReward()
if not isClaimed then
haveUnclaimedRewards = true
end
end
end
end
-- if DataManager.PrivilegeCardData:getIsLifetimeCardOpen() then
-- local isActive = DataManager.PrivilegeCardData:getIsLifetimeCardActive()
-- if isActive then
-- local isClaimed = DataManager.PrivilegeCardData:getIsClaimedLifetimeCardDailyReward()
-- if not isClaimed then
-- haveUnclaimedRewards = true
-- end
-- end
-- end
self.btnAll:setActive(haveUnclaimedRewards)
if haveUnclaimedRewards then
self.btnAll:addRedPoint(96, 36, 1)
else
self.btnAll:removeRedPoint()
end
self.btnAllGrey:setActive(not haveUnclaimedRewards)
end
function PrivilegeMainUI:updateFreeDailyRewards(offsetY)
if self.showPage == GConst.ShopConst.PRIVILEGE_SHOW_PAGE.FREE_DAILY_REWARDS then
self.beginPosY = math.abs(offsetY)
end
self.freeDailyRewards:setAnchoredPositionY(offsetY)
offsetY = offsetY - 204
local cell = self.freeDailyRewards:addLuaComponent(GConst.ShopConst.PRIVILEGE_COMP.FREE_DAILY_REWARDS)
cell:refresh()
return offsetY
end
function PrivilegeMainUI:updateAdCard(offsetY)
self.adCard:setActive(false)
if not DataManager.PrivilegeCardData:getIsAdCardOpen() then
return offsetY
end
self.adCard:setActive(true)
if self.showPage == GConst.ShopConst.PRIVILEGE_SHOW_PAGE.AD_CARD then
self.beginPosY = math.abs(offsetY)
end
self.adCard:setAnchoredPositionY(offsetY)
offsetY = offsetY - 386
local cell = self.adCard:addLuaComponent(GConst.ShopConst.PRIVILEGE_COMP.AD_CARD)
cell:refresh()
return offsetY
end
function PrivilegeMainUI:updateMonthlyCard(offsetY)
self.monthlyCard:setActive(false)
if not DataManager.PrivilegeCardData:getIsMonthlyCardOpen() then
return offsetY
end
self.monthlyCard:setActive(true)
if self.showPage == GConst.ShopConst.PRIVILEGE_SHOW_PAGE.MONTHLY_CARD then
self.beginPosY = math.abs(offsetY)
end
self.monthlyCard:setAnchoredPositionY(offsetY)
offsetY = offsetY - 456
self.monthlyCardComp = self.monthlyCard:addLuaComponent(GConst.ShopConst.PRIVILEGE_COMP.MONTHLY_CARD)
self.monthlyCardComp:refresh()
return offsetY
end
-- function PrivilegeMainUI:updateLifetimeCard(offsetY)
-- self.lifetimeCard:setActive(false)
-- if not DataManager.PrivilegeCardData:getIsLifetimeCardOpen() then
-- return offsetY
-- end
-- self.lifetimeCard:setActive(true)
-- if self.showPage == GConst.ShopConst.PRIVILEGE_SHOW_PAGE.LIFETIME_CARD then
-- self.beginPosY = math.abs(offsetY)
-- end
-- self.lifetimeCard:setAnchoredPositionY(offsetY)
-- offsetY = offsetY - 472
-- local cell = self.lifetimeCard:addLuaComponent(GConst.ShopConst.PRIVILEGE_COMP.LIFETIME_CARD)
-- cell:refresh()
-- return offsetY
-- end
-- function PrivilegeMainUI:updateChallegeCard(offsetY)
-- self.challegeCard:setActive(false)
-- if not DataManager.PrivilegeCardData:getIsChallengeCardOpen() then
-- return offsetY
-- end
-- self.challegeCard:setActive(true)
-- if self.showPage == GConst.ShopConst.PRIVILEGE_SHOW_PAGE.CHALLEGE_CARD then
-- self.beginPosY = math.abs(offsetY)
-- end
-- self.challegeCard:setAnchoredPositionY(offsetY)
-- offsetY = offsetY - 420
-- self.challegeCardComp = self.challegeCard:addLuaComponent(GConst.ShopConst.PRIVILEGE_COMP.CHALLEGE_CARD)
-- self.challegeCardComp:refresh()
-- return offsetY
-- end
function PrivilegeMainUI:refreshRedPoint()
end
function PrivilegeMainUI:isOpen(type)
end
function PrivilegeMainUI:hasRedPoint(type)
end
return PrivilegeMainUI

View File

@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 4f5ff83f80fe74f56a20bcb2f42cee19
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 11500000, guid: 3b8b241bab4a4ac9a22fcce9c64f1242, type: 3}

View File

@ -168,15 +168,15 @@ function TaskMainUI:refreshDaily()
local stageId = stageIds[i]
if stageId then
item:setActive(true)
if DataManager.DailyTaskData:isStageReceived(stageId) then
self.boxBtnSpines[i]:playAnim("idle02", true, false)
elseif DataManager.DailyTaskData:canClaimStage(stageId) then
if DataManager.DailyTaskData:canClaimStage(stageId) then
self.boxBtnSpines[i]:playAnim("ready", true, false)
item:addClickListener(function()
self.boxBtnSpines[i]:playAnimComplete("open", false, true, function()
self:onClickBox()
end)
end)
elseif DataManager.DailyTaskData:isStageReceived(stageId) then
self.boxBtnSpines[i]:playAnim("idle02", true, false)
else
self.boxBtnSpines[i]:playAnim("idle01", true, false)
item:addClickListener(function()

View File

@ -17,7 +17,7 @@ function ActSevenDayData:setDirty()
self.data.isDirty = not self.data.isDirty
end
function ActSevenDayData:initData(data, isInit)
function ActSevenDayData:initData(data)
data = data or GConst.EMPTY_TABLE
if EDITOR_MODE then
Logger.logHighlight("七天乐数据")
@ -30,24 +30,24 @@ function ActSevenDayData:initData(data, isInit)
self.scoreReceivedIds[id] = true
end
end
self.taskData = {}
self.taskData = data.tasks or {}
local claimedIdMap = {}
if data.claimed_ids then
for index, id in ipairs(data.claimed_ids) do
if data.claimed then
for index, id in ipairs(data.claimed) do
claimedIdMap[id] = true
end
end
local taskProgress = data.progress or {}
for id, info in pairs(self:getTaskCfg()) do
local maxCount = info.number or 1
local progress = taskProgress[id] or 0
if claimedIdMap[id] then
progress = maxCount
end
self.taskData[id] = {progress = progress, collect = claimedIdMap[id] == true}
end
-- local taskProgress = data.tasks or {}
-- for id, info in pairs(self:getTaskCfg()) do
-- local maxCount = info.number or 1
-- local task = taskProgress[id] or {}
-- local progress = task.progress or 0
-- if task.claimed then
-- progress = maxCount
-- end
-- self.taskData[id] = {progress = progress, collect = task.claimed or false}
-- end
if isInit then
DataManager:registerCrossDayFunc("ActSevenDayData", function()
self:setDirty()
end)
@ -57,7 +57,6 @@ function ActSevenDayData:initData(data, isInit)
self:addTaskProgress(info.type, count)
end)
end
end
self:setDirty()
end
@ -223,7 +222,7 @@ end
-- 获取任务数据
function ActSevenDayData:getTaskData(taskId)
if self.taskData[taskId] == nil then
self.taskData[taskId] = {progress = 0, collect = false}
self.taskData[taskId] = {progress = 0, claimed = 0}
end
return self.taskData[taskId]
@ -236,7 +235,7 @@ end
-- 任务是否已领取
function ActSevenDayData:isTaskReceived(taskId)
return self:getTaskData(taskId).collect or false
return self:getTaskData(taskId).claimed == 1
end
-- 任务是否可领取
@ -267,10 +266,10 @@ end
function ActSevenDayData:setTaskClaimed(taskId, ids)
if taskId then
self:getTaskData(taskId).collect = true
self:getTaskData(taskId).claimed = 1
elseif ids then
for i, taskId in ipairs(ids) do
self:getTaskData(taskId).collect = true
self:getTaskData(taskId).claimed = 1
end
end
self:setDirty()

View File

@ -323,9 +323,9 @@ end
-- 免广告或者终身卡买了都算
function PaymentData:getIsSkipAd()
-- if DataManager.PrivilegeCardData:getIsSkipAd() then
-- return true
-- end
if DataManager.PrivilegeCardData:getIsSkipAd() then
return true
end
return false
end

View File

@ -60,9 +60,9 @@ function PlayerData:init(data)
self:resetOnCrossDay()
self:setDirty()
end)
self.createTime = basicInfo.create_at or 0 -- 创角时间
self.createTime = (basicInfo.create_at or 0) // 1000 -- 创角时间
local time = data.now_ts or 0
local time = (data.now_ts or 0) // 1000
if math.abs(self.createTime - time) <= 3000 then -- 认为是新号初次登录
local vit = self:getMaxVit()
BIReport:postVitGet(vit, BIReport.ITEM_GET_TYPE.NEW_PLAYER_INITIAL, vit)
@ -241,6 +241,13 @@ function PlayerData:getCreateTime()
return self.createTime
end
-- 玩家创建角色以来的天数
function PlayerData:getCreateDay()
local time = self:getCreateTime()
time = Time:getDayBeginTimeStamp(time)
return (Time:getServerTime() - time) // GConst.SECONDS_PRE_DAY + 1
end
-- 获取玩家是否可以显示功能解锁
function PlayerData:getIfCanShowModuleUnlock()
return self.showModuleUnlockChapter > 0
@ -614,6 +621,23 @@ function PlayerData:getGameVersion()
return self.game_version
end
--region 特权卡
-- 免广告卡相关
function PlayerData:getNoAdFuncOpen()
return ModuleManager:getIsOpen(ModuleManager.MODULE_KEY.CARD_AD, true)
end
function PlayerData:getNoAdActive()
return DataManager.PrivilegeCardData:getIsCardActive(GConst.ShopConst.PRIVILEGE_CARD_ID.AD_CARD)
end
function PlayerData:getNoAdPrice()
local cfg = DataManager.ShopData:getActGiftConfig(GConst.ShopConst.PRIVILEGE_CARD_ID.AD_CARD)
if cfg == nil then
return
end
return GFunc.getFormatPrice(cfg.recharge_id)
end
--endregion
--@region 玩家经验
function PlayerData:getPlayerExpCfg()
return PlayerExpCfg

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 134ede2f0c0204029836ba869505e0f0
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,352 @@
local PrivilegeCardData = class("PrivilegeCardData", BaseData)
function PrivilegeCardData:ctor()
self.data.isDirty = false
end
function PrivilegeCardData:clear()
DataManager:unregisterCrossDayFunc("PrivilegeCardData")
end
function PrivilegeCardData:setDirty()
self.data.isDirty = not self.data.isDirty
end
function PrivilegeCardData:init(data)
if EDITOR_MODE then
Logger.logHighlight("初始化特权卡数据")
Logger.printTable(data)
end
data = data or GConst.EMPTY_TABLE
self.cardData = data.cards or {}
self.isClaimedFreeDailyReward = data.claimed
DataManager:registerCrossDayFunc("PrivilegeCardData", function()
self.isClaimedFreeDailyReward = false
if self:getIsCardActive(GConst.ShopConst.PRIVILEGE_CARD_ID.MONTHLY_CARD) then
self.cardData[GConst.ShopConst.PRIVILEGE_CARD_ID.MONTHLY_CARD].reward = (self.cardData[GConst.ShopConst.PRIVILEGE_CARD_ID.MONTHLY_CARD].reward or 0) + 1
end
if self:getIsCardActive(GConst.ShopConst.PRIVILEGE_CARD_ID.LIFETIME_CARD) then
self.cardData[GConst.ShopConst.PRIVILEGE_CARD_ID.LIFETIME_CARD].reward = (self.cardData[GConst.ShopConst.PRIVILEGE_CARD_ID.LIFETIME_CARD].reward or 0) + 1
end
self:setDirty()
end)
end
function PrivilegeCardData:getIsClaimedFreeDailyReward()
return self.isClaimedFreeDailyReward
end
function PrivilegeCardData:getIsOpen(cardId)
if GFunc.isShenhe() then
return false
end
if cardId then
if cardId == GConst.ShopConst.PRIVILEGE_CARD_ID.MONTHLY_CARD then
if not ModuleManager:getIsOpen(ModuleManager.MODULE_KEY.MONTHLY_CARD, true) then
return false
end
elseif cardId == GConst.ShopConst.PRIVILEGE_CARD_ID.AD_CARD then
if not ModuleManager:getIsOpen(ModuleManager.MODULE_KEY.AD_CARD, true) then
return false
end
elseif cardId == GConst.ShopConst.PRIVILEGE_CARD_ID.LIFETIME_CARD then
if not ModuleManager:getIsOpen(ModuleManager.MODULE_KEY.LIFETIME_CARD, true) then
return false
end
elseif cardId == GConst.ShopConst.PRIVILEGE_CARD_ID.CHALLEGE_CARD then
if not ModuleManager:getIsOpen(ModuleManager.MODULE_KEY.CHALLEGE_CARD, true) then
return false
end
end
else
local isOpen = false
for k, v in pairs(GConst.ShopConst.PRIVILEGE_CARD_ID) do
if self:getIsOpen(v) then
isOpen = true
break
end
end
return isOpen
end
return true
end
function PrivilegeCardData:onClaimedFreeDailyReward()
self.isClaimedFreeDailyReward = true
self:setDirty()
end
function PrivilegeCardData:onClaimedPurchaseCardDailyReward(id)
if id == 0 then -- 一键全领
if self.cardData[GConst.ShopConst.PRIVILEGE_CARD_ID.MONTHLY_CARD] then
self.cardData[GConst.ShopConst.PRIVILEGE_CARD_ID.MONTHLY_CARD].reward = 0
end
if self.cardData[GConst.ShopConst.PRIVILEGE_CARD_ID.LIFETIME_CARD] then
self.cardData[GConst.ShopConst.PRIVILEGE_CARD_ID.LIFETIME_CARD].reward = 0
end
elseif id == GConst.ShopConst.PRIVILEGE_CARD_ID.MONTHLY_CARD then
if self.cardData[GConst.ShopConst.PRIVILEGE_CARD_ID.MONTHLY_CARD] then
self.cardData[GConst.ShopConst.PRIVILEGE_CARD_ID.MONTHLY_CARD].reward = 0
end
elseif id == GConst.ShopConst.PRIVILEGE_CARD_ID.LIFETIME_CARD then
if self.cardData[GConst.ShopConst.PRIVILEGE_CARD_ID.LIFETIME_CARD] then
self.cardData[GConst.ShopConst.PRIVILEGE_CARD_ID.LIFETIME_CARD].reward = 0
end
end
self:setDirty()
end
function PrivilegeCardData:getIsMonthlyCardOpen()
return self:getIsOpen(GConst.ShopConst.PRIVILEGE_CARD_ID.MONTHLY_CARD)
end
function PrivilegeCardData:checkCanBuyMonthlyCard()
if self:getIsOpen(GConst.ShopConst.PRIVILEGE_CARD_ID.MONTHLY_CARD) then
local remainTime = self:getCardRemainTime(GConst.ShopConst.PRIVILEGE_CARD_ID.MONTHLY_CARD)
return remainTime <= 0
end
return false
end
function PrivilegeCardData:getIsChallengeCardOpen()
return self:getIsOpen(GConst.ShopConst.PRIVILEGE_CARD_ID.CHALLEGE_CARD)
end
function PrivilegeCardData:checkCanBuyChallengeCard()
if self:getIsOpen(GConst.ShopConst.PRIVILEGE_CARD_ID.CHALLEGE_CARD) then
local remainTime = self:getCardRemainTime(GConst.ShopConst.PRIVILEGE_CARD_ID.CHALLEGE_CARD)
return remainTime <= 0
end
return false
end
function PrivilegeCardData:getIsAdCardOpen()
return self:getIsOpen(GConst.ShopConst.PRIVILEGE_CARD_ID.AD_CARD)
end
function PrivilegeCardData:checkCanBuyAdCard()
if self:getIsOpen(GConst.ShopConst.PRIVILEGE_CARD_ID.AD_CARD) then
local data = self.cardData[GConst.ShopConst.PRIVILEGE_CARD_ID.AD_CARD]
if data == nil then
return true
end
if data.expire_at == nil then
return true
end
if data.expire_at >= 0 then
local remainTime = Time:getDayBeginTimeStamp(data.expire_at) - Time:getServerTime()
if remainTime <= 0 then
return true
end
end
end
return false
end
function PrivilegeCardData:getIsLifetimeCardOpen()
return self:getIsOpen(GConst.ShopConst.PRIVILEGE_CARD_ID.LIFETIME_CARD)
end
function PrivilegeCardData:checkCanBuyLifetimeCard()
if self:getIsOpen(GConst.ShopConst.PRIVILEGE_CARD_ID.LIFETIME_CARD) then
local data = self.cardData[GConst.ShopConst.PRIVILEGE_CARD_ID.LIFETIME_CARD]
if data == nil then
return true
end
if data.expire_at == nil then
return true
end
if data.expire_at >= 0 then
local remainTime = Time:getDayBeginTimeStamp(data.expire_at) - Time:getServerTime()
if remainTime <= 0 then
return true
end
end
end
return false
end
function PrivilegeCardData:getIsLifetimeCardActive()
return self:getIsCardActive(GConst.ShopConst.PRIVILEGE_CARD_ID.LIFETIME_CARD)
end
function PrivilegeCardData:getIsSkipAd()
if self:getIsCardActive(GConst.ShopConst.PRIVILEGE_CARD_ID.AD_CARD) then
return true
end
return false
end
function PrivilegeCardData:getIsChallegeCardActive()
return self:getIsCardActive(GConst.ShopConst.PRIVILEGE_CARD_ID.CHALLEGE_CARD)
end
function PrivilegeCardData:getIsMonthlyCardActive()
return self:getIsCardActive(GConst.ShopConst.PRIVILEGE_CARD_ID.MONTHLY_CARD)
end
function PrivilegeCardData:getIsCardActive(cardId)
if cardId == GConst.ShopConst.PRIVILEGE_CARD_ID.MONTHLY_CARD then
local remainTime = self:getCardRemainTime(cardId)
return remainTime > 0
elseif cardId == GConst.ShopConst.PRIVILEGE_CARD_ID.AD_CARD then
local data = self.cardData[cardId]
if data and data.expire_at < 0 then
return true
end
elseif cardId == GConst.ShopConst.PRIVILEGE_CARD_ID.LIFETIME_CARD then
local data = self.cardData[cardId]
if data and data.expire_at < 0 then
return true
end
elseif cardId == GConst.ShopConst.PRIVILEGE_CARD_ID.CHALLEGE_CARD then
local remainTime = self:getCardRemainTime(cardId)
return remainTime > 0
end
return false
end
function PrivilegeCardData:getCardRemainTime(cardId)
local data = self.cardData[cardId]
if data == nil or data.expire_at <= 0 then
return 0
end
local remainTime = Time:getDayBeginTimeStamp(data.expire_at) - Time:getServerTime()
if remainTime > 0 then
return remainTime
else
return 0
end
end
-- 月卡购买一次增加的累计天数
function PrivilegeCardData:getMonthlyCardOneTurnDays()
return GFunc.getConstIntValue("card_monthly_days")
end
-- 购买成功
function PrivilegeCardData:onGiftBuySuccess(cardId)
if cardId == GConst.ShopConst.PRIVILEGE_CARD_ID.MONTHLY_CARD then
if self:getIsCardActive(cardId) then
self.cardData[cardId].expire_at = self.cardData[cardId].expire_at + self:getMonthlyCardOneTurnDays() * 86400
else
self.cardData[cardId] = self.cardData[cardId] or {}
self.cardData[cardId].expire_at = Time:getServerTime() + self:getMonthlyCardOneTurnDays() * 86400
local rewardCount = self.cardData[cardId].reward or 0
if rewardCount <= 0 then
rewardCount = 1
else
rewardCount = rewardCount + 1
end
self.cardData[cardId].reward = rewardCount
end
elseif cardId == GConst.ShopConst.PRIVILEGE_CARD_ID.AD_CARD then
if not self:getIsCardActive(cardId) then
self.cardData[cardId] = self.cardData[cardId] or {}
self.cardData[cardId].expire_at = -1
end
-- 刷新广告图标
UIManager:refreshAllAdImg()
-- 局内事件
EventManager:dispatchEvent(EventManager.CUSTOM_EVENT.NO_AD_ACTIVE)
elseif cardId == GConst.ShopConst.PRIVILEGE_CARD_ID.LIFETIME_CARD then
if not self:getIsCardActive(cardId) then
self.cardData[cardId] = self.cardData[cardId] or {}
self.cardData[cardId].expire_at = -1
local rewardCount = self.cardData[cardId].reward or 0
if rewardCount <= 0 then
rewardCount = 1
else
rewardCount = rewardCount + 1
end
self.cardData[cardId].reward = rewardCount
end
elseif cardId == GConst.ShopConst.PRIVILEGE_CARD_ID.CHALLEGE_CARD then
if self:getIsCardActive(cardId) then
self.cardData[cardId].expire_at = self.cardData[cardId].expire_at + self:getMonthlyCardOneTurnDays() * 86400
else
self.cardData[cardId] = self.cardData[cardId] or {}
self.cardData[cardId].expire_at = Time:getServerTime() + self:getMonthlyCardOneTurnDays() * 86400
end
-- 购买成功添加体力
local recoveryCfg = ConfigManager:getConfig("recovery")[GConst.ItemConst.ITEM_ID_VIT]
local addVit = recoveryCfg and recoveryCfg.monthly_card or 0
DataManager.BagData.ItemData:addItemReward({type = GConst.REWARD_TYPE.ITEM, id = GConst.ItemConst.ITEM_ID_VIT, num = addVit}, BIReport.ITEM_GET_TYPE.PRIVILEGE_CHALLENGE_CARD)
end
self:setDirty()
end
function PrivilegeCardData:getRedPoint()
local haveUnclaimedRewards = false
if not self:getIsClaimedFreeDailyReward() then
haveUnclaimedRewards = true
end
if self:getIsMonthlyCardOpen() then
local remainTime = self:getCardRemainTime(GConst.ShopConst.PRIVILEGE_CARD_ID.MONTHLY_CARD)
if remainTime > 0 then
local isClaimed = self:getIsClaimedMonthlyCardDailyReward()
if not isClaimed then
haveUnclaimedRewards = true
end
end
end
if self:getIsLifetimeCardOpen() then
local isActive = self:getIsCardActive(GConst.ShopConst.PRIVILEGE_CARD_ID.LIFETIME_CARD)
if isActive then
local isClaimed = self:getIsClaimedLifetimeCardDailyReward()
if not isClaimed then
haveUnclaimedRewards = true
end
end
end
return haveUnclaimedRewards
end
-- 月卡
function PrivilegeCardData:getIsClaimedMonthlyCardDailyReward()
if self.cardData[GConst.ShopConst.PRIVILEGE_CARD_ID.MONTHLY_CARD] then
local count = self.cardData[GConst.ShopConst.PRIVILEGE_CARD_ID.MONTHLY_CARD].reward or 0
return count <= 0
end
return false
end
function PrivilegeCardData:getUnclaimedMonthlyCardDailyRewardCount()
if self.cardData[GConst.ShopConst.PRIVILEGE_CARD_ID.MONTHLY_CARD] then
return self.cardData[GConst.ShopConst.PRIVILEGE_CARD_ID.MONTHLY_CARD].reward or 0
end
return 0
end
function PrivilegeCardData:getMonthlyCardDailyRewards()
if self._monthlyCardDailyRewards == nil then
self._monthlyCardDailyRewards = GFunc.getConstCost("card_monthly_dailyreward", true)
end
return self._monthlyCardDailyRewards
end
-- 终身卡
function PrivilegeCardData:getIsClaimedLifetimeCardDailyReward()
if self.cardData[GConst.ShopConst.PRIVILEGE_CARD_ID.LIFETIME_CARD] then
local count = self.cardData[GConst.ShopConst.PRIVILEGE_CARD_ID.LIFETIME_CARD].reward or 0
return count <= 0
end
return false
end
function PrivilegeCardData:getUnclaimedLifetimeCardDailyRewardCount()
if self.cardData[GConst.ShopConst.PRIVILEGE_CARD_ID.LIFETIME_CARD] then
return self.cardData[GConst.ShopConst.PRIVILEGE_CARD_ID.LIFETIME_CARD].reward or 0
end
return 0
end
function PrivilegeCardData:getLifetimeCardDailyRewards()
if self._lifetimeCardDailyRewards == nil then
self._lifetimeCardDailyRewards = GFunc.getConstCost("card_forever_dailyreward", true)
end
return self._lifetimeCardDailyRewards
end
return PrivilegeCardData

View File

@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: c9b04b5f8fa9641edb03c27484f3e92b
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 11500000, guid: 3b8b241bab4a4ac9a22fcce9c64f1242, type: 3}