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