dev_chengFeng
zhangqiang 2020-07-17 11:27:03 +08:00
parent e95d071139
commit ebca764861
6 changed files with 26 additions and 34 deletions

View File

@ -916,8 +916,9 @@ ActivityTypeDef = {
OnlineGift = 1, --在线奖励 OnlineGift = 1, --在线奖励
SevenDayRegister = 2, --七日登录 SevenDayRegister = 2, --七日登录
ChapterAward = 3, --章节奖励 ChapterAward = 3, --章节奖励
FirstRecharge = 4, --首充 -- FirstRecharge = 4, --首充
AccumulativeRecharge = 5, --累计充值 -- AccumulativeRecharge = 5, --累计充值
FirstRecharge = 5, --首充
GrowthReward = 6, --成长礼金 GrowthReward = 6, --成长礼金
Pray = 7, --云梦祈福 Pray = 7, --云梦祈福
TreasureOfSomeBody = 8,--孙龙的宝藏 TreasureOfSomeBody = 8,--孙龙的宝藏

View File

@ -45,7 +45,7 @@ function DayRewardItem:SetValue(context,_sortingOrder)
-- self.receivedFlag:SetActive(false) -- self.receivedFlag:SetActive(false)
-- --self.redPoint:SetActive(false) -- --self.redPoint:SetActive(false)
--else --else
local activityInfo = ActivityGiftManager.GetActivityTypeInfo(ActivityTypeDef.AccumulativeRecharge) local activityInfo = ActivityGiftManager.GetActivityTypeInfo(ActivityTypeDef.FirstRecharge)
local AccumRecharge = 0 local AccumRecharge = 0
for _, missInfo in pairs(activityInfo.mission) do for _, missInfo in pairs(activityInfo.mission) do
if missInfo and missInfo.progress then if missInfo and missInfo.progress then
@ -79,7 +79,7 @@ function DayRewardItem:SetValue(context,_sortingOrder)
end end
function DayRewardItem:OnReceivedBtnClicked() function DayRewardItem:OnReceivedBtnClicked()
NetManager.GetActivityRewardRequest(self.context.Id,ActivityTypeDef.AccumulativeRecharge, function(drop) NetManager.GetActivityRewardRequest(self.context.Id,ActivityTypeDef.FirstRecharge, function(drop)
UIManager.OpenPanel(UIName.RewardItemPopup, drop, 1) UIManager.OpenPanel(UIName.RewardItemPopup, drop, 1)
ActivityGiftManager.SetActivityInfo(self.context.ActivityId, self.context.Id, 1) ActivityGiftManager.SetActivityInfo(self.context.ActivityId, self.context.Id, 1)
self.receiveBtn.gameObject:SetActive(false) self.receiveBtn.gameObject:SetActive(false)

View File

@ -20,7 +20,7 @@ end
function this.GetFirstRechargeRedPointStatus() function this.GetFirstRechargeRedPointStatus()
local redPoint = false local redPoint = false
if ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.FirstRecharge) then if ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.FirstRecharge) then
if ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.AccumulativeRecharge) then if ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.FirstRecharge) then
redPoint = redPoint or this.GetSixMoneyTabRedPointStatus() redPoint = redPoint or this.GetSixMoneyTabRedPointStatus()
redPoint = redPoint or this.GetHundredTabRedPointStatus() redPoint = redPoint or this.GetHundredTabRedPointStatus()
end end
@ -31,7 +31,7 @@ end
function this.GetSixMoneyTabRedPointStatus() function this.GetSixMoneyTabRedPointStatus()
local redPoint = false local redPoint = false
for _, rewardInfo in ConfigPairs(activityRewardConfig) do for _, rewardInfo in ConfigPairs(activityRewardConfig) do
if rewardInfo.ActivityId == ActivityTypeDef.AccumulativeRecharge and if rewardInfo.ActivityId == ActivityTypeDef.FirstRecharge and
rewardInfo.Values[1][1] == IndexValueDef[1] then rewardInfo.Values[1][1] == IndexValueDef[1] then
redPoint = redPoint or this.GetDayItemRedPoint(rewardInfo) redPoint = redPoint or this.GetDayItemRedPoint(rewardInfo)
end end
@ -42,7 +42,7 @@ end
function this.GetHundredTabRedPointStatus() function this.GetHundredTabRedPointStatus()
local redPoint = false local redPoint = false
for _, rewardInfo in ConfigPairs(activityRewardConfig) do for _, rewardInfo in ConfigPairs(activityRewardConfig) do
if rewardInfo.ActivityId == ActivityTypeDef.AccumulativeRecharge and if rewardInfo.ActivityId == ActivityTypeDef.FirstRecharge and
rewardInfo.Values[1][1] == IndexValueDef[2] then rewardInfo.Values[1][1] == IndexValueDef[2] then
redPoint = redPoint or this.GetDayItemRedPoint(rewardInfo) redPoint = redPoint or this.GetDayItemRedPoint(rewardInfo)
end end
@ -51,7 +51,7 @@ function this.GetHundredTabRedPointStatus()
end end
function this.GetDayItemRedPoint(context) function this.GetDayItemRedPoint(context)
local activityInfo = ActivityGiftManager.GetActivityTypeInfo(ActivityTypeDef.AccumulativeRecharge) local activityInfo = ActivityGiftManager.GetActivityTypeInfo(ActivityTypeDef.FirstRecharge)
local AccumRecharge = 0 local AccumRecharge = 0
for _, missInfo in pairs(activityInfo.mission) do for _, missInfo in pairs(activityInfo.mission) do
if missInfo and missInfo.progress then if missInfo and missInfo.progress then
@ -71,7 +71,7 @@ function this.GetDayItemRedPoint(context)
local day = GetTimePass(this.GetRechargeTime()) local day = GetTimePass(this.GetRechargeTime())
--local day = GetTimePass(math.floor(GetTimeStamp())) --local day = GetTimePass(math.floor(GetTimeStamp()))
if context.Values[1][2] <= day then if context.Values[1][2] <= day then
local state = ActivityGiftManager.GetActivityInfo(ActivityTypeDef.AccumulativeRecharge, context.Id).state local state = ActivityGiftManager.GetActivityInfo(ActivityTypeDef.FirstRecharge, context.Id).state
return state ~= 1 return state ~= 1
else else
return false return false
@ -85,7 +85,7 @@ end
function this.GetReceiveAll() function this.GetReceiveAll()
local condition = true local condition = true
local activityInfo = ActivityGiftManager.GetActivityTypeInfo(ActivityTypeDef.AccumulativeRecharge) local activityInfo = ActivityGiftManager.GetActivityTypeInfo(ActivityTypeDef.FirstRecharge)
if activityInfo then if activityInfo then
for i = 1, #activityInfo.mission do for i = 1, #activityInfo.mission do
local rechargeInfo = activityInfo.mission[i] local rechargeInfo = activityInfo.mission[i]
@ -147,5 +147,12 @@ end
function this.GetRechargeTime() function this.GetRechargeTime()
return rechargeTime return rechargeTime
end end
--设置红点存储本地
function this.PlayerPrefsSetStrItemId(val)
PlayerPrefs.SetInt(PlayerManager.uid.."FirstRechatgePace", val)
end
--获得红点信息
function this.PlayerPrefsGetStrItemId()
return PlayerPrefs.GetInt(PlayerManager.uid.."FirstRechatgePace", 0)--1 已经查看过不需要显示新红点 0 显示红点
end
return this return this

View File

@ -81,7 +81,7 @@ function FirstRechargePanel:BindEvent()
Util.AddClick(self.tenProBtn, function() Util.AddClick(self.tenProBtn, function()
local heroId = 0 local heroId = 0
for _, rewardInfo in ConfigPairs(activityRewardConfig) do for _, rewardInfo in ConfigPairs(activityRewardConfig) do
if rewardInfo.ActivityId == 5 then--ActivityTypeDef.AccumulativeRecharge then if rewardInfo.ActivityId == ActivityTypeDef.FirstRecharge then--ActivityTypeDef.AccumulativeRecharge then
heroId = rewardInfo.Reward[1][1] heroId = rewardInfo.Reward[1][1]
break break
end end
@ -111,7 +111,7 @@ end
function FirstRechargePanel:OnShow() function FirstRechargePanel:OnShow()
self:OnTabChanged(self.selectTabIndex) self:OnTabChanged(self.selectTabIndex)
--self.reChargeTips.text = string.format("已充值 %s 元", FirstRechargeManager.GetAccumRechargeValue()) --self.reChargeTips.text = string.format("已充值 %s 元", FirstRechargeManager.GetAccumRechargeValue())
local activityInfo = ActivityGiftManager.GetActivityTypeInfo(ActivityTypeDef.AccumulativeRecharge) local activityInfo = ActivityGiftManager.GetActivityTypeInfo(ActivityTypeDef.FirstRecharge)
local AccumRecharge = 0 local AccumRecharge = 0
for _, missInfo in pairs(activityInfo.mission) do for _, missInfo in pairs(activityInfo.mission) do
if missInfo and missInfo.progress then if missInfo and missInfo.progress then
@ -147,7 +147,7 @@ end
function FirstRechargePanel:ShowContent(index) function FirstRechargePanel:ShowContent(index)
local tempData = {} local tempData = {}
for _, rewardInfo in ConfigPairs(activityRewardConfig) do for _, rewardInfo in ConfigPairs(activityRewardConfig) do
if rewardInfo.ActivityId == ActivityTypeDef.AccumulativeRecharge and if rewardInfo.ActivityId == ActivityTypeDef.FirstRecharge and
rewardInfo.Values[1][1] == IndexValueDef[index] then rewardInfo.Values[1][1] == IndexValueDef[index] then
table.insert(tempData, rewardInfo) table.insert(tempData, rewardInfo)
end end

View File

@ -1037,7 +1037,10 @@ function this:OnShow()
if not UIManager.IsOpen(UIName.PatFacePanel) then if not UIManager.IsOpen(UIName.PatFacePanel) then
this.RefreshShowPatPaceActivity() this.RefreshShowPatPaceActivity()
end end
if FirstRechargeManager.isFirstRecharge == 1 and FirstRechargeManager.PlayerPrefsGetStrItemId() == 0 then
FirstRechargeManager.PlayerPrefsSetStrItemId(1)
UIManager.OpenPanel(UIName.FirstRechargePanel)
end
-- 设置主城小人名字 -- 设置主城小人名字
if self.playerView then if self.playerView then
self.playerView:SetName() self.playerView:SetName()

View File

@ -68,7 +68,6 @@ function MainShopPanel:BindEvent()
Util.AddClick(this.btnBack, function() Util.AddClick(this.btnBack, function()
PlaySoundWithoutClick(SoundConfig.Sound_UICancel) PlaySoundWithoutClick(SoundConfig.Sound_UICancel)
this:ClosePanel() this:ClosePanel()
this.isOpenFirstRechargePanel()
end) end)
end end
@ -96,7 +95,6 @@ function MainShopPanel:OnShow()
if this._CurPageIndex then if this._CurPageIndex then
this.PageTabCtrl:ChangeTab(this._CurPageIndex) this.PageTabCtrl:ChangeTab(this._CurPageIndex)
end end
oldAccumRecharge = this.CalculateIsFirstRecharge()
end end
-- 层级变化时,子界面层级刷新 -- 层级变化时,子界面层级刷新
@ -189,21 +187,4 @@ function MainShopPanel:OnDestroy()
-- 清除红点 -- 清除红点
this.ClearPageRedpot() this.ClearPageRedpot()
end end
function this.isOpenFirstRechargePanel()
if oldAccumRecharge == 0 then
if this.CalculateIsFirstRecharge() > 0 then
UIManager.OpenPanel(UIName.FirstRechargePanel)
end
end
end
function this.CalculateIsFirstRecharge()
local activityInfo = ActivityGiftManager.GetActivityTypeInfo(ActivityTypeDef.AccumulativeRecharge)
local AccumRecharge = 0
for _, missInfo in pairs(activityInfo.mission) do
if missInfo and missInfo.progress then
AccumRecharge = missInfo.progress
end
end
return AccumRecharge
end
return MainShopPanel return MainShopPanel