【活动优化】超值返利
parent
072edac018
commit
98a095ee46
|
@ -138,9 +138,9 @@ function this.InitActivityServerData(msg, isUpdate)
|
|||
if GlobalActivity[v.activityId] then
|
||||
this.CheckMoneyProgress(v)
|
||||
this.mission[v.activityId] = v
|
||||
-- LogYellow("刷新活动数据activityId:" .. v.activityId .. " value:" .. v.value)
|
||||
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)
|
||||
LogGreen(" 刷新活动数据missionId:" .. m.missionId .. " state:" .. m.state .. " progress:" .. m.progress)
|
||||
if (v.activityId == ActivityTypeDef.OnlineGift) then
|
||||
this.onlineOpen = true
|
||||
this.onlineGetRewardState[m.missionId] = m.state
|
||||
|
@ -531,6 +531,7 @@ function this.RefreshActivityProgressData(msg)
|
|||
if this.mission[msg.activityInfo.activityId] then
|
||||
this.mission[msg.activityInfo.activityId].value = msg.activityInfo.value
|
||||
for i = 1, #msg.activityInfo.mission do
|
||||
--LogGreen("msg.activityInfo.activityId:"..msg.activityInfo.activityId.." msg.activityInfo.mission[i].missionId:"..msg.activityInfo.mission[i].missionId.." missionInfo.state:"..msg.activityInfo.mission[i].state.." missionInfo.progress:"..msg.activityInfo.mission[i].progress)
|
||||
for _, missionInfo in pairs(this.mission[msg.activityInfo.activityId].mission) do
|
||||
if missionInfo.missionId == msg.activityInfo.mission[i].missionId then
|
||||
missionInfo.state = msg.activityInfo.mission[i].state
|
||||
|
@ -591,6 +592,7 @@ function this.RefreshActivityRedPoint()
|
|||
CheckRedPointStatus(RedPointType.FestevalRed)
|
||||
CheckRedPointStatus(RedPointType.chaozhifanli6)
|
||||
CheckRedPointStatus(RedPointType.chaozhifanli30)
|
||||
CheckRedPointStatus(RedPointType.chaozhifanli)
|
||||
end
|
||||
|
||||
function this.GetContinuityRechargeRedPoint()
|
||||
|
|
|
@ -98,6 +98,9 @@ end
|
|||
function PremiumRebatePanel:Refresh(isTop,isAni)
|
||||
--value 累计充值天数 昨天 ,,
|
||||
this.actData = ActivityGiftManager.GetActivityTypeInfo(BTNS[curPage].actType)
|
||||
table.sort(this.actData.mission,function(a,b)
|
||||
return a.missionId < b.missionId
|
||||
end)
|
||||
--this.giftData = DynamicActivityManager.GetGiftDataByType({{DataType.Direct,BTNS[curPage].goodsType,BTNS[curPage].showType}})
|
||||
this.actConfigData = ConfigManager.GetAllConfigsDataByKey(ConfigName.ActivityRewardConfig,"ActivityId",this.actData.activityId)
|
||||
local missionConfig = ConfigManager.GetConfigDataByDoubleKey(ConfigName.ActivityRewardConfig,"ActivityId",this.actData.activityId,"Sort",this.actData.value + 1)
|
||||
|
@ -107,7 +110,6 @@ function PremiumRebatePanel:Refresh(isTop,isAni)
|
|||
else
|
||||
this.leftTime.text = string.format("累计天数:%s/15",this.actData.value)
|
||||
end
|
||||
|
||||
this:SetRewardShow(isTop,isAni)
|
||||
this:SetTime()
|
||||
end
|
||||
|
@ -117,7 +119,14 @@ function PremiumRebatePanel:SetRewardShow(isTop,isAni)
|
|||
this.scrollView:SetData(this.actData.mission, function (index, item)
|
||||
this:ShowSingleHero(item, this.actData.mission[index],index)
|
||||
end,not isTop,not isAni)
|
||||
this.scrollView:SetIndex(this.actData.value + 1)
|
||||
local index = this.actData.value + 1
|
||||
for i = 1,#this.actData.mission do
|
||||
if this.actData.mission[i].state == 0 and this.actData.mission[i].progress >= activityRewardConfig[this.actData.mission[i].missionId].Values[1][1] then
|
||||
index = i
|
||||
break
|
||||
end
|
||||
end
|
||||
this.scrollView:SetIndex(index)
|
||||
end
|
||||
|
||||
function PremiumRebatePanel:ShowSingleHero(go,_data,index)
|
||||
|
@ -125,6 +134,7 @@ function PremiumRebatePanel:ShowSingleHero(go,_data,index)
|
|||
local grid = Util.GetGameObject(go, "Grid")
|
||||
local btnGet = Util.GetGameObject(go, "btnGet")
|
||||
local btnText = Util.GetGameObject(go, "btnGet/Text"):GetComponent("Text")
|
||||
local btnProgressText = Util.GetGameObject(go, "btnGet/progress"):GetComponent("Text")
|
||||
local btnImg = Util.GetGameObject(go, "btnGet"):GetComponent("Image")
|
||||
local red = Util.GetGameObject(btnImg.gameObject, "red")
|
||||
local missionConfigData = activityRewardConfig[_data.missionId]
|
||||
|
@ -134,6 +144,8 @@ function PremiumRebatePanel:ShowSingleHero(go,_data,index)
|
|||
go.gameObject:SetActive(false)
|
||||
return
|
||||
end
|
||||
btnProgressText.text = string.format("%s/%s",_data.progress,missionConfigData.Values[1][1])
|
||||
btnProgressText.gameObject:SetActive(true)
|
||||
title.text = missionConfigData.ContentsShow
|
||||
if not this.itemViewList[go] then
|
||||
this.itemViewList[go] = {}
|
||||
|
@ -152,9 +164,10 @@ function PremiumRebatePanel:ShowSingleHero(go,_data,index)
|
|||
btnText.gameObject:SetActive(true)
|
||||
red.gameObject:SetActive(false)
|
||||
btnText.text = "前往"--_data.data.price
|
||||
if _data.state == 0 and index == this.actData.value + 1 then
|
||||
if _data.state == 0 and index <= this.actData.value + 1 then
|
||||
Util.SetGray(btnGet,false)
|
||||
if _data.progress >= missionConfigData.Values[1][1] then
|
||||
btnText.text = "领取"--_data.data.price
|
||||
red.gameObject:SetActive(true)
|
||||
Util.AddOnceClick(btnGet,function ()
|
||||
-- PayManager.Pay(_data.data.shopData.goodsId, function(id)
|
||||
|
@ -179,8 +192,9 @@ function PremiumRebatePanel:ShowSingleHero(go,_data,index)
|
|||
end)
|
||||
end
|
||||
elseif _data.state == 1 then
|
||||
Util.SetGray(btnGet,true)
|
||||
Util.SetGray(btnGet,false)
|
||||
btnText.text = "已领取"
|
||||
btnProgressText.gameObject:SetActive(false)
|
||||
Util.AddOnceClick(btnGet,function ()
|
||||
|
||||
end)
|
||||
|
|
|
@ -847,15 +847,15 @@ end
|
|||
function this.CheckRedPointPremium()
|
||||
local day = TimeToD(GetTimeStamp())
|
||||
if ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.chaozhifanli) then
|
||||
if PlayerPrefs.GetInt("chaozhifanli"..PlayerManager.uid) ~= day then
|
||||
return true
|
||||
else
|
||||
-- if PlayerPrefs.GetInt("chaozhifanli"..PlayerManager.uid) ~= day then
|
||||
-- return true
|
||||
-- else
|
||||
if this.CheckRedPointPremiumSingle(ActivityTypeDef.chaozhifanli) then
|
||||
return true
|
||||
else
|
||||
return this.CheckRedPointPremiumSingle(ActivityTypeDef.chaozhifanli30)
|
||||
end
|
||||
end
|
||||
--end
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
@ -864,7 +864,7 @@ function this.CheckRedPointPremiumSingle(activityType)
|
|||
local actType = activityType
|
||||
if activityType == RedPointType.chaozhifanli6 then
|
||||
actType = ActivityTypeDef.chaozhifanli
|
||||
else
|
||||
elseif activityType == RedPointType.chaozhifanli30 then
|
||||
actType = ActivityTypeDef.chaozhifanli30
|
||||
end
|
||||
local actdata = ActivityGiftManager.GetActivityTypeInfo(actType)
|
||||
|
|
|
@ -653,6 +653,8 @@ function this.RegisterRedCheckFunc()
|
|||
RPData:AddCheckFunc(RedPointType.ExploreFunc,ExploreManager.CheckRedPoint)
|
||||
|
||||
RPData:AddCheckFunc(RedPointType.chaozhifanli,DynamicActivityManager.CheckRedPointPremium)
|
||||
RPData:AddCheckFunc(RedPointType.chaozhifanli6,DynamicActivityManager.CheckRedPointPremiumSingle)
|
||||
RPData:AddCheckFunc(RedPointType.chaozhifanli30,DynamicActivityManager.CheckRedPointPremiumSingle)
|
||||
--家园
|
||||
RPData:AddCheckFunc(RedPointType.HomeLand,HomeLandManager.CheckRedMain,FUNCTION_OPEN_TYPE.HOMELAND)
|
||||
RPData:AddCheckFunc(RedPointType.FestevalRed,ActivityGiftManager.FestevalRedCheck)
|
||||
|
|
Loading…
Reference in New Issue