【限时活动】调整提交
parent
5043002676
commit
30361f5393
|
@ -6,7 +6,7 @@ AnimationClip:
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
m_PrefabInstance: {fileID: 0}
|
m_PrefabInstance: {fileID: 0}
|
||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
m_Name: waixuan_UI
|
m_Name: waixuan_UI_anim
|
||||||
serializedVersion: 6
|
serializedVersion: 6
|
||||||
m_Legacy: 0
|
m_Legacy: 0
|
||||||
m_Compressed: 0
|
m_Compressed: 0
|
||||||
|
|
|
@ -138,12 +138,6 @@ function this.InitActivityServerData(msg, isUpdate)
|
||||||
|
|
||||||
this.CheckMoneyProgress(v)
|
this.CheckMoneyProgress(v)
|
||||||
this.mission[v.activityId] = v
|
this.mission[v.activityId] = v
|
||||||
if v.activityId == 2603 then
|
|
||||||
LogYellow("刷新活动数据activityId:" .. v.activityId .. " value:" .. v.value)
|
|
||||||
for n, m in ipairs(v.mission) do
|
|
||||||
LogGreen(" 刷新活动数据missionId:" .. m.missionId .. " state:" .. m.state .. " progress:" .. m.progress)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
LogYellow("刷新活动数据activityId:" .. v.activityId .. " value:" .. v.value)
|
LogYellow("刷新活动数据activityId:" .. v.activityId .. " value:" .. v.value)
|
||||||
for n, m in ipairs(v.mission) do
|
for n, m in ipairs(v.mission) do
|
||||||
--LogGreen(" 刷新活动数据missionId:" .. m.missionId .. " state:" .. m.state .. " progress:" .. m.progress)
|
--LogGreen(" 刷新活动数据missionId:" .. m.missionId .. " state:" .. m.state .. " progress:" .. m.progress)
|
||||||
|
|
|
@ -51,12 +51,55 @@ function ActivityMainPanel:RemoveListener()
|
||||||
Game.GlobalEvent:RemoveEvent(GameEvent.Activity.OnActivityOpenOrClose, this.OnShow)
|
Game.GlobalEvent:RemoveEvent(GameEvent.Activity.OnActivityOpenOrClose, this.OnShow)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function ActivityMainPanel:CheckActOpen(_index)
|
||||||
|
if tabs[_index].IfBack == 1 then
|
||||||
|
if tabs[_index].ActiveType > 0 then
|
||||||
|
local id = ActivityGiftManager.IsActivityTypeOpen(tabs[_index].ActiveType)
|
||||||
|
if id and id > 0 and ActivityGiftManager.IsQualifiled(tabs[_index].ActiveType) then
|
||||||
|
_CurPageIndex = _index
|
||||||
|
end
|
||||||
|
elseif tabs[_index].FunType > 0 then
|
||||||
|
if ActTimeCtrlManager.SingleFuncState(tabs[_index].FunType) then
|
||||||
|
_CurPageIndex = _index
|
||||||
|
end
|
||||||
|
else
|
||||||
|
_CurPageIndex = _index
|
||||||
|
end
|
||||||
|
else
|
||||||
|
if tabs[_index].ActiveType > 0 then
|
||||||
|
local id = ActivityGiftManager.IsActivityTypeOpen(tabs[_index].ActiveType)
|
||||||
|
if id and id > 0 and ActivityGiftManager.IsQualifiled(tabs[_index].ActiveType) then
|
||||||
|
_CurPageIndex = _index
|
||||||
|
end
|
||||||
|
elseif tabs[_index].FunType > 0 then
|
||||||
|
if ActTimeCtrlManager.SingleFuncState(tabs[_index].FunType) then
|
||||||
|
_CurPageIndex = _index
|
||||||
|
end
|
||||||
|
else
|
||||||
|
_CurPageIndex = _index
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
--界面打开时调用(用于子类重写)
|
--界面打开时调用(用于子类重写)
|
||||||
function ActivityMainPanel:OnOpen(_activityType,_index)
|
function ActivityMainPanel:OnOpen(_activityType,_index)
|
||||||
this.activityType = _activityType
|
this.activityType = _activityType
|
||||||
_CurPageIndex = _index
|
|
||||||
DynamicActivityManager.curActivityType = this.activityType
|
DynamicActivityManager.curActivityType = this.activityType
|
||||||
tabs = DynamicActivityManager.GetActivityTableDataByPageInde(this.activityType)
|
tabs = DynamicActivityManager.GetActivityTableDataByPageInde(this.activityType)
|
||||||
|
_CurPageIndex = 0
|
||||||
|
if _index and _index > 0 then
|
||||||
|
self:CheckActOpen(_index)
|
||||||
|
LogPink("_index:"..tostring(_index))
|
||||||
|
end
|
||||||
|
for index = 1, #tabs do
|
||||||
|
if _CurPageIndex < 1 then
|
||||||
|
self:CheckActOpen(index)
|
||||||
|
LogYellow("_index:"..tostring(index).." _CurPageIndex:"..tostring(_CurPageIndex))
|
||||||
|
else
|
||||||
|
LogGreen("Break _CurPageIndex:"..tostring(_CurPageIndex))
|
||||||
|
break
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- 打开,重新打开时回调
|
-- 打开,重新打开时回调
|
||||||
|
|
|
@ -6,7 +6,7 @@ function this.Initialize()
|
||||||
end
|
end
|
||||||
|
|
||||||
--初始化活动的特殊数据
|
--初始化活动的特殊数据
|
||||||
local TypeInitFunc = {
|
local TypeUpdateFunc = {
|
||||||
[ActivityTypeDef.YunYouShangRen] = function ()
|
[ActivityTypeDef.YunYouShangRen] = function ()
|
||||||
local curData = dataList[ActivityTypeDef.YunYouShangRen]
|
local curData = dataList[ActivityTypeDef.YunYouShangRen]
|
||||||
local configData = ConfigManager.GetAllConfigsDataByKey(ConfigName.ComposeActivity,"ActivityId",curData.activityId)
|
local configData = ConfigManager.GetAllConfigsDataByKey(ConfigName.ComposeActivity,"ActivityId",curData.activityId)
|
||||||
|
@ -20,6 +20,13 @@ local TypeInitFunc = {
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
table.sort(dataList[ActivityTypeDef.YunYouShangRen].rewards,function (a,b)
|
||||||
|
if a.progress == b.progress then
|
||||||
|
return a.missionId < b.missionId
|
||||||
|
else
|
||||||
|
return a.progress > b.progress
|
||||||
|
end
|
||||||
|
end)
|
||||||
end,
|
end,
|
||||||
[ActivityTypeDef.ContinuityRecharge] = function ()
|
[ActivityTypeDef.ContinuityRecharge] = function ()
|
||||||
this.GetExpertData(3,ActivityTypeDef.ContinuityRecharge)
|
this.GetExpertData(3,ActivityTypeDef.ContinuityRecharge)
|
||||||
|
@ -79,7 +86,8 @@ local TypeInitFunc = {
|
||||||
|
|
||||||
function this.GetExpertData(indexType,actType)
|
function this.GetExpertData(indexType,actType)
|
||||||
local curData = dataList[actType]
|
local curData = dataList[actType]
|
||||||
local actRewardConfigs = ConfigManager.GetAllConfigsDataByKey(ConfigName.ActivityRewardConfig,"ActivityId", actType)
|
local actId = ActivityGiftManager.GetActivityIdByType(actType)
|
||||||
|
local actRewardConfigs = ConfigManager.GetAllConfigsDataByKey(ConfigName.ActivityRewardConfig,"ActivityId", actId)
|
||||||
for i = 1, #curData.rewards do
|
for i = 1, #curData.rewards do
|
||||||
for j = 1, #actRewardConfigs do
|
for j = 1, #actRewardConfigs do
|
||||||
if curData.rewards[i].missionId == actRewardConfigs[j].Id then
|
if curData.rewards[i].missionId == actRewardConfigs[j].Id then
|
||||||
|
@ -88,32 +96,34 @@ function this.GetExpertData(indexType,actType)
|
||||||
if curData.rewards[i].state == 1 then
|
if curData.rewards[i].state == 1 then
|
||||||
curData.rewards[i].otherData.state = 2
|
curData.rewards[i].otherData.state = 2
|
||||||
elseif curData.rewards[i].progress == 1 then
|
elseif curData.rewards[i].progress == 1 then
|
||||||
curData.rewards[i].otherData.state = 1
|
|
||||||
else
|
|
||||||
curData.rewards[i].otherData.state = 0
|
curData.rewards[i].otherData.state = 0
|
||||||
|
else
|
||||||
|
curData.rewards[i].otherData.state = 1
|
||||||
end
|
end
|
||||||
curData.rewards[i].otherData.info = string.format("%s/%s",curData.rewards[i].progress,curData.rewards[i].otherData.Values)
|
curData.rewards[i].otherData.info = string.format("%s/%s",curData.rewards[i].progress,curData.rewards[i].otherData.Values)
|
||||||
else --日累计充值 达人
|
else --日累计充值 达人
|
||||||
if actType == ActivityTypeDef.AccumulativeRechargeExper then
|
if actType == ActivityTypeDef.AccumulativeRechargeExper then
|
||||||
curData.rewards[i].otherData.Values = actRewardConfigs[j].Values[1][1]
|
curData.rewards[i].otherData.Values = actRewardConfigs[j].Values[1][1]
|
||||||
elseif actType == ActivityTypeDef.ContinuityRecharge then
|
else
|
||||||
curData.rewards[i].otherData.Values = actRewardConfigs[j].Values[2][1]
|
curData.rewards[i].otherData.Values = actRewardConfigs[j].Values[2][1]
|
||||||
end
|
end
|
||||||
if curData.rewards[i].state == 1 then
|
if curData.rewards[i].state == 1 then
|
||||||
curData.rewards[i].otherData.state = 2
|
curData.rewards[i].otherData.state = 2
|
||||||
|
curData.rewards[i].otherData.info = string.format("%s/%s",curData.rewards[i].otherData.Values,curData.rewards[i].otherData.Values)
|
||||||
else
|
else
|
||||||
if indexType == 1 then
|
if indexType == 1 then
|
||||||
if curData.rewards[i].progress < curData.rewards[i].otherData.Values then
|
if curData.rewards[i].progress < curData.rewards[i].otherData.Values then
|
||||||
curData.rewards[i].otherData.state = 0
|
|
||||||
else
|
|
||||||
curData.rewards[i].otherData.state = 1
|
curData.rewards[i].otherData.state = 1
|
||||||
|
else
|
||||||
|
curData.rewards[i].otherData.state = 0
|
||||||
end
|
end
|
||||||
curData.rewardends[i].otherData.info = string.format("%s/%s",curData.rewards[i].progress,curData.rewards[i].otherData.Values)
|
curData.rewards[i].otherData.info = string.format("%s/%s",curData.rewards[i].progress,curData.rewards[i].otherData.Values)
|
||||||
elseif indexType == 2 then
|
elseif indexType == 2 then
|
||||||
|
-- LogPink("curData.value:"..tostring(curData.value).." "..tostring(curData.rewards[i].otherData.Values))
|
||||||
if curData.value < curData.rewards[i].otherData.Values then
|
if curData.value < curData.rewards[i].otherData.Values then
|
||||||
curData.rewards[i].otherData.state = 0
|
|
||||||
else
|
|
||||||
curData.rewards[i].otherData.state = 1
|
curData.rewards[i].otherData.state = 1
|
||||||
|
else
|
||||||
|
curData.rewards[i].otherData.state = 0
|
||||||
end
|
end
|
||||||
curData.rewards[i].otherData.info = string.format("%s/%s",curData.value,curData.rewards[i].otherData.Values)
|
curData.rewards[i].otherData.info = string.format("%s/%s",curData.value,curData.rewards[i].otherData.Values)
|
||||||
end
|
end
|
||||||
|
@ -127,24 +137,9 @@ function this.GetExpertData(indexType,actType)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
--数据刷新时是否需要前端自己刷新,如果有就写里面
|
|
||||||
local TypeUpdateFunc = {
|
|
||||||
[ActivityTypeDef.YunYouShangRen] = function ()
|
|
||||||
local curData = dataList[ActivityTypeDef.YunYouShangRen]
|
|
||||||
for i = 1, #curData.rewards do
|
|
||||||
curData.rewards[i].otherData.selectId = 0
|
|
||||||
end
|
|
||||||
end
|
|
||||||
}
|
|
||||||
|
|
||||||
function this.GetData(actType)
|
function this.GetData(actType)
|
||||||
if not dataList[actType] then
|
if not dataList[actType] then
|
||||||
dataList[actType] = this.InitSingleTypeData(actType)
|
dataList[actType] = this.InitSingleTypeData(actType)
|
||||||
if TypeInitFunc[actType] then
|
|
||||||
TypeInitFunc[actType]()
|
|
||||||
else
|
|
||||||
TypeInitFunc[-1]()
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
this.UpdateSingleTypeData(actType)
|
this.UpdateSingleTypeData(actType)
|
||||||
if TypeUpdateFunc[actType] then
|
if TypeUpdateFunc[actType] then
|
||||||
|
@ -156,7 +151,7 @@ end
|
||||||
function this.InitSingleTypeData(actType)
|
function this.InitSingleTypeData(actType)
|
||||||
local singleTypeData = {}
|
local singleTypeData = {}
|
||||||
local data = ActivityGiftManager.GetActivityTypeInfo(actType)
|
local data = ActivityGiftManager.GetActivityTypeInfo(actType)
|
||||||
-- LogYellow("InitData activityId:"..tostring(data.activityId).." value:"..tostring(data.value).." startTime:"..tostring(data.startTime).." endTime:"..tostring(data.endTime))
|
LogYellow("InitData activityId:"..tostring(data.activityId).." value:"..tostring(data.value).." startTime:"..tostring(data.startTime).." endTime:"..tostring(data.endTime))
|
||||||
singleTypeData.activityId = data.activityId
|
singleTypeData.activityId = data.activityId
|
||||||
singleTypeData.value = data.value
|
singleTypeData.value = data.value
|
||||||
singleTypeData.startTime = data.startTime
|
singleTypeData.startTime = data.startTime
|
||||||
|
@ -189,13 +184,6 @@ function this.UpdateSingleTypeData(actType)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
table.sort(dataList[actType].rewards,function (a,b)
|
|
||||||
if a.progress == b.progress then
|
|
||||||
return a.missionId < b.missionId
|
|
||||||
else
|
|
||||||
return a.progress > b.progress
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
return CommonActPageManager
|
return CommonActPageManager
|
|
@ -76,7 +76,7 @@ function ExpertPre:SetButton()
|
||||||
if self.data.otherData.state == 0 then
|
if self.data.otherData.state == 0 then
|
||||||
NetManager.GetActivityRewardRequest(self.data.missionId, self.activityId, function(drop)
|
NetManager.GetActivityRewardRequest(self.data.missionId, self.activityId, function(drop)
|
||||||
UIManager.OpenPanel(UIName.RewardItemPopup,drop,1,function()
|
UIManager.OpenPanel(UIName.RewardItemPopup,drop,1,function()
|
||||||
self.parent:RefreshActData(true,false)
|
self.parent:RefreshData(true,false)
|
||||||
CheckRedPointStatus(RedPointType.Expert_FastExplore)
|
CheckRedPointStatus(RedPointType.Expert_FastExplore)
|
||||||
end)
|
end)
|
||||||
end)
|
end)
|
||||||
|
|
Loading…
Reference in New Issue