【按钮优化】充值 积天豪礼
parent
7b686298c8
commit
8901e7d4e6
|
@ -1903,7 +1903,7 @@ MonoBehaviour:
|
|||
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
|
||||
m_FontData:
|
||||
m_Font: {fileID: 12800000, guid: 4b73e9e4512d17e4daeea351e090d33c, type: 3}
|
||||
m_FontSize: 45
|
||||
m_FontSize: 40
|
||||
m_FontStyle: 0
|
||||
m_BestFit: 0
|
||||
m_MinSize: 4
|
||||
|
@ -4300,7 +4300,7 @@ MonoBehaviour:
|
|||
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
|
||||
m_FontData:
|
||||
m_Font: {fileID: 12800000, guid: 4b73e9e4512d17e4daeea351e090d33c, type: 3}
|
||||
m_FontSize: 45
|
||||
m_FontSize: 40
|
||||
m_FontStyle: 0
|
||||
m_BestFit: 0
|
||||
m_MinSize: 4
|
||||
|
@ -12453,7 +12453,7 @@ MonoBehaviour:
|
|||
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
|
||||
m_FontData:
|
||||
m_Font: {fileID: 12800000, guid: 4b73e9e4512d17e4daeea351e090d33c, type: 3}
|
||||
m_FontSize: 45
|
||||
m_FontSize: 40
|
||||
m_FontStyle: 0
|
||||
m_BestFit: 0
|
||||
m_MinSize: 4
|
||||
|
|
|
@ -71,17 +71,16 @@ function this.SingleDataShow(go, data)
|
|||
local name = Util.GetGameObject(go, "context/text"):GetComponent("Text")
|
||||
local price = Util.GetGameObject(go, "btnBuy/price"):GetComponent("Text")
|
||||
local buyInfo = Util.GetGameObject(go, "buyInfo")
|
||||
local buyInfo2 = Util.GetGameObject(go, "buyInfo2")
|
||||
local btnBuy = Util.GetGameObject(go, "btnBuy")
|
||||
local grid = Util.GetGameObject(go, "scrollView/grid")
|
||||
local shadow = Util.GetGameObject(go, "shadow")
|
||||
local tipImageText=Util.GetGameObject(go,"tip/tip1/text2"):GetComponent("Text")
|
||||
local LimitText=Util.GetGameObject(go,"tip/tip1/Image/text"):GetComponent("Text")
|
||||
|
||||
local goodData = OperatingManager.GetGiftGoodsInfo(GoodsTypeDef.DirectPurchaseGift, data.Id)
|
||||
local boughtNum = OperatingManager.GetGoodsBuyTime(GoodsTypeDef.DirectPurchaseGift, data.Id) or 0
|
||||
local shows = shopItemData.RewardShow
|
||||
name.text = shopItemData.Name
|
||||
tipImageText.text = Language[10536]..boughtNum.."/"..shopItemData.Limit..")"
|
||||
LimitText.text = shopItemData.Limit
|
||||
buyInfo:SetActive( shopItemData.IsDiscount ~= 0 )
|
||||
if shopItemData.IsDiscount and shopItemData.IsDiscount > 0 then
|
||||
|
@ -94,10 +93,13 @@ function this.SingleDataShow(go, data)
|
|||
price.text = string.format(MoneyUtil.GetMoneyUnitName(), MoneyUtil.GetMoney(shopItemData.Price))--..MoneyUtil.GetMoneyUnitName()
|
||||
btnBuy:GetComponent("Button").enabled = true
|
||||
Util.SetGray(btnBuy, false)
|
||||
buyInfo2:SetActive(true)
|
||||
buyInfo2:GetComponent("Text").text = Language[10535]..shopItemData.Limit - boughtNum..Language[10054]
|
||||
else
|
||||
price.text = Language[10539]
|
||||
price.text = Language[10526]
|
||||
btnBuy:GetComponent("Button").enabled = false
|
||||
Util.SetGray(btnBuy, true)
|
||||
buyInfo2:SetActive(false)
|
||||
end
|
||||
--滚动条复用重设itemview
|
||||
|
||||
|
|
|
@ -22,11 +22,13 @@ function ContinuityRechargeItem:ctor(prefab, parent)
|
|||
end
|
||||
|
||||
self.progress = Util.GetGameObject(self.cloneObj, "progress"):GetComponent("Text")
|
||||
self.progress.gameObject:SetActive(false)
|
||||
self.dealBtn = Util.GetGameObject(self.cloneObj, "dealBtn")
|
||||
self.dealBtnText = Util.GetGameObject(self.dealBtn, "Text"):GetComponent("Text")
|
||||
self.dealBtn:GetComponent("Button").onClick:AddListener(function()
|
||||
self:OnDealBtnClicked()
|
||||
end)
|
||||
self.finished = Util.GetGameObject(self.cloneObj, "finished")
|
||||
-- self.finished = Util.GetGameObject(self.cloneObj, "finished")
|
||||
--self.redPoint = Util.GetGameObject(self.cloneObj, "redPoint")
|
||||
|
||||
end
|
||||
|
@ -35,9 +37,9 @@ function ContinuityRechargeItem:Init(context,sortingOrder)
|
|||
self.localContext = context
|
||||
self.taskDesc.text = string.format(Language[11445], context.Sort)
|
||||
self.dealBtn:SetActive(true)
|
||||
self.finished:SetActive(false)
|
||||
-- self.finished:SetActive(false)
|
||||
--self.redPoint:SetActive(false)
|
||||
self.progress.text = "(0/1)"
|
||||
-- self.progress.text = "(0/1)"
|
||||
table.walk(self.rewardList, function(rewardItem)
|
||||
rewardItem.gameObject:SetActive(false)
|
||||
end)
|
||||
|
@ -55,22 +57,27 @@ end
|
|||
function ContinuityRechargeItem:SetValue()
|
||||
self.serverContext = ActivityGiftManager.GetActivityInfo(ActivityTypeDef.ContinuityRecharge, self.localContext.Id)
|
||||
if self.serverContext.state == 1 then
|
||||
self.dealBtn:SetActive(false)
|
||||
self.finished:SetActive(true)
|
||||
-- self.dealBtn:SetActive(true)
|
||||
-- self.finished:SetActive(false)
|
||||
--self.redPoint:SetActive(false)
|
||||
self.progress.text = "(1/1)"
|
||||
-- self.progress.text = (1/1)"
|
||||
self.dealBtn:GetComponent("Button").interactable = false
|
||||
Util.SetGray(self.dealBtn, true)
|
||||
self.dealBtnText.text = Language[10350]
|
||||
else
|
||||
self.finished:SetActive(false)
|
||||
self.dealBtn:SetActive(true)
|
||||
self.dealBtn:GetComponent("Image").sprite = Util.LoadSprite(TaskGetBtnIconDef[self.serverContext.progress])
|
||||
-- self.finished:SetActive(false)
|
||||
-- self.dealBtn:SetActive(true)
|
||||
-- self.dealBtn:GetComponent("Image").sprite = Util.LoadSprite(TaskGetBtnIconDef[self.serverContext.progress])
|
||||
--self.redPoint:SetActive(self.serverContext.progress == 1)
|
||||
self.progress.text = "("..self.serverContext.progress .. "/1"..")"
|
||||
-- self.progress.text = "("..self.serverContext.progress .. "/1"..")"
|
||||
if self.serverContext.progress == 1 then
|
||||
self.dealBtn:GetComponent("Button").interactable = true
|
||||
Util.SetGray(self.dealBtn, false)
|
||||
self.dealBtnText.text = Language[12012]
|
||||
else
|
||||
self.dealBtn:GetComponent("Button").interactable = self:IsCurrentSortEnable()
|
||||
Util.SetGray(self.dealBtn, not self:IsCurrentSortEnable())
|
||||
self.dealBtnText.text = Language[10509]
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -90,8 +97,8 @@ function ContinuityRechargeItem:OnDealBtnClicked()
|
|||
self.localContext.Id,
|
||||
1
|
||||
)
|
||||
self.dealBtn:SetActive(false)
|
||||
self.finished:SetActive(true)
|
||||
-- self.dealBtn:SetActive(false)
|
||||
-- self.finished:SetActive(true)
|
||||
--self.redPoint:SetActive(false)
|
||||
self.cloneObj.transform:SetAsLastSibling()
|
||||
CheckRedPointStatus(RedPointType.ContinuityRecharge)
|
||||
|
|
|
@ -11,6 +11,7 @@ local ContinuityRechargeItem = require("Modules/Operating/ContinuityRechargeItem
|
|||
local ContinuityRechargePage = quick_class("ContinuityRechargePage")
|
||||
local isPlayAnim = true
|
||||
local sortingOrder = 0
|
||||
local continuityTaskList = {}
|
||||
function ContinuityRechargePage:ctor(mainPanel, gameObject)
|
||||
self.mainPanel = mainPanel
|
||||
self.gameObject = gameObject
|
||||
|
@ -21,8 +22,6 @@ function ContinuityRechargePage:ctor(mainPanel, gameObject)
|
|||
self.continuityTaskItem = Util.GetGameObject(self.continuityTaskContent, "itemPro")
|
||||
self.effect = Util.GetGameObject(self.gameObject, "UI_effect_OperatingPanel_normal")
|
||||
self.continuityTaskItem:SetActive(false)
|
||||
self.continuityTaskList = {}
|
||||
|
||||
end
|
||||
function ContinuityRechargePage:OnShow(_sortingOrder)
|
||||
isPlayAnim = true
|
||||
|
@ -37,7 +36,7 @@ end
|
|||
function ContinuityRechargePage:OnSortingOrderChange(cursortingOrder)
|
||||
Util.AddParticleSortLayer( self.effect, cursortingOrder - sortingOrder)
|
||||
sortingOrder = cursortingOrder
|
||||
for i, v in pairs(self.continuityTaskList) do
|
||||
for i, v in pairs(continuityTaskList) do
|
||||
v:OnSortingOrderChange(cursortingOrder)
|
||||
end
|
||||
end
|
||||
|
@ -48,33 +47,31 @@ function ContinuityRechargePage:OnHide()
|
|||
end
|
||||
|
||||
function ContinuityRechargePage:RefreshPanel()
|
||||
local actRewardConfigs = ConfigManager.GetAllConfigsDataByKey(ConfigName.ActivityRewardConfig,
|
||||
"ActivityId", ActivityTypeDef.ContinuityRecharge)
|
||||
local actRewardConfigs = ConfigManager.GetAllConfigsDataByKey(ConfigName.ActivityRewardConfig,"ActivityId", ActivityTypeDef.ContinuityRecharge)
|
||||
self.conditionDesc.text = actRewardConfigs[1].Values[1][1]
|
||||
--Log("连续充值刷新"..ActivityGiftManager.GetActivityTypeInfo(ActivityTypeDef.ContinuityRecharge).value)
|
||||
for i, actRewardInfo in ipairs(actRewardConfigs) do
|
||||
self.continuityTaskList[i] = ContinuityRechargeItem.create(self.continuityTaskItem, self.continuityTaskContent)
|
||||
self.continuityTaskList[i]:Init(actRewardInfo,sortingOrder)
|
||||
-- if isPlayAnim then
|
||||
-- self.continuityTaskList[i].gameObject:SetActive(false)
|
||||
-- else
|
||||
-- self.continuityTaskList[i].gameObject:SetActive(true)
|
||||
-- end
|
||||
self.continuityTaskList[i]:SetValue()
|
||||
if not continuityTaskList[i] then
|
||||
continuityTaskList[i] = ContinuityRechargeItem.create(self.continuityTaskItem, self.continuityTaskContent)
|
||||
continuityTaskList[i]:Init(actRewardInfo,sortingOrder)
|
||||
end
|
||||
|
||||
-- for i, actRewardInfo in ipairs(actRewardConfigs) do
|
||||
-- self.continuityTaskList[i] = ContinuityRechargeItem.create(self.continuityTaskItem, self.continuityTaskContent)
|
||||
-- self.continuityTaskList[i]:Init(actRewardInfo,sortingOrder)
|
||||
-- self.continuityTaskList[i]:SetValue()
|
||||
-- end
|
||||
table.walk(self.continuityTaskList, function(continuityTaskItem)
|
||||
continuityTaskList[i]:SetValue()
|
||||
end
|
||||
table.walk(continuityTaskList, function(continuityTaskItem)
|
||||
continuityTaskItem:TrySetLastSibling()
|
||||
end)
|
||||
-- if isPlayAnim then
|
||||
-- SecTorPlayAnim(self.continuityTaskList)
|
||||
-- isPlayAnim = false
|
||||
-- end
|
||||
end
|
||||
|
||||
--界面关闭时调用(用于子类重写)
|
||||
function ContinuityRechargePage:OnClose()
|
||||
|
||||
end
|
||||
|
||||
--界面销毁时调用(用于子类重写)
|
||||
function ContinuityRechargePage:OnDestroy()
|
||||
|
||||
sortingOrder = 0
|
||||
continuityTaskList = {}
|
||||
end
|
||||
|
||||
return ContinuityRechargePage
|
Loading…
Reference in New Issue