Merge remote-tracking branch 'origin/china/dev' into china/zf_test

dev_chengFeng
JieLing 2021-07-20 10:51:34 +08:00
commit 437e41c130
3 changed files with 44 additions and 20 deletions

View File

@ -8,7 +8,8 @@ end
local jumpDic = {
[JumpType.Lottery] = function(data)--招募
--local openPanle =
UIManager.OpenPanel(UIName.RecruitPanel)
local config = ConfigManager.TryGetConfigDataByThreeKey(ConfigName.ActivityGroups,"Sort",data.skipfactor[1],"FunType",JumpType.Lottery,"PageType",JumpType.Lottery)
UIManager.OpenPanel(UIName.RecruitMainPanel,config.ShopData[1][1])
--if openPanle and data then
-- openPanle.ShowGuideGo(data[1])
--end
@ -302,7 +303,7 @@ local jumpDic = {
UIManager.OpenPanel(UIName.QuickPurchasePanel, { type = UpViewRechargeType.Gold })
end,
[JumpType.ElementDrawCard] = function(data)--元素招募
UIManager.OpenPanel(UIName.ElementDrawCardPanel,(data and data[1] or 0))
UIManager.OpenPanel(UIName.RecruitMainPanel,TableRecruitType.Siyuanzhen)
end,
[JumpType.Pray] = function(data)--云梦
if ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.Pray) then

View File

@ -12,6 +12,7 @@ function ElementDrawCardPanelNew:InitComponent()
self.spLoader = SpriteLoader.New()
self.getCardPanel = Util.GetGameObject(self.transform, "getCardPanel")
self.getCardPanel.gameObject:SetActive(false)
self.buyOneBtn = Util.GetGameObject(self.getCardPanel,"content2/btn1")
self.titleImageText = Util.GetGameObject(self.getCardPanel,"content1/titleImage/Text"):GetComponent("Text")
self.Image1 = Util.GetGameObject(self.getCardPanel,"content1/Image/Image1"):GetComponent("Image")
@ -46,6 +47,7 @@ end
function ElementDrawCardPanelNew:BindEvent()
Util.AddClick(self.buyOneBtn, function ()
local index = self.index > 0 and self.index or RecruitManager.recruitSubIndex
local singleConfig = ConfigManager.TryGetConfigDataByThreeKey(ConfigName.LotterySetting,"LotteryType",TableRecruitType.Siyuanzhen,"PropertyType",self.index,"PerCount",1)
local costnum = singleConfig.CostItem[1][2]
local costId = singleConfig.CostItem[1][1]
@ -62,6 +64,7 @@ function ElementDrawCardPanelNew:BindEvent()
Util.AddClick(self.btnBack, function ()
self.getCardPanel:SetActive(false)
self.parent.AddTrigger()
self.effect:SetActive(false)
SoundManager.PlayMusic(SoundConfig.BGM_Main)
RecruitManager.recruitSubIndex = 0
@ -86,6 +89,7 @@ function ElementDrawCardPanelNew:BindEvent()
for i = 1, #self.itemPos do
Util.AddClick(self.itemPos[i].go, function()
self.index = i
RecruitManager.recruitSubIndex = i
self:BtnAction(i)
end)
end
@ -98,6 +102,7 @@ function ElementDrawCardPanelNew:BtnAction(index)
self.parent.btnBack.gameObject:SetActive(false)
self.parent.tabbox.gameObject:SetActive(false)
self.getCardPanel.gameObject:SetActive(true)
self.parent.RemoveTrigger()
self.effect:SetActive(true)
self.Image2Text.text = string.format("%s神将碎片",PropertyType[index])
SetTextVerTial(self.Image2Text,Vector3.New(134.88,-5.9,0),"MiddleLeft")

View File

@ -24,7 +24,7 @@ function RecruitMainPanel:InitComponent()
this.rightBtn = Util.GetGameObject(this.tabbox, "rightAction")
this.jiantouyou = Util.GetGameObject(this.tabbox, "jiantouyou")
this.jiantouzuo = Util.GetGameObject(this.tabbox, "jiantouzuo")
this.mask1 = Util.GetGameObject(this.tabbox, "mask"):GetComponent("Image")
this.mask1 = Util.GetGameObject(this.tabbox, "mask"):GetComponent("Image")
this.mask2 = Util.GetGameObject(this.tabbox, "mask1"):GetComponent("Image")
this.select = Util.GetGameObject(this.tabbox, "select")
this.selectIma = Util.GetGameObject(this.select, "Image"):GetComponent("Image")
@ -56,8 +56,18 @@ function RecruitMainPanel:InitComponent()
--LogGreen("this.pos0:"..tostring(this.pos0))
--this.pos4 = Vector3.New(this.off * (4 - 1) + 4 * this.itemWidth,0,0)
self.lastPage,self.curPage,self.nextPage = 0,0,0
this.AddTrigger()
end
this.trigger = Util.GetEventTriggerListener(self.gameObject) --触摸事件
function this.RemoveTrigger()
this.trigger = Util.GetEventTriggerListener(this.gameObject) --触摸事件
this.trigger.onBeginDrag = this.trigger.onBeginDrag - this.OnBeginDrag
this.trigger.onDrag = this.trigger.onDrag - this.OnDrag
this.trigger.onEndDrag = this.trigger.onEndDrag - this.OnEndDrag
end
function this.AddTrigger()
this.trigger = Util.GetEventTriggerListener(this.gameObject) --触摸事件
this.trigger.onBeginDrag = this.trigger.onBeginDrag + this.OnBeginDrag
this.trigger.onDrag = this.trigger.onDrag + this.OnDrag
this.trigger.onEndDrag = this.trigger.onEndDrag + this.OnEndDrag
@ -151,21 +161,27 @@ function RecruitMainPanel:BindEvent()
end)
Util.AddClick(this.leftBtn, function()
this.mask:SetActive(true)
this.MoveTo(3)
Timer.New(function()
self.thread = coroutine.start(function()
coroutine.wait(0.01)
this.MoveTo(3)
coroutine.wait(0.25)
this.SortItemList()
coroutine.wait(0.01)
this:LeftAction()
this.mask:SetActive(false)
end,0.23):Start()
end)
end)
Util.AddClick(this.rightBtn, function()
this.mask:SetActive(true)
this.MoveTo(2)
Timer.New(function()
self.thread = coroutine.start(function()
coroutine.wait(0.01)
this.MoveTo(2)
coroutine.wait(0.25)
this.SortItemList()
coroutine.wait(0.01)
this:RightAction()
this.mask:SetActive(false)
end,0.23):Start()
end)
end)
Util.AddClick(this.jiantouyou , function()
@ -248,7 +264,6 @@ end
--界面打开时调用(用于子类重写)
function RecruitMainPanel:OnOpen(_index)
if not _index then
LogGreen("GuideManager.GetCurId(1):"..tostring(GuideManager.GetCurId(1)).." GuideManager.GetCurId(2):"..tostring(GuideManager.GetCurId(2)))
if GuideManager.IsInMainGuide() and GuideManager.GetCurId(1) == 105 then
self.CurRecruitId = TableRecruitType.Putong
elseif GuideManager.IsInMainGuide() and GuideManager.GetCurId(1) == 1003 then
@ -352,11 +367,10 @@ function this:SetIndex()
isenter = false
this.mask:SetActive(true)
this.MoveTo(LOY)
Timer.New(function()
offSet = offSet - 1
this.SortItemList()
isenter = true
end,0.25):Start()
coroutine.wait(0.25)
offSet = offSet - 1
this.SortItemList()
isenter = true
end
coroutine.wait(0.01)
end
@ -372,10 +386,14 @@ end
function this:PageOnChange(isShow)
if isShow then
this.select.transform:SetParent(this.itemList[2].go.transform)
this.select.transform:GetComponent("RectTransform").anchoredPosition = Vector3.zero
this.select.gameObject:SetActive(true)
this.selectIma.sprite = this.spLoader:LoadSprite(self.dicData[self.curPage].Icon[2])
for i = 1,#this.itemList do
if this.itemList[i].pageIndex == self.curPage then
this.select.transform:SetParent(this.itemList[i].go.transform)
this.select.transform:GetComponent("RectTransform").anchoredPosition = Vector3.zero
this.select.gameObject:SetActive(true)
this.selectIma.sprite = this.spLoader:LoadSprite(self.dicData[self.curPage].Icon[2])
end
end
end
RecruitManager.CurRecruitId = self.CurRecruitId
if subViewList[lastIndex] and subViewList[lastIndex].config and subViewList[lastIndex].sub then