Merge branch 'master_develop' of http://60.1.1.230/gaoxin/JL_Client into master_develop
# Conflicts: # data_execl/base_data/GlobalActivity.xlsxdev_chengFeng
commit
7ce2e1423a
File diff suppressed because it is too large
Load Diff
|
@ -1020,6 +1020,8 @@ ActivityTypeDef = {
|
|||
OpenSeverWelfare=55,--开服福利
|
||||
EightDayGift = 56,--八日登陆
|
||||
SignInfo = 57,--三日七日签到
|
||||
pozhenzhuxian_task = 2000,--破阵诛仙任务
|
||||
pozhenzhuxian_recharge = 58,--破阵诛仙累充
|
||||
|
||||
}
|
||||
--活动结束需要处理面板关闭类型
|
||||
|
|
|
@ -157,6 +157,7 @@ ConfigName = {
|
|||
RaceTowerConfig = "RaceTowerConfig",
|
||||
RaceTowerRewardConfig = "RaceTowerRewardConfig",
|
||||
HeroSacrifice = "HeroSacrifice",
|
||||
ThemeActivityTaskConfig = "ThemeActivityTaskConfig",
|
||||
}
|
||||
|
||||
require "Framework/GameDataBase"
|
||||
|
|
|
@ -525,6 +525,8 @@ function this.RefreshActivityRedPoint()
|
|||
CheckRedPointStatus(RedPointType.FindFairy_OneView)
|
||||
CheckRedPointStatus(RedPointType.FindFairy_ThreeView)
|
||||
CheckRedPointStatus(RedPointType.FindFairy_FourView)
|
||||
CheckRedPointStatus(RedPointType.pozhenzhuxianTask)
|
||||
CheckRedPointStatus(RedPointType.QinglongSerectTreasure)
|
||||
end
|
||||
|
||||
function this.GetContinuityRechargeRedPoint()
|
||||
|
|
|
@ -13,15 +13,25 @@ local _PageInfo = {--后期可以做成tableInsert,icon名字都去读表
|
|||
default = "q_qiankun_baoheanniu_02", lock = "q_qiankun_baoheanniu_02", select = "q_qiankun_baoheanniu_01",
|
||||
rpType = RedPointType.QianKunBox,panelType = PanelType.QianKunBox,
|
||||
},
|
||||
[3] = { --珍奇礼包
|
||||
[3] = { --破阵诛仙
|
||||
default = "p_pozhengzhuxian_anniu_02", lock = "p_pozhengzhuxian_anniu_02", select = "p_pozhengzhuxian_anniu_01",
|
||||
rpType = RedPointType.pozhenzhuxianTask,panelType = PanelType.QianKunBox,
|
||||
},
|
||||
[4] = { --珍奇礼包
|
||||
default = "z_zhenqibaoge_anniu_02", lock = "z_zhenqibaoge_anniu_02", select = "z_zhenqibaoge_anniu_01",
|
||||
rpType = RedPointType.QianKunBox,panelType = PanelType.QianKunBox,
|
||||
},
|
||||
[5] = { --累计充值
|
||||
default = "r_huodong_leijichengzhianniu_01", lock = "r_huodong_leijichengzhianniu_01", select = "r_huodong_leijichengzhianniu",
|
||||
rpType = RedPointType.QianKunBox,panelType = PanelType.QianKunBox,
|
||||
}
|
||||
}
|
||||
|
||||
local TimeLimitedCall = require("Modules/Operating/TimeLimitedCall")
|
||||
local QianKunBox = require("Modules/Operating/QianKunBox")
|
||||
local PoZhenZhuXianPage=require("Modules/Operating/PoZhenZhuXianPage")
|
||||
local ZhenQiYiBaoPage=require("Modules/Operating/ZhenQiYiBaoPage")
|
||||
local LeiJiChongZhiPage=require("Modules/Operating/LeiJiChongZhiPage")
|
||||
--初始化组件(用于子类重写)
|
||||
function DynamicActivityPanel:InitComponent()
|
||||
orginLayer = 0
|
||||
|
@ -32,7 +42,8 @@ function DynamicActivityPanel:InitComponent()
|
|||
this.PageList = {
|
||||
[1] = TimeLimitedCall.new(self, Util.GetGameObject(self.transform, "bg/pageContent/page_1")),
|
||||
[2] = QianKunBox.new(self, Util.GetGameObject(self.transform, "bg/pageContent/page_2")),
|
||||
[3] = ZhenQiYiBaoPage.new(self, Util.GetGameObject(self.transform, "bg/pageContent/page_4")),
|
||||
[3] = PoZhenZhuXianPage.new(self, Util.GetGameObject(self.transform, "bg/pageContent/page_3")),
|
||||
[4] = ZhenQiYiBaoPage.new(self, Util.GetGameObject(self.transform, "bg/pageContent/page_4")),
|
||||
}
|
||||
|
||||
-- 上部货币显示
|
||||
|
@ -102,7 +113,7 @@ function this.PageTabIsLockCheck(index)
|
|||
end
|
||||
|
||||
-- tab改变事件
|
||||
function this.OnPageTabChange(index, lastIndex)
|
||||
function this.OnPageTabChange(index)
|
||||
this._CurPageIndex = index
|
||||
for i = 1, #this.PageList do
|
||||
if this.PageList[i] then
|
||||
|
@ -111,7 +122,7 @@ function this.OnPageTabChange(index, lastIndex)
|
|||
end
|
||||
|
||||
end
|
||||
this.PageList[index]:OnShow(this.sortingOrder, _PageInfo[index].params and unpack(_PageInfo[index].params) or nil)
|
||||
this.PageList[index]:OnShow(this.sortingOrder,this)
|
||||
this.PageList[index].gameObject:SetActive(true)
|
||||
this.UpView:OnOpen({ showType = UpViewOpenType.ShowLeft, panelType = _PageInfo[index].panelType })
|
||||
end
|
||||
|
|
|
@ -1,47 +0,0 @@
|
|||
local PoZhenZhuXian = quick_class("PoZhenZhuXian")
|
||||
local orginLayer = 0
|
||||
|
||||
function PoZhenZhuXian:ctor(mainPanel, gameObject)
|
||||
self.mainPanel = mainPanel.transform
|
||||
self.gameObject = gameObject
|
||||
self:InitComponent(gameObject)
|
||||
self:BindEvent()
|
||||
end
|
||||
|
||||
function PoZhenZhuXian:InitComponent(gameObject)
|
||||
|
||||
end
|
||||
|
||||
function PoZhenZhuXian:BindEvent()
|
||||
|
||||
end
|
||||
|
||||
function PoZhenZhuXian:OnShow(sortingOrder)
|
||||
|
||||
end
|
||||
|
||||
|
||||
|
||||
--- 将一段时间转换为天时分秒
|
||||
function PoZhenZhuXian:TimeToDHMS(second)
|
||||
local day = math.floor(second / (24 * 3600))
|
||||
local minute = math.floor(second / 60) % 60
|
||||
local sec = second % 60
|
||||
local hour = math.floor(math.floor(second - day * 24 * 3600 - sec - minute * 60) / 3600)
|
||||
if day <= 0 and hour <= 0 then
|
||||
return string.format(Language[12231],minute, sec)
|
||||
else
|
||||
return string.format(Language[12232],day, hour)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
function PoZhenZhuXian:OnSortingOrderChange(_sortingOrder)
|
||||
orginLayer = _sortingOrder
|
||||
end
|
||||
|
||||
function PoZhenZhuXian:OnHide()
|
||||
|
||||
end
|
||||
|
||||
return PoZhenZhuXian
|
|
@ -164,18 +164,15 @@ local type={
|
|||
}
|
||||
--单个任务
|
||||
function this:SingleTask(go, rewardSingleData)
|
||||
local activityRewardGo = go
|
||||
local activityRewardGo = go
|
||||
activityRewardGo:SetActive(true)
|
||||
local sConFigData = rewardSingleData
|
||||
local strs = string.split(sConFigData.show)
|
||||
local titleText = Util.GetGameObject(activityRewardGo, "content"):GetComponent("Text")
|
||||
titleText.text = sConFigData.show
|
||||
local rewardText = Util.GetGameObject(activityRewardGo, "reward"):GetComponent("Text")
|
||||
rewardText.text = sConFigData.integral[1][2]..itemConfig[tonumber(sConFigData.integral[1][1])].Name .."/次"
|
||||
local getRewardProgress = Util.GetGameObject(activityRewardGo.gameObject, "getRewardProgress"):GetComponent("Text")
|
||||
local state = sConFigData.state
|
||||
local value = sConFigData.taskValue[2][1]
|
||||
getRewardProgress.gameObject:SetActive(state == 0)
|
||||
getRewardProgress.text ="("..(math.abs(sConFigData.progress) > math.abs(value) and math.abs(value) or math.abs(sConFigData.progress)) .."/"..math.abs(value)..")"
|
||||
titleText.text = strs[1].."("..(math.abs(sConFigData.progress) > math.abs(value) and math.abs(value) or math.abs(sConFigData.progress)) .."/"..math.abs(value)..")"
|
||||
local rewardText = Util.GetGameObject(activityRewardGo, "reward"):GetComponent("Text")
|
||||
rewardText.text = strs[2]..sConFigData.integral[1][2]..itemConfig[tonumber(sConFigData.integral[1][1])].Name .."/次"
|
||||
|
||||
local lingquButton = Util.GetGameObject(activityRewardGo.gameObject, "lingquButton")
|
||||
local red = Util.GetGameObject(lingquButton.gameObject, "redPoint")
|
||||
|
|
|
@ -9,10 +9,18 @@ this.score = 0
|
|||
this.traiWeekTime = 0
|
||||
local level = 0
|
||||
function this.Initialize()
|
||||
end
|
||||
|
||||
function this.InitializeData()
|
||||
rewardData = {}
|
||||
taskData = {}
|
||||
this.scoreId = TreasureSunlongConfig[1].Integral[1][1]
|
||||
for i, v in ConfigPairs(TreasureSunlongConfig) do
|
||||
local id = ActivityGiftManager.GetActivityIdByType(8)
|
||||
if not ActivityGiftManager.GetActivityOpenStatus(id) then
|
||||
return
|
||||
end
|
||||
local treasureSunlongConfig = ConfigManager.GetAllConfigsDataByKey(ConfigName.TreasureSunlongConfig,"ActivityId",id)
|
||||
for i, v in ConfigPairs(treasureSunlongConfig) do
|
||||
rewardData[v.Level] = {}
|
||||
rewardData[v.Level].level = v.Level
|
||||
if v.Integral then
|
||||
|
@ -34,7 +42,8 @@ function this.Initialize()
|
|||
end
|
||||
rewardData[v.Level].Reward = temp
|
||||
end
|
||||
for i, v in ConfigPairs(TreasureSunLongTaskConfig) do
|
||||
local treasureSunlongtaskConfig = ConfigManager.GetAllConfigsDataByKey(ConfigName.TreasureSunLongTaskConfig,"ActivityId",id)
|
||||
for i, v in ConfigPairs(treasureSunlongtaskConfig) do
|
||||
if not taskData[v.Type] then
|
||||
taskData[v.Type] = {}
|
||||
end
|
||||
|
|
|
@ -0,0 +1,203 @@
|
|||
local PoZhenZhuXianPage = quick_class("PoZhenZhuXianPage")
|
||||
local allData={}
|
||||
local itemsGrid = {}--item重复利用
|
||||
local singleTaskPre = {}
|
||||
local this=PoZhenZhuXianPage
|
||||
local parent
|
||||
local endtime = 0
|
||||
function PoZhenZhuXianPage:ctor(mainPanel, gameObject)
|
||||
self.mainPanel = mainPanel
|
||||
self.gameObject = gameObject
|
||||
self:InitComponent(gameObject)
|
||||
self:BindEvent()
|
||||
end
|
||||
|
||||
function PoZhenZhuXianPage:InitComponent(gameObject)
|
||||
this.time = Util.GetGameObject(gameObject, "content/tiao/time")
|
||||
this.itemPre = Util.GetGameObject(gameObject, "content/ItemPre")
|
||||
this.scrollItem = Util.GetGameObject(gameObject, "content/grid")
|
||||
local rootHight = this.scrollItem.transform.rect.height
|
||||
local width = this.scrollItem.transform.rect.width
|
||||
this.ScrollView = SubUIManager.Open(SubUIConfig.ScrollCycleView, this.scrollItem.transform,
|
||||
this.itemPre, nil, Vector2.New(width, rootHight), 1, 1, Vector2.New(0, 30))
|
||||
this.ScrollView.moveTween.MomentumAmount = 1
|
||||
this.ScrollView.moveTween.Strength = 2
|
||||
end
|
||||
|
||||
--绑定事件(用于子类重写)
|
||||
function PoZhenZhuXianPage:BindEvent()
|
||||
end
|
||||
|
||||
--添加事件监听(用于子类重写)
|
||||
function PoZhenZhuXianPage:AddListener()
|
||||
end
|
||||
|
||||
--移除事件监听(用于子类重写)
|
||||
function PoZhenZhuXianPage:RemoveListener()
|
||||
end
|
||||
local sortingOrder = 0
|
||||
--界面打开时调用(用于子类重写)
|
||||
function PoZhenZhuXianPage:OnOpen()
|
||||
|
||||
end
|
||||
|
||||
--界面打开或者重新打开后,界面刷新时调用(用于子类重写)
|
||||
function PoZhenZhuXianPage:OnShow(_sortingOrder,_parent)
|
||||
sortingOrder = _sortingOrder
|
||||
parent = _parent
|
||||
this:OnShowData()
|
||||
end
|
||||
|
||||
function this.Refresh()
|
||||
this:OnShowData()
|
||||
this:SetTime()
|
||||
end
|
||||
|
||||
function PoZhenZhuXianPage:SetTime()
|
||||
if self.timer then
|
||||
self.timer:Stop()
|
||||
self.timer = nil
|
||||
end
|
||||
self.timer = Timer.New(function()
|
||||
local timeDown
|
||||
for i = 1,#allData do
|
||||
if allData[i].type == 1 then
|
||||
timeDown = CalculateSecondsNowTo_N_OClock(5)
|
||||
singleTaskPre[allData[i].id].text = "剩余:"..TimeToHMS(timeDown)
|
||||
else
|
||||
timeDown = endtime - GetTimeStamp()
|
||||
singleTaskPre[allData[i].id].text = "剩余:"..TimeToDHMS(timeDown)
|
||||
end
|
||||
if timeDown < 1 then
|
||||
this.Refresh()
|
||||
return
|
||||
end
|
||||
end
|
||||
timeDown = endtime - GetTimeStamp()
|
||||
this.time.text = "剩余时间:"..TimeToDHMS(timeDown)
|
||||
end, 1, -1, true)
|
||||
self.timer:Start()
|
||||
end
|
||||
|
||||
function PoZhenZhuXianPage:OnShowData()
|
||||
allData = OperatingManager:InitPoZhenZhuXianData()
|
||||
if allData then
|
||||
endtime = ActivityGiftManager.GetTaskEndTime(ActivityTypeDef.pozhenzhuxian_task)
|
||||
this.SortData(allData)
|
||||
this.ScrollView:SetData(allData, function (index, go)
|
||||
this.SingleDataShow(go, allData[index])
|
||||
singleTaskPre[allData[index].id] = Util.GetGameObject(go,"btn/Text"):GetComponent("Text")
|
||||
end)
|
||||
LogError(#allData)
|
||||
else
|
||||
parent.OnPageTabChange(1)
|
||||
PopupTipPanel.ShowTip("活动已结束")
|
||||
return
|
||||
end
|
||||
|
||||
end
|
||||
function PoZhenZhuXianPage:SortData()
|
||||
if allData==nil then
|
||||
return
|
||||
end
|
||||
table.sort(allData, function(a,b)
|
||||
if a.type == b.type then
|
||||
return a.id < b.id
|
||||
else
|
||||
return a.type < b.type
|
||||
end
|
||||
end)
|
||||
end
|
||||
local type={
|
||||
[0]={sprite = "s_slbz_1anniuhuangse",text = "前往"},
|
||||
[1]={sprite = "s_slbz_1anniuhuise",text = "已领取"},
|
||||
[2]={sprite = "s_slbz_1anniuongse",text = "领取"},
|
||||
}
|
||||
--刷新每一条的显示数据
|
||||
function this.SingleDataShow(pre,value)
|
||||
if pre==nil or value==nil then
|
||||
return
|
||||
end
|
||||
--绑定组件
|
||||
local activityRewardGo = pre
|
||||
activityRewardGo:SetActive(true)
|
||||
local sConFigData = value
|
||||
|
||||
local titleText = Util.GetGameObject(activityRewardGo, "title"):GetComponent("Text")
|
||||
titleText.text = sConFigData.title
|
||||
local missionText = Util.GetGameObject(activityRewardGo, "mission"):GetComponent("Text")
|
||||
missionText.text = sConFigData.content.."("..(sConFigData.progress > sConFigData.value and sConFigData.value or sConFigData.progress) .."/"..sConFigData.value..")"
|
||||
|
||||
local reward = Util.GetGameObject(activityRewardGo.gameObject, "reward")
|
||||
if (not itemsGrid) then
|
||||
itemsGrid = {}
|
||||
end
|
||||
if not itemsGrid[pre] then
|
||||
itemsGrid[pre] = SubUIManager.Open(SubUIConfig.ItemView,reward.transform)
|
||||
end
|
||||
itemsGrid[pre]:OnOpen(false, sConFigData.reward, 0.9, false)
|
||||
|
||||
local lingquButton = Util.GetGameObject(activityRewardGo.gameObject, "btn")
|
||||
local state = sConFigData.state == 1 and sConFigData.state or (sConFigData.progress >= sConFigData.value and 2 or 0) -- 0 前往 1已领奖 2领奖
|
||||
|
||||
local red = Util.GetGameObject(lingquButton.gameObject, "redPoint")
|
||||
red:SetActive(state == 2)
|
||||
|
||||
Util.GetGameObject(lingquButton.gameObject, "Button/Text"):GetComponent("Text").text = type[state].text
|
||||
Util.GetGameObject(lingquButton.gameObject, "Button"):GetComponent("Image").sprite = Util.LoadSprite(type[state].sprite)
|
||||
Util.GetGameObject(lingquButton.gameObject, "Button").gameObject:SetActive(state ~= 1)
|
||||
Util.GetGameObject(lingquButton.gameObject, "image").gameObject:SetActive(state == 1)
|
||||
|
||||
Util.AddOnceClick(Util.GetGameObject(lingquButton.gameObject, "Button"), function()
|
||||
if state == 2 then
|
||||
local curActivityId = ActivityGiftManager.GetActivityIdByType(ActivityTypeDef.pozhenzhuxian_task)
|
||||
NetManager.GetActivityRewardRequest(sConFigData.id, curActivityId,function(respond)
|
||||
UIManager.OpenPanel(UIName.RewardItemPopup, respond, 1)
|
||||
this.Refresh()
|
||||
end)
|
||||
elseif state == 0 then
|
||||
if sConFigData.jump then
|
||||
JumpManager.GoJump(sConFigData.jump[1])
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
end
|
||||
|
||||
--界面打开时调用(用于子类重写)
|
||||
function PoZhenZhuXianPage:OnOpen()
|
||||
|
||||
end
|
||||
|
||||
function this.RechargeSuccessFunc(id)
|
||||
FirstRechargeManager.RefreshAccumRechargeValue(id)
|
||||
--OperatingManager.RefreshGiftGoodsBuyTimes(GoodsTypeDef.GiftBuy, id)
|
||||
this.OnShowData()
|
||||
end
|
||||
|
||||
function PoZhenZhuXianPage:OnClose()
|
||||
|
||||
end
|
||||
|
||||
--界面销毁时调用(用于子类重写)
|
||||
function PoZhenZhuXianPage:OnDestroy()
|
||||
sortingOrder = 0
|
||||
end
|
||||
|
||||
function PoZhenZhuXianPage:OnHide()
|
||||
sortingOrder = 0
|
||||
end
|
||||
--- 将一段时间转换为天时分秒
|
||||
function PoZhenZhuXian:TimeToDHMS(second)
|
||||
local day = math.floor(second / (24 * 3600))
|
||||
local minute = math.floor(second / 60) % 60
|
||||
local sec = second % 60
|
||||
local hour = math.floor(math.floor(second - day * 24 * 3600 - sec - minute * 60) / 3600)
|
||||
if day <= 0 and hour <= 0 then
|
||||
return string.format(Language[12231],minute, sec)
|
||||
else
|
||||
return string.format(Language[12232],day, hour)
|
||||
end
|
||||
end
|
||||
|
||||
return PoZhenZhuXianPage
|
|
@ -1,5 +1,5 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 71ef8224a4ad0ee4f85cab8503089428
|
||||
guid: 4ae960ba920800d4f9d661a3fb195040
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
|
@ -722,4 +722,47 @@ function this.GetQiankunBoxRedPointStatus()
|
|||
end
|
||||
|
||||
this.TimeLimitedTimes = 0
|
||||
this.allData = {}
|
||||
function this.InitPoZhenZhuXianData()
|
||||
local id = ActivityGiftManager.GetActivityIdByType(ActivityTypeDef.pozhenzhuxian_task)
|
||||
if not ActivityGiftManager.IsActivityTypeOpen(id) then
|
||||
return nil
|
||||
end
|
||||
this.allData = {}
|
||||
local allListData = ConfigManager.GetAllConfigsDataByKey(ConfigName.ThemeActivityTaskConfig, "ActivityId", id)
|
||||
local allMissionData = ActivityGiftManager.GetActivityTypeInfo(id).mission
|
||||
for i=1,#allListData do
|
||||
for j=1,#allMissionData do
|
||||
if allListData[i].Id == allMissionData[j].missionId then
|
||||
local data = {}
|
||||
data.id = allMissionData[j].missionId
|
||||
data.progress = allMissionData[j].progress
|
||||
data.state = allMissionData[j].state
|
||||
data.type = allListData[i].Type
|
||||
local strs = string.split(allListData[i].Show,"#")
|
||||
data.title = strs[1]
|
||||
data.content = strs[2]
|
||||
data.value = allListData[i].TaskValue[2][1]
|
||||
data.reward = {allListData[i].Integral[1][1],allListData[i].Integral[1][2]}
|
||||
data.jump = allListData[i].Jump[1]
|
||||
table.insert(this.allData,data)
|
||||
end
|
||||
end
|
||||
end
|
||||
return this.allData
|
||||
end
|
||||
function this.CheckPoZhenZhuXianTaskRed()
|
||||
this.InitPoZhenZhuXianData()
|
||||
if not this.allData then
|
||||
return false
|
||||
end
|
||||
for i=1,#this.allData do
|
||||
if this.allData[i].state == 0 and
|
||||
this.allData[i].progress >= this.allData[i].value
|
||||
then
|
||||
return true
|
||||
end
|
||||
end
|
||||
return false
|
||||
end
|
||||
return this
|
|
@ -0,0 +1,206 @@
|
|||
local PoZhenZhuXianPage = quick_class("PoZhenZhuXianPage")
|
||||
local allData={}
|
||||
local itemsGrid = {}--item重复利用
|
||||
local singleTaskPre = {}
|
||||
local this=PoZhenZhuXianPage
|
||||
local parent
|
||||
local endtime = 0
|
||||
local activityType = {
|
||||
[1] = {name = "破阵诛仙", bg = "p_pozhengzhuxian_tu",pre = "prefab1"}
|
||||
}
|
||||
function PoZhenZhuXianPage:ctor(mainPanel, gameObject)
|
||||
self.mainPanel = mainPanel
|
||||
self.gameObject = gameObject
|
||||
self:InitComponent(gameObject)
|
||||
self:BindEvent()
|
||||
end
|
||||
|
||||
function PoZhenZhuXianPage:InitComponent(gameObject)
|
||||
this.time = Util.GetGameObject(gameObject, "content/tiao/time")
|
||||
this.itemPre = Util.GetGameObject(gameObject, "content/ItemPre")
|
||||
this.scrollItem = Util.GetGameObject(gameObject, "content/grid")
|
||||
local rootHight = this.scrollItem.transform.rect.height
|
||||
local width = this.scrollItem.transform.rect.width
|
||||
this.ScrollView = SubUIManager.Open(SubUIConfig.ScrollCycleView, this.scrollItem.transform,
|
||||
this.itemPre, nil, Vector2.New(width, rootHight), 1, 1, Vector2.New(0, 30))
|
||||
this.ScrollView.moveTween.MomentumAmount = 1
|
||||
this.ScrollView.moveTween.Strength = 2
|
||||
end
|
||||
|
||||
--绑定事件(用于子类重写)
|
||||
function PoZhenZhuXianPage:BindEvent()
|
||||
end
|
||||
|
||||
--添加事件监听(用于子类重写)
|
||||
function PoZhenZhuXianPage:AddListener()
|
||||
end
|
||||
|
||||
--移除事件监听(用于子类重写)
|
||||
function PoZhenZhuXianPage:RemoveListener()
|
||||
end
|
||||
local sortingOrder = 0
|
||||
--界面打开时调用(用于子类重写)
|
||||
function PoZhenZhuXianPage:OnOpen()
|
||||
|
||||
end
|
||||
|
||||
--界面打开或者重新打开后,界面刷新时调用(用于子类重写)
|
||||
function PoZhenZhuXianPage:OnShow(_sortingOrder,_parent)
|
||||
sortingOrder = _sortingOrder
|
||||
parent = _parent
|
||||
this:OnShowData()
|
||||
end
|
||||
|
||||
function this.Refresh()
|
||||
this:OnShowData()
|
||||
this:SetTime()
|
||||
end
|
||||
|
||||
function PoZhenZhuXianPage:SetTime()
|
||||
if self.timer then
|
||||
self.timer:Stop()
|
||||
self.timer = nil
|
||||
end
|
||||
self.timer = Timer.New(function()
|
||||
local timeDown
|
||||
for i = 1,#allData do
|
||||
if allData[i].type == 1 then
|
||||
timeDown = CalculateSecondsNowTo_N_OClock(5)
|
||||
singleTaskPre[allData[i].id].text = "剩余:"..TimeToHMS(timeDown)
|
||||
else
|
||||
timeDown = endtime - GetTimeStamp()
|
||||
singleTaskPre[allData[i].id].text = "剩余:"..TimeToDHMS(timeDown)
|
||||
end
|
||||
if timeDown < 1 then
|
||||
this.Refresh()
|
||||
return
|
||||
end
|
||||
end
|
||||
timeDown = endtime - GetTimeStamp()
|
||||
this.time.text = "剩余时间:"..TimeToDHMS(timeDown)
|
||||
end, 1, -1, true)
|
||||
self.timer:Start()
|
||||
end
|
||||
|
||||
function PoZhenZhuXianPage:OnShowData()
|
||||
allData = OperatingManager:InitPoZhenZhuXianData()
|
||||
if allData then
|
||||
endtime = ActivityGiftManager.GetTaskEndTime(ActivityTypeDef.pozhenzhuxian_task)
|
||||
this.SortData(allData)
|
||||
this.ScrollView:SetData(allData, function (index, go)
|
||||
this.SingleDataShow(go, allData[index])
|
||||
singleTaskPre[allData[index].id] = Util.GetGameObject(go,"btn/Text"):GetComponent("Text")
|
||||
end)
|
||||
LogError(#allData)
|
||||
else
|
||||
parent.OnPageTabChange(1)
|
||||
PopupTipPanel.ShowTip("活动已结束")
|
||||
return
|
||||
end
|
||||
|
||||
end
|
||||
function PoZhenZhuXianPage:SortData()
|
||||
if allData==nil then
|
||||
return
|
||||
end
|
||||
table.sort(allData, function(a,b)
|
||||
if a.type == b.type then
|
||||
return a.id < b.id
|
||||
else
|
||||
return a.type < b.type
|
||||
end
|
||||
end)
|
||||
end
|
||||
local type={
|
||||
[0]={sprite = "s_slbz_1anniuhuangse",text = "前往"},
|
||||
[1]={sprite = "s_slbz_1anniuhuise",text = "已领取"},
|
||||
[2]={sprite = "s_slbz_1anniuongse",text = "领取"},
|
||||
}
|
||||
--刷新每一条的显示数据
|
||||
function this.SingleDataShow(pre,value)
|
||||
if pre==nil or value==nil then
|
||||
return
|
||||
end
|
||||
--绑定组件
|
||||
local activityRewardGo = pre
|
||||
activityRewardGo:SetActive(true)
|
||||
local sConFigData = value
|
||||
|
||||
local titleText = Util.GetGameObject(activityRewardGo, "title"):GetComponent("Text")
|
||||
titleText.text = sConFigData.title
|
||||
local missionText = Util.GetGameObject(activityRewardGo, "mission"):GetComponent("Text")
|
||||
missionText.text = sConFigData.content.."("..(sConFigData.progress > sConFigData.value and sConFigData.value or sConFigData.progress) .."/"..sConFigData.value..")"
|
||||
|
||||
local reward = Util.GetGameObject(activityRewardGo.gameObject, "reward")
|
||||
if (not itemsGrid) then
|
||||
itemsGrid = {}
|
||||
end
|
||||
if not itemsGrid[pre] then
|
||||
itemsGrid[pre] = SubUIManager.Open(SubUIConfig.ItemView,reward.transform)
|
||||
end
|
||||
itemsGrid[pre]:OnOpen(false, sConFigData.reward, 0.9, false)
|
||||
|
||||
local lingquButton = Util.GetGameObject(activityRewardGo.gameObject, "btn")
|
||||
local state = sConFigData.state == 1 and sConFigData.state or (sConFigData.progress >= sConFigData.value and 2 or 0) -- 0 前往 1已领奖 2领奖
|
||||
|
||||
local red = Util.GetGameObject(lingquButton.gameObject, "redPoint")
|
||||
red:SetActive(state == 2)
|
||||
|
||||
Util.GetGameObject(lingquButton.gameObject, "Button/Text"):GetComponent("Text").text = type[state].text
|
||||
Util.GetGameObject(lingquButton.gameObject, "Button"):GetComponent("Image").sprite = Util.LoadSprite(type[state].sprite)
|
||||
Util.GetGameObject(lingquButton.gameObject, "Button").gameObject:SetActive(state ~= 1)
|
||||
Util.GetGameObject(lingquButton.gameObject, "image").gameObject:SetActive(state == 1)
|
||||
|
||||
Util.AddOnceClick(Util.GetGameObject(lingquButton.gameObject, "Button"), function()
|
||||
if state == 2 then
|
||||
local curActivityId = ActivityGiftManager.GetActivityIdByType(ActivityTypeDef.pozhenzhuxian_task)
|
||||
NetManager.GetActivityRewardRequest(sConFigData.id, curActivityId,function(respond)
|
||||
UIManager.OpenPanel(UIName.RewardItemPopup, respond, 1)
|
||||
this.Refresh()
|
||||
end)
|
||||
elseif state == 0 then
|
||||
if sConFigData.jump then
|
||||
JumpManager.GoJump(sConFigData.jump[1])
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
end
|
||||
|
||||
--界面打开时调用(用于子类重写)
|
||||
function PoZhenZhuXianPage:OnOpen()
|
||||
|
||||
end
|
||||
|
||||
function this.RechargeSuccessFunc(id)
|
||||
FirstRechargeManager.RefreshAccumRechargeValue(id)
|
||||
--OperatingManager.RefreshGiftGoodsBuyTimes(GoodsTypeDef.GiftBuy, id)
|
||||
this.OnShowData()
|
||||
end
|
||||
|
||||
function PoZhenZhuXianPage:OnClose()
|
||||
|
||||
end
|
||||
|
||||
--界面销毁时调用(用于子类重写)
|
||||
function PoZhenZhuXianPage:OnDestroy()
|
||||
sortingOrder = 0
|
||||
end
|
||||
|
||||
function PoZhenZhuXianPage:OnHide()
|
||||
sortingOrder = 0
|
||||
end
|
||||
--- 将一段时间转换为天时分秒
|
||||
function PoZhenZhuXian:TimeToDHMS(second)
|
||||
local day = math.floor(second / (24 * 3600))
|
||||
local minute = math.floor(second / 60) % 60
|
||||
local sec = second % 60
|
||||
local hour = math.floor(math.floor(second - day * 24 * 3600 - sec - minute * 60) / 3600)
|
||||
if day <= 0 and hour <= 0 then
|
||||
return string.format(Language[12231],minute, sec)
|
||||
else
|
||||
return string.format(Language[12232],day, hour)
|
||||
end
|
||||
end
|
||||
|
||||
return PoZhenZhuXianPage
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: ede56a3b826abb74e8174170ff538788
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -181,6 +181,7 @@ function this.InitRedPointAllRelate()
|
|||
--(24暂时关闭)放开这里就行
|
||||
RPData:SetParent(RedPointType.TimeLimited, RedPointType.DynamicActivity)
|
||||
RPData:SetParent(RedPointType.QianKunBox, RedPointType.DynamicActivity)
|
||||
RPData:SetParent(RedPointType.pozhenzhuxianTask, RedPointType.DynamicActivity)
|
||||
|
||||
-- 好友红点
|
||||
RPData:SetParent(RedPointType.Friend_Reward, RedPointType.Friend)
|
||||
|
@ -385,7 +386,8 @@ function this.RegisterRedCheckFunc()
|
|||
--限时招募
|
||||
RPData:AddCheckFunc(RedPointType.TimeLimited,OperatingManager.GetTimeLimitRedPointStatus)
|
||||
RPData:AddCheckFunc(RedPointType.QianKunBox,OperatingManager.GetQiankunBoxRedPointStatus)
|
||||
|
||||
RPData:SetParent(RedPointType.pozhenzhuxianTask, OperatingManager.CheckPoZhenZhuXianTaskRed)
|
||||
|
||||
RPData:AddCheckFunc(RedPointType.OrdinaryExplore, CarbonManager.CarbonRedCheck,FUNCTION_OPEN_TYPE.EXPEDITION)
|
||||
RPData:AddCheckFunc(RedPointType.HeroExplore, CarbonManager.CarbonRedCheck,FUNCTION_OPEN_TYPE.DAILYCHALLENGE_COIN)
|
||||
RPData:AddCheckFunc(RedPointType.EpicExplore, CarbonManager.CarbonRedCheck,FUNCTION_OPEN_TYPE.MONSTER_COMING)
|
||||
|
|
|
@ -237,6 +237,7 @@ function this.ChangeVipRedPointState()
|
|||
CheckRedPointStatus(RedPointType.TreasureOfSl)
|
||||
CheckRedPointStatus(RedPointType.SevenDayCarnival)
|
||||
CheckRedPointStatus(RedPointType.Achievement_Main)
|
||||
CheckRedPointStatus(RedPointType.QinglongSerectTreasureTrail)
|
||||
--CheckRedPointStatus(RedPointType.Achievement_One)
|
||||
--CheckRedPointStatus(RedPointType.Achievement_Two)
|
||||
--CheckRedPointStatus(RedPointType.Achievement_Three)
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue