dev_chengFeng
parent
e95d071139
commit
ebca764861
|
@ -916,8 +916,9 @@ ActivityTypeDef = {
|
|||
OnlineGift = 1, --在线奖励
|
||||
SevenDayRegister = 2, --七日登录
|
||||
ChapterAward = 3, --章节奖励
|
||||
FirstRecharge = 4, --首充
|
||||
AccumulativeRecharge = 5, --累计充值
|
||||
-- FirstRecharge = 4, --首充
|
||||
-- AccumulativeRecharge = 5, --累计充值
|
||||
FirstRecharge = 5, --首充
|
||||
GrowthReward = 6, --成长礼金
|
||||
Pray = 7, --云梦祈福
|
||||
TreasureOfSomeBody = 8,--孙龙的宝藏
|
||||
|
|
|
@ -45,7 +45,7 @@ function DayRewardItem:SetValue(context,_sortingOrder)
|
|||
-- self.receivedFlag:SetActive(false)
|
||||
-- --self.redPoint:SetActive(false)
|
||||
--else
|
||||
local activityInfo = ActivityGiftManager.GetActivityTypeInfo(ActivityTypeDef.AccumulativeRecharge)
|
||||
local activityInfo = ActivityGiftManager.GetActivityTypeInfo(ActivityTypeDef.FirstRecharge)
|
||||
local AccumRecharge = 0
|
||||
for _, missInfo in pairs(activityInfo.mission) do
|
||||
if missInfo and missInfo.progress then
|
||||
|
@ -79,7 +79,7 @@ function DayRewardItem:SetValue(context,_sortingOrder)
|
|||
end
|
||||
|
||||
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)
|
||||
ActivityGiftManager.SetActivityInfo(self.context.ActivityId, self.context.Id, 1)
|
||||
self.receiveBtn.gameObject:SetActive(false)
|
||||
|
|
|
@ -20,7 +20,7 @@ end
|
|||
function this.GetFirstRechargeRedPointStatus()
|
||||
local redPoint = false
|
||||
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.GetHundredTabRedPointStatus()
|
||||
end
|
||||
|
@ -31,7 +31,7 @@ end
|
|||
function this.GetSixMoneyTabRedPointStatus()
|
||||
local redPoint = false
|
||||
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
|
||||
redPoint = redPoint or this.GetDayItemRedPoint(rewardInfo)
|
||||
end
|
||||
|
@ -42,7 +42,7 @@ end
|
|||
function this.GetHundredTabRedPointStatus()
|
||||
local redPoint = false
|
||||
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
|
||||
redPoint = redPoint or this.GetDayItemRedPoint(rewardInfo)
|
||||
end
|
||||
|
@ -51,7 +51,7 @@ function this.GetHundredTabRedPointStatus()
|
|||
end
|
||||
|
||||
function this.GetDayItemRedPoint(context)
|
||||
local activityInfo = ActivityGiftManager.GetActivityTypeInfo(ActivityTypeDef.AccumulativeRecharge)
|
||||
local activityInfo = ActivityGiftManager.GetActivityTypeInfo(ActivityTypeDef.FirstRecharge)
|
||||
local AccumRecharge = 0
|
||||
for _, missInfo in pairs(activityInfo.mission) do
|
||||
if missInfo and missInfo.progress then
|
||||
|
@ -71,7 +71,7 @@ function this.GetDayItemRedPoint(context)
|
|||
local day = GetTimePass(this.GetRechargeTime())
|
||||
--local day = GetTimePass(math.floor(GetTimeStamp()))
|
||||
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
|
||||
else
|
||||
return false
|
||||
|
@ -85,7 +85,7 @@ end
|
|||
|
||||
function this.GetReceiveAll()
|
||||
local condition = true
|
||||
local activityInfo = ActivityGiftManager.GetActivityTypeInfo(ActivityTypeDef.AccumulativeRecharge)
|
||||
local activityInfo = ActivityGiftManager.GetActivityTypeInfo(ActivityTypeDef.FirstRecharge)
|
||||
if activityInfo then
|
||||
for i = 1, #activityInfo.mission do
|
||||
local rechargeInfo = activityInfo.mission[i]
|
||||
|
@ -147,5 +147,12 @@ end
|
|||
function this.GetRechargeTime()
|
||||
return rechargeTime
|
||||
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
|
|
@ -81,7 +81,7 @@ function FirstRechargePanel:BindEvent()
|
|||
Util.AddClick(self.tenProBtn, function()
|
||||
local heroId = 0
|
||||
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]
|
||||
break
|
||||
end
|
||||
|
@ -111,7 +111,7 @@ end
|
|||
function FirstRechargePanel:OnShow()
|
||||
self:OnTabChanged(self.selectTabIndex)
|
||||
--self.reChargeTips.text = string.format("已充值 %s 元", FirstRechargeManager.GetAccumRechargeValue())
|
||||
local activityInfo = ActivityGiftManager.GetActivityTypeInfo(ActivityTypeDef.AccumulativeRecharge)
|
||||
local activityInfo = ActivityGiftManager.GetActivityTypeInfo(ActivityTypeDef.FirstRecharge)
|
||||
local AccumRecharge = 0
|
||||
for _, missInfo in pairs(activityInfo.mission) do
|
||||
if missInfo and missInfo.progress then
|
||||
|
@ -147,7 +147,7 @@ end
|
|||
function FirstRechargePanel:ShowContent(index)
|
||||
local tempData = {}
|
||||
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
|
||||
table.insert(tempData, rewardInfo)
|
||||
end
|
||||
|
|
|
@ -1037,7 +1037,10 @@ function this:OnShow()
|
|||
if not UIManager.IsOpen(UIName.PatFacePanel) then
|
||||
this.RefreshShowPatPaceActivity()
|
||||
end
|
||||
|
||||
if FirstRechargeManager.isFirstRecharge == 1 and FirstRechargeManager.PlayerPrefsGetStrItemId() == 0 then
|
||||
FirstRechargeManager.PlayerPrefsSetStrItemId(1)
|
||||
UIManager.OpenPanel(UIName.FirstRechargePanel)
|
||||
end
|
||||
-- 设置主城小人名字
|
||||
if self.playerView then
|
||||
self.playerView:SetName()
|
||||
|
|
|
@ -68,7 +68,6 @@ function MainShopPanel:BindEvent()
|
|||
Util.AddClick(this.btnBack, function()
|
||||
PlaySoundWithoutClick(SoundConfig.Sound_UICancel)
|
||||
this:ClosePanel()
|
||||
this.isOpenFirstRechargePanel()
|
||||
end)
|
||||
|
||||
end
|
||||
|
@ -96,7 +95,6 @@ function MainShopPanel:OnShow()
|
|||
if this._CurPageIndex then
|
||||
this.PageTabCtrl:ChangeTab(this._CurPageIndex)
|
||||
end
|
||||
oldAccumRecharge = this.CalculateIsFirstRecharge()
|
||||
end
|
||||
|
||||
-- 层级变化时,子界面层级刷新
|
||||
|
@ -189,21 +187,4 @@ function MainShopPanel:OnDestroy()
|
|||
-- 清除红点
|
||||
this.ClearPageRedpot()
|
||||
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
|
Loading…
Reference in New Issue