【活动优化】每日特惠优化
parent
8d196f6759
commit
4659ad0f84
File diff suppressed because it is too large
Load Diff
|
@ -15000,6 +15000,14 @@ MonoBehaviour:
|
||||||
extension: .png
|
extension: .png
|
||||||
resPathIndex: 2
|
resPathIndex: 2
|
||||||
resAbNameIndex: 0
|
resAbNameIndex: 0
|
||||||
|
- resName: q_xinnianqiandao_rukou
|
||||||
|
extension: .png
|
||||||
|
resPathIndex: 2
|
||||||
|
resAbNameIndex: 0
|
||||||
|
- resName: q_xinnianqiandao_rukoutu
|
||||||
|
extension: .png
|
||||||
|
resPathIndex: 2
|
||||||
|
resAbNameIndex: 0
|
||||||
- resName: s_sanshibei_beijingren
|
- resName: s_sanshibei_beijingren
|
||||||
extension: .jpg
|
extension: .jpg
|
||||||
resPathIndex: 2
|
resPathIndex: 2
|
||||||
|
@ -39012,12 +39020,16 @@ MonoBehaviour:
|
||||||
extension: .mat
|
extension: .mat
|
||||||
resPathIndex: 307
|
resPathIndex: 307
|
||||||
resAbNameIndex: 2546
|
resAbNameIndex: 2546
|
||||||
- resName: longani 1
|
- resName: longani 1_anim
|
||||||
|
extension: .controller
|
||||||
|
resPathIndex: 308
|
||||||
|
resAbNameIndex: 2546
|
||||||
|
- resName: longani 1_ctrl
|
||||||
extension: .anim
|
extension: .anim
|
||||||
resPathIndex: 308
|
resPathIndex: 308
|
||||||
resAbNameIndex: 2546
|
resAbNameIndex: 2546
|
||||||
- resName: longani
|
- resName: longani
|
||||||
extension: .anim
|
extension: .FBX
|
||||||
resPathIndex: 308
|
resPathIndex: 308
|
||||||
resAbNameIndex: 2546
|
resAbNameIndex: 2546
|
||||||
- resName: longaniduan 1
|
- resName: longaniduan 1
|
||||||
|
@ -39025,6 +39037,18 @@ MonoBehaviour:
|
||||||
resPathIndex: 308
|
resPathIndex: 308
|
||||||
resAbNameIndex: 2546
|
resAbNameIndex: 2546
|
||||||
- resName: longaniduan
|
- resName: longaniduan
|
||||||
|
extension: .FBX
|
||||||
|
resPathIndex: 308
|
||||||
|
resAbNameIndex: 2546
|
||||||
|
- resName: longaniduan_ctrl
|
||||||
|
extension: .controller
|
||||||
|
resPathIndex: 308
|
||||||
|
resAbNameIndex: 2546
|
||||||
|
- resName: longani_anim
|
||||||
|
extension: .anim
|
||||||
|
resPathIndex: 308
|
||||||
|
resAbNameIndex: 2546
|
||||||
|
- resName: longani_ctrl
|
||||||
extension: .controller
|
extension: .controller
|
||||||
resPathIndex: 308
|
resPathIndex: 308
|
||||||
resAbNameIndex: 2546
|
resAbNameIndex: 2546
|
||||||
|
@ -43448,7 +43472,7 @@ MonoBehaviour:
|
||||||
extension: .mat
|
extension: .mat
|
||||||
resPathIndex: 521
|
resPathIndex: 521
|
||||||
resAbNameIndex: 2589
|
resAbNameIndex: 2589
|
||||||
- resName: dajin_effect_12
|
- resName: dajin_effect_12_1
|
||||||
extension: .mat
|
extension: .mat
|
||||||
resPathIndex: 521
|
resPathIndex: 521
|
||||||
resAbNameIndex: 2589
|
resAbNameIndex: 2589
|
||||||
|
@ -51216,6 +51240,10 @@ MonoBehaviour:
|
||||||
extension: .png
|
extension: .png
|
||||||
resPathIndex: 634
|
resPathIndex: 634
|
||||||
resAbNameIndex: 2604
|
resAbNameIndex: 2604
|
||||||
|
- resName: c_yanchen
|
||||||
|
extension: .png
|
||||||
|
resPathIndex: 634
|
||||||
|
resAbNameIndex: 2604
|
||||||
- resName: c_y_0013_buff
|
- resName: c_y_0013_buff
|
||||||
extension: .png
|
extension: .png
|
||||||
resPathIndex: 634
|
resPathIndex: 634
|
||||||
|
@ -52368,6 +52396,10 @@ MonoBehaviour:
|
||||||
extension: .png
|
extension: .png
|
||||||
resPathIndex: 634
|
resPathIndex: 634
|
||||||
resAbNameIndex: 2604
|
resAbNameIndex: 2604
|
||||||
|
- resName: r_tongyong_hongse0_00
|
||||||
|
extension: .png
|
||||||
|
resPathIndex: 634
|
||||||
|
resAbNameIndex: 2604
|
||||||
- resName: sanchajian4
|
- resName: sanchajian4
|
||||||
extension: .png
|
extension: .png
|
||||||
resPathIndex: 634
|
resPathIndex: 634
|
||||||
|
@ -52732,6 +52764,10 @@ MonoBehaviour:
|
||||||
extension: .png
|
extension: .png
|
||||||
resPathIndex: 634
|
resPathIndex: 634
|
||||||
resAbNameIndex: 2604
|
resAbNameIndex: 2604
|
||||||
|
- resName: t_chengyuankuang_hong_00
|
||||||
|
extension: .png
|
||||||
|
resPathIndex: 634
|
||||||
|
resAbNameIndex: 2604
|
||||||
- resName: T_noise_20_png
|
- resName: T_noise_20_png
|
||||||
extension: .png
|
extension: .png
|
||||||
resPathIndex: 634
|
resPathIndex: 634
|
||||||
|
@ -63148,6 +63184,10 @@ MonoBehaviour:
|
||||||
extension: .mat
|
extension: .mat
|
||||||
resPathIndex: 825
|
resPathIndex: 825
|
||||||
resAbNameIndex: 3237
|
resAbNameIndex: 3237
|
||||||
|
- resName: dajin_effect_12
|
||||||
|
extension: .mat
|
||||||
|
resPathIndex: 825
|
||||||
|
resAbNameIndex: 3237
|
||||||
- resName: dajin_effect_13
|
- resName: dajin_effect_13
|
||||||
extension: .mat
|
extension: .mat
|
||||||
resPathIndex: 825
|
resPathIndex: 825
|
||||||
|
@ -65728,10 +65768,6 @@ MonoBehaviour:
|
||||||
extension: .png
|
extension: .png
|
||||||
resPathIndex: 829
|
resPathIndex: 829
|
||||||
resAbNameIndex: 3240
|
resAbNameIndex: 3240
|
||||||
- resName: c_yanchen
|
|
||||||
extension: .png
|
|
||||||
resPathIndex: 829
|
|
||||||
resAbNameIndex: 3240
|
|
||||||
- resName: dg_011
|
- resName: dg_011
|
||||||
extension: .png
|
extension: .png
|
||||||
resPathIndex: 829
|
resPathIndex: 829
|
||||||
|
@ -66848,10 +66884,6 @@ MonoBehaviour:
|
||||||
extension: .png
|
extension: .png
|
||||||
resPathIndex: 829
|
resPathIndex: 829
|
||||||
resAbNameIndex: 3240
|
resAbNameIndex: 3240
|
||||||
- resName: r_tongyong_hongse0_00
|
|
||||||
extension: .png
|
|
||||||
resPathIndex: 829
|
|
||||||
resAbNameIndex: 3240
|
|
||||||
- resName: r_zjm_tequanpaizi_di
|
- resName: r_zjm_tequanpaizi_di
|
||||||
extension: .png
|
extension: .png
|
||||||
resPathIndex: 829
|
resPathIndex: 829
|
||||||
|
@ -67236,10 +67268,6 @@ MonoBehaviour:
|
||||||
extension: .png
|
extension: .png
|
||||||
resPathIndex: 829
|
resPathIndex: 829
|
||||||
resAbNameIndex: 3240
|
resAbNameIndex: 3240
|
||||||
- resName: t_chengyuankuang_hong_00
|
|
||||||
extension: .png
|
|
||||||
resPathIndex: 829
|
|
||||||
resAbNameIndex: 3240
|
|
||||||
- resName: T_Effect_01 (20)
|
- resName: T_Effect_01 (20)
|
||||||
extension: .png
|
extension: .png
|
||||||
resPathIndex: 829
|
resPathIndex: 829
|
||||||
|
@ -79640,6 +79668,7 @@ MonoBehaviour:
|
||||||
- lz4/atlas/compoundheroatlas.unity3d
|
- lz4/atlas/compoundheroatlas.unity3d
|
||||||
- lz4/atlas/popupatlas.unity3d
|
- lz4/atlas/popupatlas.unity3d
|
||||||
- lz4/atlas/publicatlas.unity3d
|
- lz4/atlas/publicatlas.unity3d
|
||||||
|
- lz4/atlas/zhizunhaoliatlas.unity3d
|
||||||
- lz4/bg/z_zhihuan_ditu.unity3d
|
- lz4/bg/z_zhihuan_ditu.unity3d
|
||||||
- lz4/dynamicatlas/card/t_biandui_hong.unity3d
|
- lz4/dynamicatlas/card/t_biandui_hong.unity3d
|
||||||
- lz4/dynamicatlas/card/t_zhandoukuang_hong01.unity3d
|
- lz4/dynamicatlas/card/t_zhandoukuang_hong01.unity3d
|
||||||
|
@ -80598,6 +80627,7 @@ MonoBehaviour:
|
||||||
- lz4/atlas/publicatlas.unity3d
|
- lz4/atlas/publicatlas.unity3d
|
||||||
- lz4/atlas/tagatlas.unity3d
|
- lz4/atlas/tagatlas.unity3d
|
||||||
- lz4/atlas/tagbuttonatlas.unity3d
|
- lz4/atlas/tagbuttonatlas.unity3d
|
||||||
|
- lz4/atlas/zhizunhaoliatlas.unity3d
|
||||||
- lz4/bg/g_gonghui_jisi_ditu.unity3d
|
- lz4/bg/g_gonghui_jisi_ditu.unity3d
|
||||||
- lz4/bg/g_gonghui_renshangxiamenghei.unity3d
|
- lz4/bg/g_gonghui_renshangxiamenghei.unity3d
|
||||||
- lz4/bg/g_gonghui_shijuezhen_bei.unity3d
|
- lz4/bg/g_gonghui_shijuezhen_bei.unity3d
|
||||||
|
@ -80931,6 +80961,7 @@ MonoBehaviour:
|
||||||
- lz4/publicartres/materials.unity3d
|
- lz4/publicartres/materials.unity3d
|
||||||
- assetBundleName: lz4/prefabs/ui/main.unity3d
|
- assetBundleName: lz4/prefabs/ui/main.unity3d
|
||||||
dependences:
|
dependences:
|
||||||
|
- lz4/atlas/activityaltas.unity3d
|
||||||
- lz4/atlas/commonatlas.unity3d
|
- lz4/atlas/commonatlas.unity3d
|
||||||
- lz4/atlas/jumpserver.unity3d
|
- lz4/atlas/jumpserver.unity3d
|
||||||
- lz4/atlas/mainatlas.unity3d
|
- lz4/atlas/mainatlas.unity3d
|
||||||
|
|
|
@ -2,7 +2,7 @@ local EveryDayGiftNew = {}
|
||||||
local rechargeNum = 0
|
local rechargeNum = 0
|
||||||
local growData = {}
|
local growData = {}
|
||||||
local rechargeCommodityConfig = ConfigManager.GetConfig(ConfigName.RechargeCommodityConfig)
|
local rechargeCommodityConfig = ConfigManager.GetConfig(ConfigName.RechargeCommodityConfig)
|
||||||
local onKeyPackId = 1008
|
local onKeyPackId = 1004
|
||||||
function EveryDayGiftNew:New(gameObject)
|
function EveryDayGiftNew:New(gameObject)
|
||||||
local b = {}
|
local b = {}
|
||||||
b.gameObject = gameObject
|
b.gameObject = gameObject
|
||||||
|
@ -49,36 +49,38 @@ function EveryDayGiftNew:InitComponent()
|
||||||
|
|
||||||
--=================Rewards=================
|
--=================Rewards=================
|
||||||
self.Reward = Util.GetGameObject(self.newPage,"Reward")
|
self.Reward = Util.GetGameObject(self.newPage,"Reward")
|
||||||
self.Button = Util.GetGameObject(self.newPage,"Button")
|
self.Reward:GetComponent("RectTransform").sizeDelta = Vector2.New(1080,1026.7)
|
||||||
self.btn1 = Util.GetGameObject(self.Button,"btn1")
|
|
||||||
self.btn1Red = Util.GetGameObject(self.btn1,"red")
|
|
||||||
self.btn2 = Util.GetGameObject(self.Button,"btn2")
|
|
||||||
self.btn2Text = Util.GetGameObject(self.btn2,"Text"):GetComponent("Text")
|
|
||||||
|
|
||||||
self.endTimeBg = Util.GetGameObject(self.newPage,"growPack/Time")
|
self.endTimeBg = Util.GetGameObject(self.newPage,"growPack/Time")
|
||||||
self.endTime = Util.GetGameObject(self.endTimeBg,"Text"):GetComponent("Text")
|
self.endTime = Util.GetGameObject(self.endTimeBg,"Text"):GetComponent("Text")
|
||||||
|
|
||||||
|
|
||||||
local rootHight = self.Reward.transform.rect.height
|
|
||||||
local width = self.Reward.transform.rect.width
|
|
||||||
self.scrollView = SubUIManager.Open(SubUIConfig.ScrollCycleView, self.Reward.transform,
|
|
||||||
self.itemPre, nil, Vector2.New(width, rootHight), 1, 1, Vector2.New(0, 10))
|
|
||||||
self.scrollView.moveTween.MomentumAmount = 1
|
|
||||||
self.scrollView.moveTween.Strength = 2
|
|
||||||
self.scrollView.elastic = false
|
|
||||||
self.ItemList = {}
|
self.ItemList = {}
|
||||||
self.sortingOrder = 0
|
self.sortingOrder = 0
|
||||||
|
|
||||||
|
--=================extraTitle================
|
||||||
|
self.extarTitle = Util.GetGameObject(self.newPage,"extarTitle")
|
||||||
|
self.extarTitle:SetActive(false)
|
||||||
|
self.extarFreeBtn = Util.GetGameObject(self.extarTitle,"freeBtn")
|
||||||
|
self.freeBtnAnim = Util.GetGameObject(self.extarFreeBtn,"UI_effect_TanSuo_Box"):GetComponent("Animator")
|
||||||
|
self.freeBtnRed = Util.GetGameObject(self.extarFreeBtn,"redPoint")
|
||||||
|
self.extarStoreBtn = Util.GetGameObject(self.extarTitle,"Bg/store")
|
||||||
|
self.UI_Effect_jinkuang_Yuan = Util.GetGameObject(self.extarStoreBtn, "UI_Effect_jinkuang_Yuan")
|
||||||
|
self.extarOneKeyBtn = Util.GetGameObject(self.extarTitle,"Bg/oneKey/oneKeyBtn")
|
||||||
|
self.allSaoGuang = Util.GetGameObject(self.extarOneKeyBtn, "saoguang")
|
||||||
|
self.extarOneKeyprice1 = Util.GetGameObject(self.extarTitle,"Bg/oneKey/nowPrice"):GetComponent("Text")
|
||||||
|
self.extarOneKeyprice2 = Util.GetGameObject(self.extarTitle,"Bg/oneKey/oriPrice"):GetComponent("Text")
|
||||||
|
|
||||||
|
self.lightList = {
|
||||||
|
Util.GetGameObject(self.freeBtnAnim.gameObject,"bg_ray"),
|
||||||
|
Util.GetGameObject(self.freeBtnAnim.gameObject,"yinying/ray 1"),
|
||||||
|
Util.GetGameObject(self.freeBtnAnim.gameObject,"yinying/ray 2"),
|
||||||
|
Util.GetGameObject(self.freeBtnAnim.gameObject,"yinying/ray 3"),
|
||||||
|
Util.GetGameObject(self.freeBtnAnim.gameObject,"yinying/ray 4"),
|
||||||
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
function EveryDayGiftNew:BindEvent()
|
function EveryDayGiftNew:BindEvent()
|
||||||
|
Util.AddOnceClick(self.extarOneKeyBtn,function ()
|
||||||
Util.AddOnceClick(self.btn2,function ()
|
if self.actType ~= FUNCTION_OPEN_TYPE.MeiRiLiBao then return end
|
||||||
for i = 1, #self.shopData do
|
|
||||||
if self.shopData[i].data.boughtNum > 0 then
|
|
||||||
PopupTipPanel.ShowTip("需要未购买每日礼包时才可使用!")
|
|
||||||
return
|
|
||||||
end
|
|
||||||
end
|
|
||||||
PayManager.Pay(onKeyPackId, function(id)
|
PayManager.Pay(onKeyPackId, function(id)
|
||||||
FirstRechargeManager.RefreshAccumRechargeValue(onKeyPackId)
|
FirstRechargeManager.RefreshAccumRechargeValue(onKeyPackId)
|
||||||
PlayerPrefs.SetInt(PlayerManager.uid.."czlb", 0)
|
PlayerPrefs.SetInt(PlayerManager.uid.."czlb", 0)
|
||||||
|
@ -87,6 +89,10 @@ function EveryDayGiftNew:BindEvent()
|
||||||
self:RefreshData(nil,false,false)
|
self:RefreshData(nil,false,false)
|
||||||
end)
|
end)
|
||||||
end)
|
end)
|
||||||
|
Util.AddOnceClick(self.extarStoreBtn,function()
|
||||||
|
if self.actType ~= FUNCTION_OPEN_TYPE.MeiRiLiBao then return end
|
||||||
|
JumpManager.GoJump(40020)
|
||||||
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
--界面打开时调用(用于子类重写)
|
--界面打开时调用(用于子类重写)
|
||||||
|
@ -99,12 +105,12 @@ end
|
||||||
|
|
||||||
function EveryDayGiftNew:OnSortingOrderChange(_sortingOrder)
|
function EveryDayGiftNew:OnSortingOrderChange(_sortingOrder)
|
||||||
self.sortingOrder = _sortingOrder
|
self.sortingOrder = _sortingOrder
|
||||||
|
Util.SetParticleSortLayer(self.UI_Effect_jinkuang_Yuan, _sortingOrder + 1)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- 打开,重新打开时回调
|
-- 打开,重新打开时回调
|
||||||
function EveryDayGiftNew:OnShow(_sortingOrder)
|
function EveryDayGiftNew:OnShow(_sortingOrder)
|
||||||
self.gameObject:SetActive(true)
|
self.gameObject:SetActive(true)
|
||||||
self.Button:SetActive(false)
|
|
||||||
self.sortingOrder = _sortingOrder or self.sortingOrder
|
self.sortingOrder = _sortingOrder or self.sortingOrder
|
||||||
self.actId = self.actConfig.ActId
|
self.actId = self.actConfig.ActId
|
||||||
self.actType = self.actConfig.ActiveType > 0 and self.actConfig.ActiveType or self.actConfig.FunType
|
self.actType = self.actConfig.ActiveType > 0 and self.actConfig.ActiveType or self.actConfig.FunType
|
||||||
|
@ -135,20 +141,35 @@ function EveryDayGiftNew:RefreshData(none,isTop,isAni)
|
||||||
self.shopData = DynamicActivityManager.GetGiftDataByType(self.actConfig.ShopData)
|
self.shopData = DynamicActivityManager.GetGiftDataByType(self.actConfig.ShopData)
|
||||||
--成长礼包
|
--成长礼包
|
||||||
self:SetGrowGift()
|
self:SetGrowGift()
|
||||||
|
|
||||||
|
--特殊处理部分
|
||||||
|
Log("actType:"..tostring(self.actType))
|
||||||
|
if self.actType == FUNCTION_OPEN_TYPE.MeiRiLiBao then
|
||||||
|
self.extarTitle:SetActive(true)
|
||||||
|
--每日礼
|
||||||
|
self:RefreshFreeData()
|
||||||
|
-- 刷新一键购买显示
|
||||||
|
self:RefreshOneKeyShow()
|
||||||
|
self.Reward:GetComponent("RectTransform").sizeDelta = Vector2.New(1080,752)
|
||||||
|
end
|
||||||
|
|
||||||
|
if not self.scrollView then
|
||||||
|
--更改完空间大小后再生成滚动条
|
||||||
|
local rootHight = self.Reward.transform.rect.height
|
||||||
|
local width = self.Reward.transform.rect.width
|
||||||
|
self.scrollView = SubUIManager.Open(SubUIConfig.ScrollCycleView, self.Reward.transform,
|
||||||
|
self.itemPre, nil, Vector2.New(width, rootHight), 1, 1, Vector2.New(0, 10))
|
||||||
|
self.scrollView.moveTween.MomentumAmount = 1
|
||||||
|
self.scrollView.moveTween.Strength = 2
|
||||||
|
self.scrollView.elastic = false
|
||||||
|
end
|
||||||
|
|
||||||
-- 刷新剩余时间
|
-- 刷新剩余时间
|
||||||
self:GetRemainTime()
|
self:GetRemainTime()
|
||||||
-- 刷新商品数据
|
-- 刷新商品数据
|
||||||
self:RefreshGiftData(isTop,isAni)
|
self:RefreshGiftData(isTop,isAni)
|
||||||
|
|
||||||
--特殊处理部分
|
|
||||||
Log("actType:"..tostring(self.actType))
|
|
||||||
if self.actType == ActivityTypeDef.MeiRiLiBao then
|
|
||||||
self.Button:SetActive(true)
|
|
||||||
--每日礼
|
|
||||||
self:RefreshFreeData()
|
|
||||||
-- 刷新一键购买显示
|
|
||||||
self:RefreshOneKeyShow()
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
--==============================成长礼包部分==========================(rechargeViewNew和EveryDayGiftNew中有完全相同的部分,复制过去)
|
--==============================成长礼包部分==========================(rechargeViewNew和EveryDayGiftNew中有完全相同的部分,复制过去)
|
||||||
|
@ -410,11 +431,11 @@ function EveryDayGiftNew:GetRemainTime()
|
||||||
end
|
end
|
||||||
self:RefreshData(nil,true,true)
|
self:RefreshData(nil,true,true)
|
||||||
end
|
end
|
||||||
if actData then
|
-- if actData then
|
||||||
self.btn2Text.text = string.format("剩余%s天",math.ceil(packFreshTime/86400))
|
-- self.btn2Text.text = string.format("剩余%s天",math.ceil(packFreshTime/86400))
|
||||||
else
|
-- else
|
||||||
self.btn2Text.text = string.format("60元七天特惠")
|
-- self.btn2Text.text = string.format("60元七天特惠")
|
||||||
end
|
-- end
|
||||||
freshTime = freshTime - 1
|
freshTime = freshTime - 1
|
||||||
packFreshTime = packFreshTime - 1
|
packFreshTime = packFreshTime - 1
|
||||||
end, 1, -1, true)
|
end, 1, -1, true)
|
||||||
|
@ -425,24 +446,31 @@ end
|
||||||
--==============================每日特惠特殊处理部分===================
|
--==============================每日特惠特殊处理部分===================
|
||||||
--刷新一键购买显示
|
--刷新一键购买显示
|
||||||
function EveryDayGiftNew:RefreshOneKeyShow()
|
function EveryDayGiftNew:RefreshOneKeyShow()
|
||||||
Util.SetGray(self.btn2,false)
|
Util.SetParticleSortLayer(self.UI_Effect_jinkuang_Yuan, self.sortingOrder + 1)
|
||||||
|
Util.SetGray(self.extarOneKeyBtn,false)
|
||||||
|
self.extarOneKeyBtn:GetComponent("Button").interactable = true
|
||||||
|
self.allSaoGuang:SetActive(true)
|
||||||
|
-- 计算总价
|
||||||
|
local ori = 0
|
||||||
|
for i = 1 , #self.shopData do
|
||||||
|
ori = ori + self.shopData[i].data.finalNum
|
||||||
|
end
|
||||||
|
-- 计算现价
|
||||||
|
local now = 0
|
||||||
|
now = now + MoneyUtil.GetMoney(ConfigManager.GetConfigData(ConfigName.RechargeCommodityConfig,1004).Price)
|
||||||
|
|
||||||
local actData = ActivityGiftManager.GetActivityTypeInfo(89)
|
self.extarOneKeyprice2.text = Language[10582] .. string.format(MoneyUtil.GetMoneyUnitName(),ori)
|
||||||
if actData then
|
self.extarOneKeyprice1.text = Language[10644] .. string.format(MoneyUtil.GetMoneyUnitName(),now)
|
||||||
Util.SetGray(self.btn2,true)
|
|
||||||
self.btn2:GetComponent("Button").interactable = false
|
for i = 1, #self.shopData do
|
||||||
self.btn2Text.text = string.format("剩余%s天",math.ceil((actData.endTime - GetTimeStamp())/86400))
|
if self.shopData[i].data.boughtNum > 0 then
|
||||||
else
|
Util.SetGray(self.extarOneKeyBtn,true)
|
||||||
Util.SetGray(self.btn2,false)
|
self.extarOneKeyBtn:GetComponent("Button").interactable = false
|
||||||
self.btn2:GetComponent("Button").interactable = true
|
self.allSaoGuang:SetActive(false)
|
||||||
self.btn2Text.text = string.format("60元七天特惠")
|
break
|
||||||
for i = 1, #self.shopData do
|
|
||||||
if self.shopData[i].data.boughtNum > 0 then
|
|
||||||
Util.SetGray(self.btn2,true)
|
|
||||||
break
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
--刷新每日免费礼包
|
--刷新每日免费礼包
|
||||||
|
@ -451,11 +479,14 @@ function EveryDayGiftNew:RefreshFreeData()
|
||||||
local boughtNum = ShopManager.GetShopItemHadBuyTimes(SHOP_TYPE.FREE_GIFT, freeData[1].id)
|
local boughtNum = ShopManager.GetShopItemHadBuyTimes(SHOP_TYPE.FREE_GIFT, freeData[1].id)
|
||||||
local limitNum = ShopManager.GetShopItemLimitBuyCount(freeData[1].id)
|
local limitNum = ShopManager.GetShopItemLimitBuyCount(freeData[1].id)
|
||||||
local isCanBuy = limitNum - boughtNum >= 1
|
local isCanBuy = limitNum - boughtNum >= 1
|
||||||
self.btn1Red:SetActive(isCanBuy)
|
self.freeBtnAnim.enabled = isCanBuy
|
||||||
|
self.freeBtnRed:SetActive(isCanBuy)
|
||||||
Util.SetGray(self.btn1,not isCanBuy)
|
-- 光效显隐
|
||||||
|
for _, light in ipairs(self.lightList) do
|
||||||
|
light:SetActive(isCanBuy)
|
||||||
|
end
|
||||||
CheckRedPointStatus(RedPointType.DailyGift)
|
CheckRedPointStatus(RedPointType.DailyGift)
|
||||||
Util.AddOnceClick(self.btn1,function()
|
Util.AddOnceClick(self.extarFreeBtn,function()
|
||||||
if isCanBuy then
|
if isCanBuy then
|
||||||
ShopManager.RequestBuyShopItem(SHOP_TYPE.FREE_GIFT, freeData[1].id, 1, function()
|
ShopManager.RequestBuyShopItem(SHOP_TYPE.FREE_GIFT, freeData[1].id, 1, function()
|
||||||
self:RefreshFreeData()
|
self:RefreshFreeData()
|
||||||
|
|
Loading…
Reference in New Issue