【商城界面】提交

dev_chengFeng
ZhangBiao 2021-12-16 10:46:11 +08:00
parent 0b190666d5
commit 2858f2e400
8 changed files with 143 additions and 22 deletions

View File

@ -5568,7 +5568,7 @@ MonoBehaviour:
m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
m_DisabledColor: {r: 1, g: 1, b: 1, a: 1}
m_ColorMultiplier: 1
m_FadeDuration: 0.1
m_SpriteState:
@ -23081,7 +23081,7 @@ MonoBehaviour:
m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608}
m_DisabledColor: {r: 1, g: 1, b: 1, a: 1}
m_ColorMultiplier: 1
m_FadeDuration: 0.1
m_SpriteState:

View File

@ -1422,7 +1422,7 @@ GoodsTypeDef = {
-- UpgradePackage=13,--升级限时礼包
QiJieMiBao=40,--天宫秘宝
RecruiteTreasure = 16,
MeiRiTeHui = 17,
}
--工坊功能类型
@ -2829,6 +2829,7 @@ CardPosImageName = {
Direct = 1,
Shop = 2,
Activity = 3,
Mix = 4,
}
-- 设置角色行走方向
-- WALK_DIR = {

View File

@ -70,7 +70,7 @@ function this.GetATaiChuMiJuanData(data)
local m_sprite
local tex2d = www.texture
if www.error or not www.texture then
Log("data.windowLink:"..str)
-- Log("data.windowLink:"..str)
LogError(string.format("data.windowLink:%s下载失败error:%s",data.windowLink,www.error))
m_sprite = Util.LoadSprite("taichuMiJuanDefaultBanner")
else
@ -636,7 +636,7 @@ function this.GetGiftDataByType(ShopData)
local shopData = {}
for i = 1,#ShopData do
if ShopData[i][1] == DataType.Direct and RECHARGEABLE then
local topspeedData = this.ResetShopData(OperatingManager.GetGiftGoodsInfoList(ShopData[i][2]), ShopData[i][3], ShopData[i][1])
local topspeedData = this.ResetShopData(OperatingManager.GetGiftGoodsInfoList(ShopData[i][2]), ShopData[i][3], ShopData[i][1],ShopData[i][4])
for i = 1, #topspeedData do
-- if lv >= topspeedData[i].data.shopItemData.LevelLinit[1] and lv <= topspeedData[i].data.shopItemData.LevelLinit[2] then
table.insert(shopData,topspeedData[i])
@ -656,7 +656,7 @@ function this.GetGiftDataByType(ShopData)
for j = 1 ,#GlobalActivity[id].CanBuyRechargeId do
table.insert(topspeedData,OperatingManager.GetGiftGoodsInfo(ShopData[i][2],GlobalActivity[id].CanBuyRechargeId[j]))
end
LogGreen("#topspeedData:"..#topspeedData)
-- LogGreen("#topspeedData:"..#topspeedData)
topspeedData = this.ResetShopData(topspeedData,ShopData[i][3],1)
for j = 1, #topspeedData do
-- if lv >= topspeedData[i].data.shopItemData.LevelLinit[1] and lv <= topspeedData[i].data.shopItemData.LevelLinit[2] then
@ -664,6 +664,14 @@ function this.GetGiftDataByType(ShopData)
-- 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
table.sort(shopData,function(a,b)
@ -683,17 +691,18 @@ function this.GetGiftDataByType(ShopData)
end
-- 商店数据重组
function this.ResetShopData(shopData, buyType, DataTypeIndex)
function this.ResetShopData(shopData, buyType, DataTypeIndex,actType)
local newData = {}
local boughtNum = 0
local limitNum = 0
-- LogPink("##shopData:"..tostring(#shopData).." buyType:"..tostring(buyType).." DataTypeIndex:"..tostring(DataTypeIndex).." actType:"..tostring(actType))
for i = 1, #shopData do
newData[#newData + 1] = this.CreatSingleData(shopData[i],DataTypeIndex,buyType)
newData[#newData + 1] = this.CreatSingleData(shopData[i],DataTypeIndex,buyType,actType)
end
return newData
end
function this.CreatSingleData(shopData,DataTypeIndex,buyType)
function this.CreatSingleData(shopData,DataTypeIndex,buyType,actType)
local _data = {}
local data = {}
local curSortId = 0--临时一个数值 只用做排序用
@ -717,7 +726,7 @@ function this.CreatSingleData(shopData,DataTypeIndex,buyType)
data.shopItemData = rechargeCommodityConfig[shopData.goodsId]
data.shows = data.shopItemData.RewardShow
data.tagName = GetLanguageStrById(data.shopItemData.Name)
data.boughtNum = OperatingManager.GetGoodsBuyTime(GoodsTypeDef.DirectPurchaseGift,shopData.goodsId)
data.boughtNum = OperatingManager.GetGoodsBuyTime(data.shopItemData.Type,shopData.goodsId)
data.limitNum = rechargeCommodityConfig[shopData.goodsId].Limit
if data.limitNum == -1 then
curSortId = 2
@ -738,12 +747,76 @@ function this.CreatSingleData(shopData,DataTypeIndex,buyType)
else
data.tipImageText = nil
end
data.price = string.format(MoneyUtil.GetMoneyUnitName(), data.finalNum)
-- LogGreen("actType:"..tostring(actType))
if actType then
local actData = ActivityGiftManager.GetActivityTypeInfo(actType)
-- LogGreen("actData:"..tostring(actData))
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
else
data.price = string.format(MoneyUtil.GetMoneyUnitName(), data.finalNum)
end
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
return nil
end
data.buyInfo = Language[10580]..data.limitNum - data.boughtNum..Language[10048]
_data.data = data
_data.DataType = DataTypeIndex
_data.sortId = curSortId

View File

@ -431,6 +431,7 @@ end
--请求奖励领取
function this.GetActivityRewardRequest(missionId, activityId, func)
Log("请求领奖activityId"..tostring(activityId).." missionId:"..tostring(missionId))
local data = PlayerInfoProto_pb.TakeActivityRewardRequest()
data.missionId = missionId
data.activityId = activityId

View File

@ -160,6 +160,7 @@ end
function this.GetGiftGoodsInfoList(type)
-- return giftGoodsInfoList[type] and giftGoodsInfoList[type] or {}
if not giftGoodsInfoList[type] then
LogError("没有这个类型的礼包:"..tostring(type))
return {}
end
local newGiftGoodsInfoList = {}

View File

@ -2,6 +2,8 @@ local EveryDayGiftNew = {}
local rechargeNum = 0
local growIndex = 0
local growData = {}
local rechargeCommodityConfig = ConfigManager.GetConfig(ConfigName.RechargeCommodityConfig)
local onKeyPackId = 1008
function EveryDayGiftNew:New(gameObject)
local b = {}
b.gameObject = gameObject
@ -67,11 +69,11 @@ end
function EveryDayGiftNew:BindEvent()
Util.AddOnceClick(self.btn2,function ()
PayManager.Pay(1004, function(id)
FirstRechargeManager.RefreshAccumRechargeValue(1004)
PayManager.Pay(onKeyPackId, function(id)
FirstRechargeManager.RefreshAccumRechargeValue(onKeyPackId)
PlayerPrefs.SetInt(PlayerManager.uid.."czlb", 0)
CheckRedPointStatus(RedPointType.GrowthPackage)
self:RefreshData(false,false)
self:RefreshData(nil,false,false)
end)
end)
end
@ -109,10 +111,10 @@ function EveryDayGiftNew:OnShow(_sortingOrder)
end
self.parent.tabbox.gameObject:SetActive(true)
self:RefreshData(true,true)
self:RefreshData(nil,true,true)
end
function EveryDayGiftNew:RefreshData(isTop,isAni)
function EveryDayGiftNew:RefreshData(none,isTop,isAni)
if self.actConfig.RpType > 0 then
CheckRedPointStatus(self.actConfig.RpType)
end
@ -135,6 +137,14 @@ function EveryDayGiftNew:RefreshData(isTop,isAni)
self:RefreshFreeData()
-- 刷新一键购买显示
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
@ -318,7 +328,7 @@ function EveryDayGiftNew:GetRemainTime()
self.localTimer = Timer.New(function ()
self.endTime.text = la..TimeToFelaxible(freshTime)
if freshTime <= 0 then
self:RefreshData(true,true)
self:RefreshData(nil,true,true)
end
freshTime = freshTime - 1
end, 1, -1, true)
@ -334,9 +344,18 @@ function EveryDayGiftNew:RefreshOneKeyShow()
if self.shopData[i].data.boughtNum > 0 then
Util.SetGray(self.btn2,true)
self.btn2:GetComponent("Button").interactable = false
break
return
end
end
local actData = ActivityGiftManager.GetActivityTypeInfo(89)
if actData then
Util.SetGray(self.btn2,true)
self.btn2:GetComponent("Button").interactable = false
else
Util.SetGray(self.btn2,false)
self.btn2:GetComponent("Button").interactable = true
end
end
--刷新每日免费礼包
@ -356,7 +375,7 @@ function EveryDayGiftNew:RefreshFreeData()
-- end
Util.SetGray(self.btn1,not isCanBuy)
CheckRedPointStatus(RedPointType.DailyGift)
LogGreen("isCanBuy:"..tostring(isCanBuy))
-- LogGreen("isCanBuy:"..tostring(isCanBuy))
Util.AddOnceClick(self.btn1,function()
if isCanBuy then
ShopManager.RequestBuyShopItem(SHOP_TYPE.FREE_GIFT, freeData[1].id, 1, function()

View File

@ -104,7 +104,7 @@ function GiftPre:BindEvent()
if self.data.DataType == DataType.Shop then
self:BuyAction(self.data.data.costId, self.data.data.finalNum, self.data.buyType, self.data.data.shopData.id)--特权商城
CheckRedPointStatus(RedPointType.GrowthPackage)
else
elseif self.data.DataType == DataType.Direct then
--直购商品
PayManager.Pay(self.data.data.shopData.goodsId, function(id)
FirstRechargeManager.RefreshAccumRechargeValue(self.data.data.shopData.goodsId)
@ -114,6 +114,24 @@ function GiftPre:BindEvent()
CheckRedPointStatus(RedPointType.GrowthPackage)
self.parent:RefreshData(nil,false,false)
end)
elseif self.data.DataType == DataType.Mix then--每日特惠
if self.data.data.linkAct then
NetManager.GetActivityRewardRequest(self.data.data.missionId,self.data.data.activityId,function (drop)
UIManager.OpenPanel(UIName.RewardItemPopup, drop, 1,function ()
self.parent:RefreshData(nil,false,false)
end)
end)
else
--直购商品
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)
end
end
end
end)
@ -351,7 +369,10 @@ function GiftPre:SetIsCanBuy()
end
if isCanBuy == 0 then
isCanBuy = (self.data.data.limitNum - self.data.data.boughtNum > 0) and 0 or 2
end
if self.data.data.linkAct then
isCanBuy = self.data.data.state == 0 and 0 or 2
end
end
return isCanBuy
end
@ -359,6 +380,9 @@ function GiftPre:SetIcon()
if self.isCanBuy == 2 then
self.icon.gameObject:SetActive(false)
self.price.text = Language[10514]
if self.linkAct then
self.price.text = Language[10101]
end
else
if self.data.DataType == DataType.Shop then
self.icon.gameObject:SetActive(true)

View File

@ -40,6 +40,8 @@ function RechargeViewNew:InitComponent()
self.cost = Util.GetGameObject(self.btnGet,"cost")
self.btnText = Util.GetGameObject(self.btnGet,"Text")
self.btnRed = Util.GetGameObject(self.btnGet,"red")
self.endTimeBg = Util.GetGameObject(self.gameObject,"growPack/Time")
self.endTimeBg.gameObject:SetActive(false)
self.ItemList = {}
end