【商城界面】提交
parent
2858f2e400
commit
e9954f49f2
|
@ -664,14 +664,6 @@ function this.GetGiftDataByType(ShopData)
|
||||||
-- end
|
-- end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
-- elseif ShopData[i][1] == DataType.Mix then--限定为每日特惠制作
|
|
||||||
-- --购买一键礼包之前为各个礼包数据,购买后为活动数据
|
|
||||||
-- -- LogGreen("ShopData[i][2]:"..tostring(ShopData[i][2]))
|
|
||||||
-- local topspeedData = this.ResetShopData(OperatingManager.GetGiftGoodsInfoList(ShopData[i][2]), ShopData[i][3], ShopData[i][1],ShopData[i][4])
|
|
||||||
-- for i = 1, #topspeedData do
|
|
||||||
-- table.insert(shopData,topspeedData[i])
|
|
||||||
-- end
|
|
||||||
-- -- LogGreen("#shopData:"..tostring(#shopData))
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
table.sort(shopData,function(a,b)
|
table.sort(shopData,function(a,b)
|
||||||
|
@ -770,50 +762,6 @@ function this.CreatSingleData(shopData,DataTypeIndex,buyType,actType)
|
||||||
data.price = string.format(MoneyUtil.GetMoneyUnitName(), data.finalNum)
|
data.price = string.format(MoneyUtil.GetMoneyUnitName(), data.finalNum)
|
||||||
end
|
end
|
||||||
data.endTime = shopData.endTime
|
data.endTime = shopData.endTime
|
||||||
-- elseif DataTypeIndex == DataType.Mix and rechargeCommodityConfig[shopData.goodsId].ShowType == buyType then
|
|
||||||
-- data.shopData = shopData
|
|
||||||
-- data.shopItemData = rechargeCommodityConfig[shopData.goodsId]
|
|
||||||
-- data.shows = data.shopItemData.RewardShow
|
|
||||||
-- data.tagName = GetLanguageStrById(data.shopItemData.Name)
|
|
||||||
-- data.boughtNum = OperatingManager.GetGoodsBuyTime(data.shopItemData.Type,shopData.goodsId)
|
|
||||||
-- data.limitNum = rechargeCommodityConfig[shopData.goodsId].Limit
|
|
||||||
-- -- LogRed("boughtNum:"..tostring(data.boughtNum).." limitNum:"..tostring(data.limitNum))
|
|
||||||
-- if data.limitNum == -1 then
|
|
||||||
-- curSortId = 2
|
|
||||||
-- elseif data.limitNum - data.boughtNum > 0 then
|
|
||||||
-- curSortId = 1
|
|
||||||
-- end
|
|
||||||
-- data.costId = nil
|
|
||||||
-- data.finalNum = MoneyUtil.GetMoney(data.shopItemData.Price)
|
|
||||||
-- data.oriCostNum = nil
|
|
||||||
-- if data.shopItemData.DailyUpdate == 7 then
|
|
||||||
-- data.tipImageText = Language[11699]
|
|
||||||
-- elseif data.shopItemData.DailyUpdate == 15 then
|
|
||||||
-- data.tipImageText = Language[11700]
|
|
||||||
-- elseif data.shopItemData.DailyUpdate == 30 then
|
|
||||||
-- data.tipImageText = Language[11357]
|
|
||||||
-- elseif shopData.goodsId == 9107 then
|
|
||||||
-- data.tipImageText = Language[12298]
|
|
||||||
-- else
|
|
||||||
-- data.tipImageText = nil
|
|
||||||
-- end
|
|
||||||
-- local actData = ActivityGiftManager.GetActivityTypeInfo(actType)
|
|
||||||
-- if actData then
|
|
||||||
-- local configData = ConfigManager.GetConfigDataByDoubleKey(ConfigName.ActivityRewardConfig,"ActivityId",actType,"Sort",data.shopItemData.Sequence)
|
|
||||||
-- data.price = "可领取"
|
|
||||||
-- data.linkAct = true
|
|
||||||
-- data.missionId = configData.Id
|
|
||||||
-- data.activityId = actData.activityId
|
|
||||||
-- data.state = actData.mission[data.shopItemData.Sequence].state
|
|
||||||
-- data.buyInfo = ""
|
|
||||||
-- else
|
|
||||||
-- data.price = string.format(MoneyUtil.GetMoneyUnitName(), data.finalNum)
|
|
||||||
-- data.linkAct = false
|
|
||||||
-- data.missionId = 0
|
|
||||||
-- data.activityId = 0
|
|
||||||
-- data.buyInfo = Language[10580]..data.limitNum - data.boughtNum..Language[10048]
|
|
||||||
-- end
|
|
||||||
-- data.endTime = shopData.endTime
|
|
||||||
else
|
else
|
||||||
return nil
|
return nil
|
||||||
end
|
end
|
||||||
|
|
|
@ -727,6 +727,7 @@ function this.PaySuccess(buffer)
|
||||||
PopupTipPanel.ShowTip(tip)
|
PopupTipPanel.ShowTip(tip)
|
||||||
--FirstRechargeManager.RefreshAccumRechargeValue(msg.goodsId)
|
--FirstRechargeManager.RefreshAccumRechargeValue(msg.goodsId)
|
||||||
-- 延时0.5秒刷新。避免sdk支付时商店次数未刷新,界面刷新的问题
|
-- 延时0.5秒刷新。避免sdk支付时商店次数未刷新,界面刷新的问题
|
||||||
|
DynamicActivityManager.growIndex = 0
|
||||||
Timer.New(function()
|
Timer.New(function()
|
||||||
Game.GlobalEvent:DispatchEvent(GameEvent.MoneyPay.OnPayResultSuccess, msg.goodsId)
|
Game.GlobalEvent:DispatchEvent(GameEvent.MoneyPay.OnPayResultSuccess, msg.goodsId)
|
||||||
end, 0.5):Start()
|
end, 0.5):Start()
|
||||||
|
|
|
@ -14,10 +14,12 @@ end
|
||||||
|
|
||||||
--添加事件监听(用于子类重写)
|
--添加事件监听(用于子类重写)
|
||||||
function EveryDayGiftNew:AddListener()
|
function EveryDayGiftNew:AddListener()
|
||||||
|
Game.GlobalEvent:AddEvent(GameEvent.MoneyPay.OnPayResultSuccess,self.SetGrowGift,self)
|
||||||
end
|
end
|
||||||
|
|
||||||
--移除事件监听(用于子类重写)
|
--移除事件监听(用于子类重写)
|
||||||
function EveryDayGiftNew:RemoveListener()
|
function EveryDayGiftNew:RemoveListener()
|
||||||
|
Game.GlobalEvent:RemoveEvent(GameEvent.MoneyPay.OnPayResultSuccess,self.SetGrowGift,self)
|
||||||
end
|
end
|
||||||
|
|
||||||
function EveryDayGiftNew:InitComponent()
|
function EveryDayGiftNew:InitComponent()
|
||||||
|
@ -137,15 +139,14 @@ function EveryDayGiftNew:RefreshData(none,isTop,isAni)
|
||||||
self:RefreshFreeData()
|
self:RefreshFreeData()
|
||||||
-- 刷新一键购买显示
|
-- 刷新一键购买显示
|
||||||
self:RefreshOneKeyShow()
|
self:RefreshOneKeyShow()
|
||||||
|
|
||||||
local actData = ActivityGiftManager.GetActivityTypeInfo(89)
|
|
||||||
if actData then
|
|
||||||
LogYellow("actData.id:"..tostring(actData.activityId))
|
|
||||||
for i = 1, 3 do
|
|
||||||
LogGreen("missionId:"..tostring(actData.mission[i].missionId).." state:"..tostring(actData.mission[i].state))
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
-- local actData = ActivityGiftManager.GetActivityTypeInfo(89)
|
||||||
|
-- if actData then
|
||||||
|
-- LogYellow("actData.id:"..tostring(actData.activityId).." time:"..tostring(actData.endTime))
|
||||||
|
-- for i = 1, 3 do
|
||||||
|
-- LogGreen("missionId:"..tostring(actData.mission[i].missionId).." state:"..tostring(actData.mission[i].state))
|
||||||
|
-- end
|
||||||
|
-- end
|
||||||
end
|
end
|
||||||
|
|
||||||
--==============================成长礼包部分==========================
|
--==============================成长礼包部分==========================
|
||||||
|
@ -319,18 +320,26 @@ function EveryDayGiftNew:GetRemainTime()
|
||||||
end
|
end
|
||||||
local la = self.actConfig.ShowTime ~= 1 and Language[10023] or Language[11355]
|
local la = self.actConfig.ShowTime ~= 1 and Language[10023] or Language[11355]
|
||||||
local freshTime = 0
|
local freshTime = 0
|
||||||
|
local packFreshTime = 0
|
||||||
|
|
||||||
if self.shopData and #self.shopData > 0 then
|
if self.shopData and #self.shopData > 0 then
|
||||||
freshTime = self.shopData[#self.shopData].data.endTime - GetTimeStamp()
|
freshTime = self.shopData[#self.shopData].data.endTime - GetTimeStamp()
|
||||||
end
|
end
|
||||||
|
local actData = ActivityGiftManager.GetActivityTypeInfo(89)
|
||||||
|
if actData then
|
||||||
|
packFreshTime = actData.endTime - GetTimeStamp()
|
||||||
|
end
|
||||||
self.endTime.text = la..TimeToFelaxible(freshTime)
|
self.endTime.text = la..TimeToFelaxible(freshTime)
|
||||||
self.localTimer = Timer.New(function ()
|
self.localTimer = Timer.New(function ()
|
||||||
self.endTime.text = la..TimeToFelaxible(freshTime)
|
self.endTime.text = la..TimeToFelaxible(freshTime)
|
||||||
if freshTime <= 0 then
|
if freshTime <= 0 then
|
||||||
self:RefreshData(nil,true,true)
|
self:RefreshData(nil,true,true)
|
||||||
end
|
end
|
||||||
|
if actData then
|
||||||
|
self.btn2Text.text = string.format("剩余%s天",math.ceil(packFreshTime/86400))
|
||||||
|
end
|
||||||
freshTime = freshTime - 1
|
freshTime = freshTime - 1
|
||||||
|
packFreshTime = packFreshTime - 1
|
||||||
end, 1, -1, true)
|
end, 1, -1, true)
|
||||||
self.localTimer:Start()
|
self.localTimer:Start()
|
||||||
end
|
end
|
||||||
|
@ -352,30 +361,24 @@ function EveryDayGiftNew:RefreshOneKeyShow()
|
||||||
if actData then
|
if actData then
|
||||||
Util.SetGray(self.btn2,true)
|
Util.SetGray(self.btn2,true)
|
||||||
self.btn2:GetComponent("Button").interactable = false
|
self.btn2:GetComponent("Button").interactable = false
|
||||||
|
self.btn2Text.text = string.format("剩余%s天",math.ceil((actData.endTime - GetTimeStamp())/86400))
|
||||||
else
|
else
|
||||||
Util.SetGray(self.btn2,false)
|
Util.SetGray(self.btn2,false)
|
||||||
self.btn2:GetComponent("Button").interactable = true
|
self.btn2:GetComponent("Button").interactable = true
|
||||||
|
self.btn2Text.text = string.format("60元七天特惠")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
--刷新每日免费礼包
|
--刷新每日免费礼包
|
||||||
function EveryDayGiftNew:RefreshFreeData()
|
function EveryDayGiftNew:RefreshFreeData()
|
||||||
-- if self.actType ~= FUNCTION_OPEN_TYPE.MeiRiLiBao then
|
|
||||||
-- return
|
|
||||||
-- end
|
|
||||||
local freeData = ShopManager.GetShopDataByType(SHOP_TYPE.FREE_GIFT).storeItem
|
local freeData = ShopManager.GetShopDataByType(SHOP_TYPE.FREE_GIFT).storeItem
|
||||||
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.freeBtnAnim.enabled = isCanBuy
|
|
||||||
self.btn1Red:SetActive(isCanBuy)
|
self.btn1Red:SetActive(isCanBuy)
|
||||||
-- 光效显隐
|
|
||||||
-- for _, light in ipairs(self.lightList) do
|
|
||||||
-- light:SetActive(isCanBuy)
|
|
||||||
-- end
|
|
||||||
Util.SetGray(self.btn1,not isCanBuy)
|
Util.SetGray(self.btn1,not isCanBuy)
|
||||||
CheckRedPointStatus(RedPointType.DailyGift)
|
CheckRedPointStatus(RedPointType.DailyGift)
|
||||||
-- LogGreen("isCanBuy:"..tostring(isCanBuy))
|
|
||||||
Util.AddOnceClick(self.btn1,function()
|
Util.AddOnceClick(self.btn1,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()
|
||||||
|
|
|
@ -105,16 +105,6 @@ function GiftPre:BindEvent()
|
||||||
self:BuyAction(self.data.data.costId, self.data.data.finalNum, self.data.buyType, self.data.data.shopData.id)--特权商城
|
self:BuyAction(self.data.data.costId, self.data.data.finalNum, self.data.buyType, self.data.data.shopData.id)--特权商城
|
||||||
CheckRedPointStatus(RedPointType.GrowthPackage)
|
CheckRedPointStatus(RedPointType.GrowthPackage)
|
||||||
elseif self.data.DataType == DataType.Direct then
|
elseif self.data.DataType == DataType.Direct then
|
||||||
--直购商品
|
|
||||||
PayManager.Pay(self.data.data.shopData.goodsId, function(id)
|
|
||||||
FirstRechargeManager.RefreshAccumRechargeValue(self.data.data.shopData.goodsId)
|
|
||||||
CheckRedPointStatus(RedPointType.DailyGift)
|
|
||||||
CheckRedPointStatus(RedPointType.WeekGiftPage)
|
|
||||||
CheckRedPointStatus(RedPointType.MonthGiftPage)
|
|
||||||
CheckRedPointStatus(RedPointType.GrowthPackage)
|
|
||||||
self.parent:RefreshData(nil,false,false)
|
|
||||||
end)
|
|
||||||
elseif self.data.DataType == DataType.Mix then--每日特惠
|
|
||||||
if self.data.data.linkAct then
|
if self.data.data.linkAct then
|
||||||
NetManager.GetActivityRewardRequest(self.data.data.missionId,self.data.data.activityId,function (drop)
|
NetManager.GetActivityRewardRequest(self.data.data.missionId,self.data.data.activityId,function (drop)
|
||||||
UIManager.OpenPanel(UIName.RewardItemPopup, drop, 1,function ()
|
UIManager.OpenPanel(UIName.RewardItemPopup, drop, 1,function ()
|
||||||
|
@ -380,7 +370,7 @@ function GiftPre:SetIcon()
|
||||||
if self.isCanBuy == 2 then
|
if self.isCanBuy == 2 then
|
||||||
self.icon.gameObject:SetActive(false)
|
self.icon.gameObject:SetActive(false)
|
||||||
self.price.text = Language[10514]
|
self.price.text = Language[10514]
|
||||||
if self.linkAct then
|
if self.data.data.linkAct then
|
||||||
self.price.text = Language[10101]
|
self.price.text = Language[10101]
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
|
|
|
@ -11,10 +11,12 @@ end
|
||||||
|
|
||||||
--添加事件监听(用于子类重写)
|
--添加事件监听(用于子类重写)
|
||||||
function RechargeViewNew:AddListener()
|
function RechargeViewNew:AddListener()
|
||||||
|
Game.GlobalEvent:AddEvent(GameEvent.MoneyPay.OnPayResultSuccess,self.SetGrowGift,self)
|
||||||
end
|
end
|
||||||
|
|
||||||
--移除事件监听(用于子类重写)
|
--移除事件监听(用于子类重写)
|
||||||
function RechargeViewNew:RemoveListener()
|
function RechargeViewNew:RemoveListener()
|
||||||
|
Game.GlobalEvent:RemoveEvent(GameEvent.MoneyPay.OnPayResultSuccess,self.SetGrowGift,self)
|
||||||
end
|
end
|
||||||
|
|
||||||
function RechargeViewNew:InitComponent()
|
function RechargeViewNew:InitComponent()
|
||||||
|
|
Loading…
Reference in New Issue