[首充]=======修改提交

dev_chengFeng
wangzhenxing 2022-10-13 11:28:55 +08:00
parent e8d38b2bdb
commit a264f9dddd
6 changed files with 269 additions and 81 deletions

View File

@ -31021,7 +31021,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
m_IsActive: 0
--- !u!224 &1481527222957545325
RectTransform:
m_ObjectHideFlags: 0
@ -36242,6 +36242,7 @@ RectTransform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 1481527222957545325}
- {fileID: 7137898665826321498}
m_Father: {fileID: 1481527222458419407}
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
@ -36790,7 +36791,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
m_IsActive: 0
--- !u!224 &4260693617139021514
RectTransform:
m_ObjectHideFlags: 0
@ -36808,10 +36809,10 @@ RectTransform:
m_Father: {fileID: 1481527223116321039}
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 641.5, y: -50}
m_SizeDelta: {x: 179, y: 100}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &8724028868596978955
CanvasRenderer:
@ -36966,6 +36967,85 @@ MonoBehaviour:
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
--- !u!1 &2750855782982902283
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 7137898665826321498}
- component: {fileID: 9022163480280373877}
- component: {fileID: 6291420703489925548}
m_Layer: 5
m_Name: Text
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &7137898665826321498
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2750855782982902283}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 1481527223225029562}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 0, y: 11.39}
m_SizeDelta: {x: 160, y: 85.13}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &9022163480280373877
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2750855782982902283}
m_CullTransparentMesh: 0
--- !u!114 &6291420703489925548
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2750855782982902283}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0.9843138, g: 0.9803922, b: 0.9686275, a: 1}
m_RaycastTarget: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
m_FontData:
m_Font: {fileID: 12800000, guid: 4b73e9e4512d17e4daeea351e090d33c, type: 3}
m_FontSize: 60
m_FontStyle: 0
m_BestFit: 0
m_MinSize: 3
m_MaxSize: 60
m_Alignment: 4
m_AlignByGeometry: 0
m_RichText: 1
m_HorizontalOverflow: 1
m_VerticalOverflow: 1
m_LineSpacing: 1
m_Text: "6\u5143"
--- !u!1 &3327902824083023982
GameObject:
m_ObjectHideFlags: 0
@ -39236,7 +39316,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
m_IsActive: 0
--- !u!224 &8509117109850459232
RectTransform:
m_ObjectHideFlags: 0
@ -39254,10 +39334,10 @@ RectTransform:
m_Father: {fileID: 1481527223116321039}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 457.5, y: -50}
m_SizeDelta: {x: 179, y: 100}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &3513381775929146546
CanvasRenderer:

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: efb6d932cb8cbed4cb4169243c4dff50
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1374,7 +1374,7 @@ ActivityTypeDef = {
ChapterAward = 3, --章节奖励
-- FirstRecharge = 4, --首充
-- AccumulativeRecharge = 5, --累计充值
FirstRecharge = 5, --首充
FirstRecharge = 108, --首充
GrowthReward = 6, --成长礼金
RecruitTreasure = 7, --招募秘宝
TreasureOfSomeBody = 8,--孙龙的宝藏

View File

@ -59,41 +59,67 @@ function DayRewardItem:SetValue(context,_sortingOrder)
AccumRecharge = missInfo.progress
end
end
if (self.context.Values[1][1] == 1 and AccumRecharge > 0)
or AccumRecharge >= self.context.Values[1][1] then
local day = GetTimePass(FirstRechargeManager.GetRechargeTime())--FirstRechargeManager.GetRechargeTime()
if self.context.Values[1][2] <= day then
local state = ActivityGiftManager.GetActivityInfo(context.ActivityId, context.Id).state
self.receiveBtn:GetComponent("Image").sprite = self.spLoader:LoadSprite("r_shouchong_lingqu_01_zh")
self.receiveBtn.enabled = true
self.receivedFlag:SetActive(state == 1)
self.receiveBtn.gameObject:SetActive(state ~= 1)
self.redPoint:SetActive(state ~= 1)
else
self.receiveBtn.gameObject:SetActive(true)
self.receiveBtn:GetComponent("Image").sprite = self.spLoader:LoadSprite("r_shouchong_lingqu_02_zh")
self.receiveBtn.enabled = false
self.receivedFlag:SetActive(false)
self.redPoint:SetActive(false)
end
else
LogError("context.ActivityId=="..context.ActivityId.." context.Id=="..context.Id)
local state = ActivityGiftManager.GetActivityInfo(context.ActivityId, context.Id).state
LogError("state=="..state)
--if self.context.Values[1][1] == 1 or AccumRecharge >= self.context.Values[1][1] then
-- if state==1 then
-- local day = GetTimePass(FirstRechargeManager.GetRechargeTime())--FirstRechargeManager.GetRechargeTime()
-- if self.context.Values[1][2] <= day then
-- --local state = ActivityGiftManager.GetActivityInfo(context.ActivityId, context.Id).state
-- self.receiveBtn:GetComponent("Image").sprite = self.spLoader:LoadSprite("r_shouchong_lingqu_01_zh")
-- self.receiveBtn.enabled = true
-- self.receivedFlag:SetActive(state == 1)
-- self.receiveBtn.gameObject:SetActive(state ~= 1)
-- self.redPoint:SetActive(state ~= 1)
-- else
-- self.receiveBtn.gameObject:SetActive(true)
-- self.receiveBtn:GetComponent("Image").sprite = self.spLoader:LoadSprite("r_shouchong_lingqu_02_zh")
-- self.receiveBtn.enabled = false
-- self.receivedFlag:SetActive(false)
-- self.redPoint:SetActive(false)
-- end
-- else
-- end
if state==0 then
self.receiveBtn.gameObject:SetActive(true)
self.receiveBtn:GetComponent("Image").sprite = self.spLoader:LoadSprite("r_shouchong_lingqu_02_zh")
self.receiveBtn.enabled = false
self.receivedFlag:SetActive(false)
self.redPoint:SetActive(false)
elseif state==1 then
self.receiveBtn:GetComponent("Image").sprite = self.spLoader:LoadSprite("r_shouchong_lingqu_01_zh")
self.receiveBtn.enabled = true
self.receivedFlag:SetActive(false)
self.receiveBtn.gameObject:SetActive(state==1)
self.redPoint:SetActive(state == 1)
elseif state==2 then
self.receiveBtn:GetComponent("Image").sprite = self.spLoader:LoadSprite("r_shouchong_lingqu_01_zh")
self.receiveBtn.enabled = true
self.receivedFlag:SetActive(state == 2)
self.receiveBtn.gameObject:SetActive(false)
self.redPoint:SetActive(false)
end
--end
end
function DayRewardItem:OnReceivedBtnClicked()
NetManager.GetActivityRewardRequest(self.context.Id, self.context.ActivityId, function(drop)
UIManager.OpenPanel(UIName.RewardItemPopup, drop, 1)
ActivityGiftManager.SetActivityInfo(self.context.ActivityId, self.context.Id, 1)
--ActivityGiftManager.SetActivityInfo(self.context.ActivityId, self.context.Id, 1)
self.receiveBtn.gameObject:SetActive(false)
self.receivedFlag:SetActive(true)
self.redPoint:SetActive(false)
local index = FirstRechargeManager.GetFirstRechargeIndexByMoney(self.context.Values[1][1])
LogError("self.context.Values[1][1]=="..self.context.Values[1][1])
local index =0 --FirstRechargeManager.GetFirstRechargeIndexByMoney(self.context.Values[1][1])
if self.context.Id<=10803 then
index=1
else
index=2
end
self.mainPanel:SetTabRedPointStatus(index)
CheckRedPointStatus(RedPointType.FirstRecharge)
if FirstRechargeManager.GetReceiveAll() then

View File

@ -29,12 +29,17 @@ end
function this.GetRedPointStatus(index)
local redPoint = false
local money = FirstRechargeManager.GetFirstRechargeMoneyByIndex(index)
--local money = FirstRechargeManager.GetFirstRechargeMoneyByIndex(index)
local activityInfo = ActivityGiftManager.GetActivityTypeInfo(ActivityTypeDef.FirstRecharge)
for _, missionInfo in ipairs(activityInfo.mission) do
local rewardInfo = activityRewardConfig[missionInfo.missionId]
if rewardInfo and rewardInfo.Values[1][1] == money then
redPoint = redPoint or this.GetDayItemRedPoint(missionInfo, rewardInfo)
LogError("rewardInfo.Values[1][1]=="..rewardInfo.Values[1][1])
if rewardInfo and rewardInfo.Values[1][1] == index*10000 then
LogError("missionInfo.state===="..missionInfo.state)
redPoint = missionInfo.state==1
if redPoint then
return true
end
end
end
return redPoint
@ -42,29 +47,30 @@ end
function this.GetDayItemRedPoint(missionInfo, context)
local AccumRecharge = missionInfo.progress
if AccumRecharge == 0 then
return false
else
--if this.GetAccumRechargeValue() >= context.Values[1][1] then
if AccumRecharge >= context.Values[1][1] then
if this.isFirstRecharge == 0 then
this.SetRechargeTime(math.floor(GetTimeStamp()))
this.isFirstRecharge = 1
end
local day = GetTimePass(this.GetRechargeTime())
--local day = GetTimePass(math.floor(GetTimeStamp()))
if context.Values[1][2] <= day then
local state = missionInfo.state
return state ~= 1
else
return false
end
else
return false
end
end
return false
return missionInfo.state==1
-- local AccumRecharge = missionInfo.progress
-- if AccumRecharge == 0 then
-- return false
-- else
-- --if this.GetAccumRechargeValue() >= context.Values[1][1] then
-- if AccumRecharge >= context.Values[1][1] then
-- if this.isFirstRecharge == 0 then
-- this.SetRechargeTime(math.floor(GetTimeStamp()))
-- this.isFirstRecharge = 1
-- end
-- local day = GetTimePass(this.GetRechargeTime())
-- --local day = GetTimePass(math.floor(GetTimeStamp()))
-- if context.Values[1][2] <= day then
-- local state = missionInfo.state
-- return state ~= 1
-- else
-- return false
-- end
-- else
-- return false
-- end
-- end
-- return false
end
function this.GetReceiveAll()

View File

@ -6,11 +6,12 @@
* @Copyright Copyright (c) 2019, MagicianJoker
--]]
local DayRewardItem = require("Modules/FirstRecharge/DayRewardItem")
local rechargeConfig=ConfigManager.GetConfig(ConfigName.RechargeCommodityConfig)
---@class FirstRechargePanel
local FirstRechargePanel = quick_class("FirstRechargePanel", BasePanel)
local kMaxTab, kMaxDay = 4, 3
local rechargeId=0
local kMaxTab, kMaxDay = 2, 3
local isPay=false
local TextColorDef = {
[1] = Color.New(48 / 255, 31 / 255, 33 / 255, 1),
[2] = Color.New(246 / 255, 235 / 255, 179 / 255, 1)
@ -39,7 +40,7 @@ local TipConfig = {
local heroImage={
[1]="r_shouchong_hero_6",
[2]="r_shouchong_hero_100",
[2]="r_shouchong_hero_6",
[3]="r_shouchong_hero_200",
[4]="r_shouchong_hero_500",
}
@ -98,8 +99,9 @@ function FirstRechargePanel:InitComponent()
--bottomPart
self.reChargeBtn = Util.GetGameObject(self.transform, "frame/rechargeBtn")
self.reChargeTxt = Util.GetGameObject(self.transform, "frame/rechargeBtn/Text"):GetComponent("Text")
self.reChargeTips = Util.GetGameObject(self.transform, "frame/tips"):GetComponent("Text")
self.reChargeTips.gameObject:SetActive(false)
self.effect = Util.GetGameObject(self.transform, "frame/effect")
self.qianyao = Util.GetGameObject(self.transform, "qianyao")
self.ani = self.transform:GetComponent("Animator")
@ -201,11 +203,18 @@ function FirstRechargePanel:OnShow()
if missInfo and missInfo.progress then
-- 获取充值额度
AccumRecharge = missInfo.progress
--LogError("missInfo.missionId=="..missInfo.missionId)
-- 构建数据
local money = activityRewardConfig[missInfo.missionId].Values[1][1]
local index = FirstRechargeManager.GetFirstRechargeIndexByMoney(money)
if not _MoneyDataNum[index] then
--LogError("money===="..money)
--local index = FirstRechargeManager.GetFirstRechargeIndexByMoney(money)
local index=0
if money==10000 then
index=1
else
index=2
end
if _MoneyDataNum[index]==nil then
_MoneyDataNum[index] = {}
end
table.insert(_MoneyDataNum[index], missInfo)
@ -272,35 +281,57 @@ function FirstRechargePanel:OnTabChanged(index)
else
self.heroPreviewBtn:SetActive(true)
end
local money=0
for i, title in ipairs(self.tabTitles) do
title.color = i == index and TextColorDef[2] or TextColorDef[1]
local money = FirstRechargeManager.GetFirstRechargeMoneyByIndex(i)
title.text = string.format(Language[12281], string.format(MoneyUtil.GetMoneyUnitName(), money))
--local money = FirstRechargeManager.GetFirstRechargeMoneyByIndex(i)
if i==1 then
title.text ="超值首充"
elseif i==2 then
title.text ="豪华首充"
end
end
self.stageImage6.gameObject:SetActive(index == 1)
self.stageImage30.gameObject:SetActive(index == 2)
self.stageImage100.gameObject:SetActive(index == 3)
self.stageImage200.gameObject:SetActive(index == 4)
if index==1 then
money=10000
elseif index==2 then
money=20000
end
self.stageImage6.gameObject:SetActive(index == 5)
self.stageImage30.gameObject:SetActive(index == 5)
self.stageImage100.gameObject:SetActive(index == 5)
self.stageImage200.gameObject:SetActive(index == 5)
self:ShowContent(index)
self.selectTabIndex = index
local AccumRecharge = 0
self.offsetIndex = 0
local money = FirstRechargeManager.GetFirstRechargeMoneyByIndex(index)
--local money = FirstRechargeManager.GetFirstRechargeMoneyByIndex(index)
rechargeId=money
local tempData = _MoneyDataNum[index]
isPay=false
for _, missInfo in ipairs(tempData) do
if missInfo and missInfo.progress and activityRewardConfig[missInfo.missionId].Values[1][1] == money then
AccumRecharge = missInfo.progress
if AccumRecharge >= activityRewardConfig[missInfo.missionId].Values[1][1] then
local day = GetTimePass(FirstRechargeManager.GetRechargeTime())--FirstRechargeManager.GetRechargeTime()
if missInfo.state ~= 1 and activityRewardConfig[missInfo.missionId].Values[1][2] <= day then
self.offsetIndex = _
break
end
LogError("missionInfo.state=="..missInfo.state)
-- if AccumRecharge >= activityRewardConfig[missInfo.missionId].Values[1][1] then
-- local day = GetTimePass(FirstRechargeManager.GetRechargeTime())--FirstRechargeManager.GetRechargeTime()
-- if missInfo.state ~= 1 and activityRewardConfig[missInfo.missionId].Values[1][2] <= day then
-- self.offsetIndex = _
-- break
-- end
-- end
if missInfo.state>0 then
isPay=true
end
end
end
if isPay then
self.reChargeTxt.text=Language[10514]
else
self.reChargeTxt.text=rechargeConfig[money].Price..Language[11358]
end
if self.offsetIndex == 0 then
self.offsetIndex = 1
end
@ -358,7 +389,43 @@ end
-- end
function FirstRechargePanel:OnRechargeBtnClicked()
JumpManager.GoJump(36004)
if isPay then
return
end
PayManager.Pay(rechargeId,function()
--self:OnShow()
self.activityInfo = ActivityGiftManager.GetActivityTypeInfo(ActivityTypeDef.FirstRecharge)
_MoneyDataNum = {}
for _, missInfo in ipairs(self.activityInfo.mission) do
if missInfo and missInfo.progress then
-- 获取充值额度
AccumRecharge = missInfo.progress
--LogError("missInfo.missionId=="..missInfo.missionId)
-- 构建数据
local money = activityRewardConfig[missInfo.missionId].Values[1][1]
--LogError("money===="..money)
--local index = FirstRechargeManager.GetFirstRechargeIndexByMoney(money)
local index=0
if money==10000 then
index=1
else
index=2
end
if _MoneyDataNum[index]==nil then
_MoneyDataNum[index] = {}
end
table.insert(_MoneyDataNum[index], missInfo)
end
end
self.reChargeTips.text = Language[10664]..string.format(MoneyUtil.GetMoneyUnitName(),AccumRecharge)--string.format(Language[10665], AccumRecharge)
self:OnTabChanged(self.selectTabIndex)
for i = 1, kMaxTab do
self:SetTabRedPointStatus(i)
end
-- 判断页签切换是否显示
Util.GetGameObject(self.transform, "frame/tabsContent"):SetActive(table.nums(_MoneyDataNum)>1)
end)
--JumpManager.GoJump(36004)
-- if not ShopManager.IsActive(SHOP_TYPE.SOUL_STONE_SHOP) then
-- PopupTipPanel.ShowTip(Language[10422])
-- return
@ -373,9 +440,11 @@ function FirstRechargePanel:OnRechargeBtnClicked()
-- JumpManager.GoJump(36008)
-- end
-- end
end
function FirstRechargePanel:SetTabRedPointStatus(tabIndex)
--LogError("tabIndex=="..tabIndex)
local redPointStatus = FirstRechargeManager.GetRedPointStatus(tabIndex)
self.tabRedPoint[tabIndex]:SetActive(redPointStatus)
end