Merge branch 'TCX_LongZhu' of http://192.168.1.21:3000/root/miduo_client into TCX_LongZhu

TCX_LongZhu
PC-202302260912\Administrator 2025-12-02 17:20:39 +08:00
commit 37e3145300
8 changed files with 290 additions and 261 deletions

View File

@ -1637,6 +1637,7 @@ GoodsTypeDef = {
chaozhifanli = 18, chaozhifanli = 18,
GMJustBuy = 20, GMJustBuy = 20,
HHBG = 22, --无限资源阁 HHBG = 22, --无限资源阁
DJQ = 63, --代金券
} }
--工坊功能类型 --工坊功能类型

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 1ab637d2001e2e94fad193ec6110b673 guid: a9c87918c42277845b947bf6d1a48823
folderAsset: yes folderAsset: yes
DefaultImporter: DefaultImporter:
externalObjects: {} externalObjects: {}

View File

@ -12,6 +12,7 @@ function PackageManager.Initialize()
if not this.ConfigName then if not this.ConfigName then
this.ConfigName = "LOCAL" this.ConfigName = "LOCAL"
end end
LogGreen("当前包名为:"..this.ConfigName)
local PackagerConfig = ConfigManager.GetConfig(ConfigName.PackageConfig) local PackagerConfig = ConfigManager.GetConfig(ConfigName.PackageConfig)
for _, config in ConfigPairs(PackagerConfig) do for _, config in ConfigPairs(PackagerConfig) do
if config.ConfigName == this.ConfigName then if config.ConfigName == this.ConfigName then

View File

@ -7,10 +7,10 @@
--]] --]]
require("Modules.Operating.MonthCardManager") require("Modules.Operating.MonthCardManager")
require("Modules.Operating.WeekCardManager") require("Modules.Operating.WeekCardManager")
local rechargeOrder=ConfigManager.GetConfig(ConfigName.RechargeCommodityorder) local rechargeOrder = ConfigManager.GetConfig(ConfigName.RechargeCommodityorder)
OperatingManager = {} OperatingManager = {}
local this = OperatingManager local this = OperatingManager
--后端数据 以RechargeCommodityConfig表Type为键 --后端数据 以RechargeCommodityConfig表Type为键
local giftGoodsInfoList = {} local giftGoodsInfoList = {}
--- 新的数据列表按照ID存取 --- 新的数据列表按照ID存取
local newGoodsList = {} local newGoodsList = {}
@ -18,10 +18,10 @@ local hadBuyGoodsList = {}
local rechargeConfig = ConfigManager.GetConfig(ConfigName.RechargeCommodityConfig) local rechargeConfig = ConfigManager.GetConfig(ConfigName.RechargeCommodityConfig)
local luxuryConfig = ConfigManager.GetConfig(ConfigName.LuxuryFundConfig) local luxuryConfig = ConfigManager.GetConfig(ConfigName.LuxuryFundConfig)
--后端数据 goodsId;//商品id buyTimes; //购买次数 startTime;//开始时间 endTime; //结束时间 dynamicBuyTimes; //可购买次数 --后端数据 goodsId;//商品id buyTimes; //购买次数 startTime;//开始时间 endTime; //结束时间 dynamicBuyTimes; //可购买次数
local giftGoodsInfo local giftGoodsInfo
this.upGradePackagePanelType = 0 this.upGradePackagePanelType = 1
this.upGradePackagePanelIndex = 0 this.upGradePackagePanelIndex = 1
this.IsShowFiveStarPatch = true this.IsShowFiveStarPatch = true
-- 月卡激活提示内容,也用来标记是否需要拍脸提示 -- 月卡激活提示内容,也用来标记是否需要拍脸提示
@ -34,52 +34,63 @@ function this.Initialize()
Game.GlobalEvent:AddEvent(GameEvent.PatFace.PatFaceHaveGrowGift, this.NewHeroGift) Game.GlobalEvent:AddEvent(GameEvent.PatFace.PatFaceHaveGrowGift, this.NewHeroGift)
this.showStr = "" this.showStr = ""
end end
---------------------------局限性---------------------------- ---------------------------局限性----------------------------
function this.SetBasicValues(giftGoodsList) function this.SetBasicValues(giftGoodsList)
giftGoodsInfo = giftGoodsList giftGoodsInfo = giftGoodsList
for _, v in pairs(GoodsTypeDef) do for _, v in pairs(GoodsTypeDef) do
giftGoodsInfoList[v] = {} giftGoodsInfoList[v] = {}
end end
for _, giftGoodsInfo in ipairs(giftGoodsList) do for _, giftGoodsInfo in ipairs(giftGoodsList) do
if giftGoodsInfo.goodsId and giftGoodsInfo.goodsId ~= 0 then if giftGoodsInfo.goodsId and giftGoodsInfo.goodsId ~= 0 then
local rechargeConfigLocal = ConfigManager.TryGetConfigData(ConfigName.RechargeCommodityConfig, giftGoodsInfo.goodsId) local rechargeConfigLocal = ConfigManager.TryGetConfigData(ConfigName.RechargeCommodityConfig,
giftGoodsInfo.goodsId)
if rechargeConfigLocal then if rechargeConfigLocal then
LogBlue("礼包类型:"..tostring(rechargeConfigLocal.Type).." 礼包ID"..tostring(giftGoodsInfo.goodsId).." 已购:"..tostring(giftGoodsInfo.buyTimes) LogBlue("礼包类型:" ..
.."次 开始时间:"..tostring(giftGoodsInfo.startTime).." 结束时间:"..tostring(giftGoodsInfo.endTime).. " 可购:" ..tostring(giftGoodsInfo.dynamicBuyTimes).." 是否已买:"..tostring(giftGoodsInfo.isBought)) tostring(rechargeConfigLocal.Type) ..
if giftGoodsInfo.endTime == 0 and giftGoodsInfo.startTime == 0 and (rechargeConfigLocal.ShowType == 25 or rechargeConfigLocal.ShowType == 26 or rechargeConfigLocal.ShowType == 8 ) then " 礼包ID" .. tostring(giftGoodsInfo.goodsId) .. " 已购:" .. tostring(giftGoodsInfo.buyTimes)
elseif rechargeConfigLocal.Package == 2 and AppConst.SdkChannel=="XQDC" then ..
-- elseif this.CheckGiftFrontIsOpen(giftGoodsInfo.goodsId)==false then "次 开始时间:" ..
-- LogError("前置条件不满足================") tostring(giftGoodsInfo.startTime) ..
" 结束时间:" ..
tostring(giftGoodsInfo.endTime) ..
" 可购:" .. tostring(giftGoodsInfo.dynamicBuyTimes) ..
" 是否已买:" .. tostring(giftGoodsInfo.isBought))
if giftGoodsInfo.endTime == 0 and giftGoodsInfo.startTime == 0 and (rechargeConfigLocal.ShowType == 25 or rechargeConfigLocal.ShowType == 26 or rechargeConfigLocal.ShowType == 8) then
--LogError("礼包时间不对ddddddddddddddddddddd" .. tostring(rechargeConfigLocal.Type))
elseif rechargeConfigLocal.Package == 2 and AppConst.SdkChannel == "XQDC" then
-- elseif this.CheckGiftFrontIsOpen(giftGoodsInfo.goodsId)==false then
-- LogError("前置条件不满足================")
--LogError("礼包时间不对ddddddddddddddddddddd" .. tostring(rechargeConfigLocal.Type))
else else
if giftGoodsInfoList[rechargeConfigLocal.Type] then if giftGoodsInfoList[rechargeConfigLocal.Type] then
table.insert(giftGoodsInfoList[rechargeConfigLocal.Type], giftGoodsInfo) table.insert(giftGoodsInfoList[rechargeConfigLocal.Type], giftGoodsInfo)
end end
end end
else else
LogError("服务器发过来一个前端表中不存在的礼包:"..tostring(giftGoodsInfo.goodsId)) LogError("服务器发过来一个前端表中不存在的礼包:" .. tostring(giftGoodsInfo.goodsId))
end end
end end
end end
--屏蔽前置礼包没有达成购买限制的 --屏蔽前置礼包没有达成购买限制的
local removeList={} local removeList = {}
for _, v in pairs(GoodsTypeDef) do for _, v in pairs(GoodsTypeDef) do
for key, value in pairs(giftGoodsInfoList[v]) do for key, value in pairs(giftGoodsInfoList[v]) do
if this.CheckGiftFrontIsOpen(value.goodsId)==false then if this.CheckGiftFrontIsOpen(value.goodsId) == false then
if removeList[v]==nil then if removeList[v] == nil then
removeList[v]={} removeList[v] = {}
end end
table.insert(removeList[v],value) table.insert(removeList[v], value)
end end
end end
end end
for k, v in pairs(removeList) do for k, v in pairs(removeList) do
for i=1,#v do for i = 1, #v do
table.removebyvalue(giftGoodsInfoList[k],v[i]) table.removebyvalue(giftGoodsInfoList[k], v[i])
end end
end end
@ -88,51 +99,51 @@ end
--检测礼包前置是否开启 --检测礼包前置是否开启
function this.CheckGiftFrontIsOpen(gift) function this.CheckGiftFrontIsOpen(gift)
local isOpen=true local isOpen = true
for k, v in ConfigPairs(rechargeOrder) do for k, v in ConfigPairs(rechargeOrder) do
if gift == v.BehindCommodity then if gift == v.BehindCommodity then
--LogError("v.id======================="..v.Id) --LogError("v.id======================="..v.Id)
if v.FrontCommodity>0 then if v.FrontCommodity > 0 then
local time=this.GetLeftBuyTime(rechargeConfig[v.FrontCommodity].Type, v.FrontCommodity) local time = this.GetLeftBuyTime(rechargeConfig[v.FrontCommodity].Type, v.FrontCommodity)
local buyTime= this.GetGoodsBuyTime(rechargeConfig[v.FrontCommodity].Type, v.FrontCommodity) local buyTime = this.GetGoodsBuyTime(rechargeConfig[v.FrontCommodity].Type, v.FrontCommodity)
--无限次 --无限次
if time==-1 then if time == -1 then
LogError("   "..gift) --LogError("   "..gift)
return true return true
end end
-- LogError("time================="..time.." v.FrontCommodityNumber==========="..v.FrontCommodityNumber.." buyTime=="..buyTime.."   "..gift) --LogError("time================="..time.." v.FrontCommodityNumber==========="..v.FrontCommodityNumber.." buyTime=="..buyTime.."   "..gift)
if time>v.FrontCommodityNumber then if time > v.FrontCommodityNumber then
return false return false
end end
end end
end end
end end
return isOpen return isOpen
end end
--判断商品是否可购买(成长礼) --判断商品是否可购买(成长礼)
function this.IsGrowthGiftGoodsAvailable(goodsType) function this.IsGrowthGiftGoodsAvailable(goodsType)
for _, v in ipairs(giftGoodsInfo)do for _, v in ipairs(giftGoodsInfo) do
if v and v.goodsId and v.goodsId ~= 0 then if v and v.goodsId and v.goodsId ~= 0 then
local rechargeConfig = ConfigManager.GetConfigData(ConfigName.RechargeCommodityConfig, v.goodsId) local rechargeConfig = ConfigManager.GetConfigData(ConfigName.RechargeCommodityConfig, v.goodsId)
if(rechargeConfig.Type == goodsType and v.dynamicBuyTimes == 1 and v.buyTimes ~= v.dynamicBuyTimes)then if (rechargeConfig.Type == goodsType and v.dynamicBuyTimes == 1 and v.buyTimes ~= v.dynamicBuyTimes) then
return v return v
end end
end end
end end
return nil return nil
end end
--判断商品是否购买过 --判断商品是否购买过
function this.IsBuyGift(goodsId) function this.IsBuyGift(goodsId)
if not goodsId then if not goodsId then
return false return false
end end
for _, v in ipairs(giftGoodsInfo)do for _, v in ipairs(giftGoodsInfo) do
if v.goodsId == goodsId and (v.buyTimes > 0 or v.isBought>0 )then if v.goodsId == goodsId and (v.buyTimes > 0 or v.isBought > 0) then
return true return true
end end
end end
@ -155,14 +166,14 @@ end
--- 删除某一类型的某一条商品数据 --- 删除某一类型的某一条商品数据
function this.RemoveItemInfoByType(type, goodsId) function this.RemoveItemInfoByType(type, goodsId)
if not giftGoodsInfoList[type] then if not giftGoodsInfoList[type] then
Log("此类商品不存在") Log("此类商品不存在")
return return
end end
for k,v in pairs(giftGoodsInfoList[type]) do for k, v in pairs(giftGoodsInfoList[type]) do
if v then if v then
if v.goodsId == goodsId then if v.goodsId == goodsId then
table.remove(giftGoodsInfoList[type], k) table.remove(giftGoodsInfoList[type], k)
end end
end end
@ -177,7 +188,7 @@ end
-- 判断相应显示类型的礼包是否存在用于判断是否开启了相应的充值活动 -- 判断相应显示类型的礼包是否存在用于判断是否开启了相应的充值活动
function this.HasGoodsByShowType(showType) function this.HasGoodsByShowType(showType)
local list = ConfigManager.GetAllConfigsDataByKey(ConfigName.RechargeCommodityConfig, "ShowType", showType) local list = ConfigManager.GetAllConfigsDataByKey(ConfigName.RechargeCommodityConfig, "ShowType", showType)
if not list then return false end if not list then return false end
for _, goods in ipairs(list) do for _, goods in ipairs(list) do
if this.GetGiftGoodsInfo(goods.Type, goods.Id) then if this.GetGiftGoodsInfo(goods.Type, goods.Id) then
return true return true
@ -199,7 +210,7 @@ function this.GetGiftGoodsInfo(goodsType, Id)
end end
else else
-- 判断是否可用 -- 判断是否可用
if _IsGiftGoodsAvailable(giftGoodsInfo) then if _IsGiftGoodsAvailable(giftGoodsInfo) then
return giftGoodsInfo return giftGoodsInfo
end end
end end
@ -210,14 +221,14 @@ end
function this.GetGiftGoodsInfoList(type) function this.GetGiftGoodsInfoList(type)
-- return giftGoodsInfoList[type] and giftGoodsInfoList[type] or {} -- return giftGoodsInfoList[type] and giftGoodsInfoList[type] or {}
if not giftGoodsInfoList[type] then if not giftGoodsInfoList[type] then
LogError("没有这个类型的礼包:"..tostring(type)) LogError("没有这个类型的礼包:" .. tostring(type))
return {} return {}
end end
local newGiftGoodsInfoList = {} local newGiftGoodsInfoList = {}
for k,v in pairs(giftGoodsInfoList[type]) do for k, v in pairs(giftGoodsInfoList[type]) do
--and PlayerManager.level >= rechargeConfig[v.goodsId].LevelLinit[1] and PlayerManager.level <= rechargeConfig[v.goodsId].LevelLinit[2] --and PlayerManager.level >= rechargeConfig[v.goodsId].LevelLinit[1] and PlayerManager.level <= rechargeConfig[v.goodsId].LevelLinit[2]
if rechargeConfig[v.goodsId] then if rechargeConfig[v.goodsId] and rechargeConfig[v.goodsId].ShowType ~= 0 then
table.insert(newGiftGoodsInfoList,v) table.insert(newGiftGoodsInfoList, v)
end end
end end
return newGiftGoodsInfoList return newGiftGoodsInfoList
@ -244,7 +255,7 @@ function this.GetLeftBuyTime(type, goodsId)
--- 此类商品的购买次数限制 --- 此类商品的购买次数限制
local limitTime = rechargeConfig[goodsId].Limit local limitTime = rechargeConfig[goodsId].Limit
if limitTime == 0 then --- 不限购 if limitTime == 0 then --- 不限购
return -1 return -1
else else
local boughtTime = this.GetGoodsBuyTime(type, goodsId) local boughtTime = this.GetGoodsBuyTime(type, goodsId)
@ -252,25 +263,24 @@ function this.GetLeftBuyTime(type, goodsId)
end end
end end
--- 获取商品已经购买次数 --- 获取商品已经购买次数
function this.GetGoodsBuyTime(type, goodsId) function this.GetGoodsBuyTime(type, goodsId)
if not giftGoodsInfoList[type] then if not giftGoodsInfoList[type] then
--王振兴添加 防止没有查询到数据报错 --王振兴添加 防止没有查询到数据报错
return 0 return 0
end end
for k,v in pairs(giftGoodsInfoList[type]) do for k, v in pairs(giftGoodsInfoList[type]) do
if not goodsId then if not goodsId then
--LogError("goodid====="..goodsId) --LogError("goodid====="..goodsId)
return v.buyTimes return v.buyTimes
end end
if v.goodsId == goodsId then if v.goodsId == goodsId then
if rechargeConfig[goodsId] then if rechargeConfig[goodsId] then
if rechargeConfig[goodsId].Otype==3 then if rechargeConfig[goodsId].Otype == 3 then
return v.isBought return v.isBought
else else
return v.buyTimes return v.buyTimes
end end
end end
return v.buyTimes return v.buyTimes
end end
@ -279,7 +289,6 @@ function this.GetGoodsBuyTime(type, goodsId)
return 0 return 0
end end
-------------------------------------------------------------- --------------------------------------------------------------
function this.SetHadBuyGoodsId(BuyGoodsList) function this.SetHadBuyGoodsId(BuyGoodsList)
for i = 1, #BuyGoodsList do for i = 1, #BuyGoodsList do
@ -302,15 +311,15 @@ function this.GetGrowthRedPointState()
local openId = ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.GrowthReward) local openId = ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.GrowthReward)
local hasGift = OperatingManager.HasGoodsByShowType(4) local hasGift = OperatingManager.HasGoodsByShowType(4)
if openId then if openId then
local isGet=RecruitTreasureManager.GetQuanMinRed(openId) local isGet = RecruitTreasureManager.GetQuanMinRed(openId)
if isGet then if isGet then
return true return true
end end
end end
if not hasGift then return false end if not hasGift then return false end
local giftGoodsInfo = OperatingManager.IsGrowthGiftGoodsAvailable(GoodsTypeDef.GrowthReward) local giftGoodsInfo = OperatingManager.IsGrowthGiftGoodsAvailable(GoodsTypeDef.GrowthReward)
if not giftGoodsInfo then return false end if not giftGoodsInfo then return false end
if openId then if openId then
-- 判断对应礼包是否购买 -- 判断对应礼包是否购买
local globalActConfigs = ConfigManager.TryGetConfigData(ConfigName.GlobalActivity, openId) local globalActConfigs = ConfigManager.TryGetConfigData(ConfigName.GlobalActivity, openId)
@ -329,11 +338,10 @@ function this.GetGrowthRedPointState()
end end
end end
end end
end end
return redPoint return redPoint
end end
-- 商品时间数据 -- 商品时间数据
local _GoodsDurationData = {} local _GoodsDurationData = {}
function this.SetGoodsDurationData(dataList) function this.SetGoodsDurationData(dataList)
@ -346,24 +354,25 @@ function this.SetGoodsDurationData(dataList)
--Log("商品类型 = "..data.goodsType..", 剩余时间 = "..data.endTime) --Log("商品类型 = "..data.goodsType..", 剩余时间 = "..data.endTime)
end end
end end
-- 根据类型判断相应的物品是否开启并返回相应的ID -- 根据类型判断相应的物品是否开启并返回相应的ID
function this.GetActiveGoodsIDByType(goodsType) function this.GetActiveGoodsIDByType(goodsType)
for goodsId, endTime in pairs(_GoodsDurationData) do for goodsId, endTime in pairs(_GoodsDurationData) do
if rechargeConfig[goodsId] and rechargeConfig[goodsId].Type == goodsType and endTime > GetTimeStamp() then if rechargeConfig[goodsId] and rechargeConfig[goodsId].Type == goodsType and endTime > GetTimeStamp() then
return goodsId, endTime return goodsId, endTime
end end
end end
end end
function this.GetGoodsEndTime(goodsType) function this.GetGoodsEndTime(goodsType)
local goodsId, endTime = this.GetActiveGoodsIDByType(goodsType) local goodsId, endTime = this.GetActiveGoodsIDByType(goodsType)
return endTime return endTime
end end
function this.RemoveEndTime(goodsId) function this.RemoveEndTime(goodsId)
_GoodsDurationData[goodsId] = nil _GoodsDurationData[goodsId] = nil
end end
function this.SetGoodsEndTime(goodsId, endTime) function this.SetGoodsEndTime(goodsId, endTime)
_GoodsDurationData[goodsId] = endTime _GoodsDurationData[goodsId] = endTime
end end
@ -383,7 +392,6 @@ function this.IsGoodsExit(type, id)
return isOpen return isOpen
end end
-- 五星成长礼红点 -- 五星成长礼红点
function this.GetRedState() function this.GetRedState()
local isRed = false local isRed = false
@ -398,7 +406,6 @@ function this.GetRedState()
return isRed return isRed
end end
---------------------------------------累计签到-------------------------------- ---------------------------------------累计签到--------------------------------
local _SignInData local _SignInData
function this.SetSignInData(signIn) function this.SetSignInData(signIn)
@ -412,9 +419,10 @@ end
--红点检测方法 --红点检测方法
function this.GetSignInRedPointStatus() function this.GetSignInRedPointStatus()
local receiveNum=PrivilegeManager.GetPrivilegeRemainValue(PRIVILEGE_TYPE.DAY_SIGN_IN)--本地标记可领取次数 local receiveNum = PrivilegeManager.GetPrivilegeRemainValue(PRIVILEGE_TYPE.DAY_SIGN_IN) --本地标记可领取次数
local rechargeNum=PrivilegeManager.GetPrivilegeNumber(PRIVILEGE_TYPE.DAY_SIGN_IN)--充值标记 1未充值 2已充值 local rechargeNum = PrivilegeManager.GetPrivilegeNumber(PRIVILEGE_TYPE.DAY_SIGN_IN) --充值标记 1未充值 2已充值
return _SignInData.state == 0 --or receiveNum>0--(_SignInData.state==1 and ((receiveNum==0 and rechargeNum==1) or (receiveNum==1 and rechargeNum==2))) return _SignInData.state ==
0 --or receiveNum>0--(_SignInData.state==1 and ((receiveNum==0 and rechargeNum==1) or (receiveNum==1 and rechargeNum==2)))
end end
---------------------------------- 什么什么什么新鸡成长礼包 ------------------------------------------ ---------------------------------- 什么什么什么新鸡成长礼包 ------------------------------------------
@ -424,21 +432,19 @@ function this.NewHeroGift()
CheckRedPointStatus(RedPointType.HERO_STAR_GIFT) CheckRedPointStatus(RedPointType.HERO_STAR_GIFT)
end end
--- 获取那个的显示数据 --- 获取那个的显示数据
function this.GetStarGiftData() function this.GetStarGiftData()
local data = {} local data = {}
for k, v in ConfigPairs(rechargeConfig) do for k, v in ConfigPairs(rechargeConfig) do
if v.ShowType == 8 then if v.ShowType == 8 then
local t = {} local t = {}
t.data = v -- 数据结构 t.data = v -- 数据结构
t.Id = v.Id -- 商品ID t.Id = v.Id -- 商品ID
data[#data + 1] = t data[#data + 1] = t
end end
end end
return data return data
end end
@ -446,19 +452,19 @@ function this.IsHeroGiftActive()
-- 关闭星级成长礼显示 -- 关闭星级成长礼显示
local activeNum = 0 local activeNum = 0
if not giftGoodsInfoList[GoodsTypeDef.DirectPurchaseGift] then if not giftGoodsInfoList[GoodsTypeDef.DirectPurchaseGift] then
return false return false
else else
for i = 1, #giftGoodsInfoList[GoodsTypeDef.DirectPurchaseGift] do for i = 1, #giftGoodsInfoList[GoodsTypeDef.DirectPurchaseGift] do
local data =giftGoodsInfoList[GoodsTypeDef.DirectPurchaseGift][i] local data = giftGoodsInfoList[GoodsTypeDef.DirectPurchaseGift][i]
if data then if data then
local id = data.goodsId local id = data.goodsId
if rechargeConfig[id].ShowType == 8 then --- 只有前端显示的商品类型 if rechargeConfig[id].ShowType == 8 then --- 只有前端显示的商品类型
activeNum = activeNum + 1 activeNum = activeNum + 1
end end
end end
end end
end end
return activeNum > 0 return activeNum > 0
end end
@ -474,12 +480,12 @@ function this.GetGiftShowData()
data.id = goodsId data.id = goodsId
data.name = GetLanguageStrById(staticData[i].data.Name) data.name = GetLanguageStrById(staticData[i].data.Name)
local serData = this.GetGiftGoodsInfo(GoodsTypeDef.DirectPurchaseGift, goodsId) local serData = this.GetGiftGoodsInfo(GoodsTypeDef.DirectPurchaseGift, goodsId)
if serData and serData.endTime > 0 then --- 商品激活可购买 if serData and serData.endTime > 0 then --- 商品激活可购买
data.endTime = serData.endTime data.endTime = serData.endTime
data.startTime = serData.startTime data.startTime = serData.startTime
data.leftBuyTime = serData.dynamicBuyTimes data.leftBuyTime = serData.dynamicBuyTimes
data.isActive = 1 data.isActive = 1
else --- 未激活只是显示而已 else --- 未激活只是显示而已
data.endTime = 0 data.endTime = 0
data.startTime = 0 data.startTime = 0
data.leftBuyTime = 0 data.leftBuyTime = 0
@ -487,25 +493,22 @@ function this.GetGiftShowData()
end end
newData[#newData + 1] = data newData[#newData + 1] = data
end end
---排序 ---排序
if #newData > 1 then if #newData > 1 then
table.sort(newData, function(a, b) table.sort(newData, function(a, b)
if a.isActive == b.isActive then if a.isActive == b.isActive then
return a.id > b.id return a.id > b.id
else else
return a.isActive > b.isActive return a.isActive > b.isActive
end end
end) end)
end end
return newData return newData
end end
--- 礼包红点 --- 礼包红点
@ -514,7 +517,7 @@ function this.IsHeroStarGiftActive()
local isActive = this.IsHeroGiftActive() local isActive = this.IsHeroGiftActive()
local hasRed = clickedState == 1 and isActive local hasRed = clickedState == 1 and isActive
return hasRed return hasRed
end end
function this.SetHeroRedState(value) function this.SetHeroRedState(value)
PlayerPrefs.SetInt(PlayerManager.uid .. "hero_star_gift", value) PlayerPrefs.SetInt(PlayerManager.uid .. "hero_star_gift", value)
@ -523,19 +526,20 @@ end
function this.GetHeroRedState() function this.GetHeroRedState()
return PlayerPrefs.GetInt(PlayerManager.uid .. "hero_star_gift") return PlayerPrefs.GetInt(PlayerManager.uid .. "hero_star_gift")
end end
---------------------------------------------------------------------------------------------- ----------------------------------------------------------------------------------------------
--- 获取鸡精面版的显示信息 --- 获取鸡精面版的显示信息
--- 传进来的参数值是 33或者是34基金类型 --- 传进来的参数值是 33或者是34基金类型
function this.GetPanelShowReward(type, isAll,isOverlay) function this.GetPanelShowReward(type, isAll, isOverlay)
local data = {} local data = {}
for k, v in ConfigPairs(luxuryConfig) do for k, v in ConfigPairs(luxuryConfig) do
if not isAll then if not isAll then
if v.Type == type and v.ShowReward == 1 then if v.Type == type and v.ShowReward == 1 then
data[#data + 1] = v data[#data + 1] = v
end end
else else
if v.Type == type then if v.Type == type then
data[#data + 1] = v data[#data + 1] = v
end end
end end
@ -551,7 +555,7 @@ function this.GetPanelShowReward(type, isAll,isOverlay)
end end
local endData2 = {} local endData2 = {}
for i, v in pairs(endData) do for i, v in pairs(endData) do
table.insert(endData2,{i,v}) table.insert(endData2, { i, v })
end end
return endData2 return endData2
else else
@ -563,41 +567,41 @@ end
function this.IsBaseOpen(type, id) function this.IsBaseOpen(type, id)
local isOpen = false local isOpen = false
local data = this.GetGiftGoodsInfo(type, id) local data = this.GetGiftGoodsInfo(type, id)
if data then if data then
--- 常驻 --- 常驻
if tonumber(data.endTime) == 0 then if tonumber(data.endTime) == 0 then
isOpen = true isOpen = true
else else
local time = data.endTime - PlayerManager.serverTime local time = data.endTime - PlayerManager.serverTime
local isBuy = this.IsBaseBuy(type) local isBuy = this.IsBaseBuy(type)
isOpen = time > 0 isOpen = time > 0
-- 如果购买了结束也没有用 -- 如果购买了结束也没有用
if isBuy then if isBuy then
isOpen = true isOpen = true
end end
end end
else else
isOpen = false isOpen = false
-- 如果购买了结束也没有用 -- 如果购买了结束也没有用
if this.IsBaseBuy(type) then if this.IsBaseBuy(type) then
isOpen = true isOpen = true
end end
end end
return isOpen return isOpen
end end
--- 判断某一个鸡精是否购买 --- 判断某一个鸡精是否购买
function this.IsBaseBuy(type) function this.IsBaseBuy(type)
local leftTime = this.GetGoodsEndTime(type) local leftTime = this.GetGoodsEndTime(type)
local isBuy = false local isBuy = false
if not leftTime then if not leftTime then
isBuy = false isBuy = false
else else
if leftTime <= 0 then if leftTime <= 0 then
isBuy = false isBuy = false
else else
isBuy = true isBuy = true
@ -609,7 +613,7 @@ end
---- 界面打开时设置一下服务器数据 ---- 界面打开时设置一下服务器数据
function this.SetSerData(goodsType) function this.SetSerData(goodsType)
local endTime = this.GetGoodsEndTime(goodsType) local endTime = this.GetGoodsEndTime(goodsType)
if not endTime then return end if not endTime then return end
local startTime = endTime - 24 * 30 * 60 * 60 local startTime = endTime - 24 * 30 * 60 * 60
local passSecond = GetTimeStamp() - startTime local passSecond = GetTimeStamp() - startTime
@ -630,43 +634,42 @@ local oneDaySeconds = 24 * 60 * 60
function this.GetRewardDay(goodType) function this.GetRewardDay(goodType)
-- Log("天数 " .. getDay[goodType]) -- Log("天数 " .. getDay[goodType])
-- 未激活时没有天数 -- 未激活时没有天数
if not this.IsBaseBuy(goodType) then return 0 end if not this.IsBaseBuy(goodType) then return 0 end
return getDay[goodType] return getDay[goodType]
end end
--- 设置累计天数 --- 设置累计天数
function this.SetSignRewarDay(goodType, second) function this.SetSignRewarDay(goodType, second)
if not getDay[goodType] then getDay[goodType] = {} end if not getDay[goodType] then getDay[goodType] = {} end
-- 小于24小时按一天 -- 小于24小时按一天
if second <= oneDaySeconds * 1 then if second <= oneDaySeconds * 1 then
getDay[goodType] = 1 getDay[goodType] = 1
elseif second >= oneDaySeconds * 30 then elseif second >= oneDaySeconds * 30 then
getDay[goodType] = 30 getDay[goodType] = 30
else else
local hour = math.ceil(math.ceil(second / 60) / 60) local hour = math.ceil(math.ceil(second / 60) / 60)
getDay[goodType] = math.ceil(hour / 24) getDay[goodType] = math.ceil(hour / 24)
-- Log("累计" .. hour .. "小时") -- Log("累计" .. hour .. "小时")
getDay[goodType] = getDay[goodType] >= 30 and 30 or getDay[goodType] getDay[goodType] = getDay[goodType] >= 30 and 30 or getDay[goodType]
end end
end end
-- 显示数据 -- 显示数据
function this.GetShowTime(endTime) function this.GetShowTime(endTime)
local duration = 30 * 24 * 60 * 60 local duration = 30 * 24 * 60 * 60
local endStr = os.date(Language[11383], endTime) local endStr = os.date(Language[12016], endTime)
local startStr = os.date(Language[11383], endTime - duration + 1) local startStr = os.date(Language[12016], endTime - duration + 1)
return startStr, endStr return startStr, endStr
end end
--礼包抢购是否开启 --礼包抢购是否开启
function this.IsGiftBuyActive() function this.IsGiftBuyActive()
local activeNum = 0 local activeNum = 0
local GiftBuyData = ConfigManager.GetAllConfigsDataByDoubleKey(ConfigName.RechargeCommodityConfig, "ShowType", 20, "Type", GoodsTypeDef.DirectPurchaseGift) local GiftBuyData = ConfigManager.GetAllConfigsDataByDoubleKey(ConfigName.RechargeCommodityConfig, "ShowType", 20,
"Type", GoodsTypeDef.DirectPurchaseGift)
if GiftBuyData then if GiftBuyData then
for i = 1, #GiftBuyData do for i = 1, #GiftBuyData do
local curgoodData = OperatingManager.GetGiftGoodsInfo(GoodsTypeDef.DirectPurchaseGift, GiftBuyData[i].Id) local curgoodData = OperatingManager.GetGiftGoodsInfo(GoodsTypeDef.DirectPurchaseGift, GiftBuyData[i].Id)
if curgoodData then if curgoodData then
if curgoodData.endTime - GetTimeStamp() > 0 then if curgoodData.endTime - GetTimeStamp() > 0 then
activeNum = activeNum + 1 activeNum = activeNum + 1
@ -677,7 +680,6 @@ function this.IsGiftBuyActive()
return activeNum > 0 return activeNum > 0
end end
-- function this.GetTimeLimitRedPointStatus() -- function this.GetTimeLimitRedPointStatus()
-- local lotterySetting=ConfigManager.GetConfig(ConfigName.LotterySetting) -- local lotterySetting=ConfigManager.GetConfig(ConfigName.LotterySetting)
-- local activityId = ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.FindFairy) -- local activityId = ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.FindFairy)
@ -692,64 +694,64 @@ end
-- RecruitManager.freeUseTimeList[freeTimesId]=freeTime -- RecruitManager.freeUseTimeList[freeTimesId]=freeTime
-- return freeTime and freeTime >= 1 -- return freeTime and freeTime >= 1
-- end -- end
-- end -- end
--检测心愿抽卡活动红点 --检测心愿抽卡活动红点
function this.GetWishDrawRedPointStatus() function this.GetWishDrawRedPointStatus()
local isOpen =CheckFunctionOpenClient(FUNCTION_OPEN_TYPE.ChouJiangRukou) local isOpen = CheckFunctionOpenClient(FUNCTION_OPEN_TYPE.ChouJiangRukou)
if isOpen==false then if isOpen == false then
return false return false
end end
local activityId = ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.LimitUpHero) local activityId = ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.LimitUpHero)
if not activityId then if not activityId then
return false return false
end end
local wish=ConfigManager.TryGetConfigData(ConfigName.WishActivitySetting,1) local wish = ConfigManager.TryGetConfigData(ConfigName.WishActivitySetting, 1)
if not wish then if not wish then
return false return false
end end
local freeTimesId=wish.FreeTimes local freeTimesId = wish.FreeTimes
local freeTime= 0 local freeTime = 0
if freeTimesId>0 then if freeTimesId > 0 then
freeTime= PrivilegeManager.GetPrivilegeRemainValue(freeTimesId) freeTime = PrivilegeManager.GetPrivilegeRemainValue(freeTimesId)
RecruitManager.freeUseTimeList[freeTimesId]=freeTime RecruitManager.freeUseTimeList[freeTimesId] = freeTime
return freeTime and freeTime >= 1 return freeTime and freeTime >= 1
end end
end
end
function this.GetTianDiHongLuRedPointStatus() function this.GetTianDiHongLuRedPointStatus()
local lotterySetting=ConfigManager.GetConfig(ConfigName.LotterySetting) local lotterySetting = ConfigManager.GetConfig(ConfigName.LotterySetting)
local activityId = ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.tiandihonglu) local activityId = ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.tiandihonglu)
if not activityId then if not activityId then
return false return false
end end
local array = ConfigManager.GetConfigDataByDoubleKey(ConfigName.LotterySetting,"ActivityId",activityId,"PerCount",1) local array = ConfigManager.GetConfigDataByDoubleKey(ConfigName.LotterySetting, "ActivityId", activityId, "PerCount",
local freeTimesId=lotterySetting[array.Id].FreeTimes 1)
local freeTime= 0 local freeTimesId = lotterySetting[array.Id].FreeTimes
if freeTimesId>0 then local freeTime = 0
freeTime= PrivilegeManager.GetPrivilegeRemainValue(freeTimesId) if freeTimesId > 0 then
RecruitManager.freeUseTimeList[freeTimesId]=freeTime freeTime = PrivilegeManager.GetPrivilegeRemainValue(freeTimesId)
RecruitManager.freeUseTimeList[freeTimesId] = freeTime
return freeTime and freeTime >= 1 return freeTime and freeTime >= 1
end end
end end
function this.GetQiankunBoxRedPointStatus() function this.GetQiankunBoxRedPointStatus()
local lotterySetting=ConfigManager.GetConfig(ConfigName.LotterySetting) local lotterySetting = ConfigManager.GetConfig(ConfigName.LotterySetting)
local activityId = ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.QianKunBox) local activityId = ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.QianKunBox)
if not activityId then if not activityId then
return false return false
end end
local array = ConfigManager.GetConfigDataByDoubleKey(ConfigName.LotterySetting,"ActivityId",activityId,"PerCount",1) local array = ConfigManager.GetConfigDataByDoubleKey(ConfigName.LotterySetting, "ActivityId", activityId, "PerCount",
local freeTimesId=lotterySetting[array.Id].FreeTimes 1)
local freeTime= 0 local freeTimesId = lotterySetting[array.Id].FreeTimes
if freeTimesId>0 then local freeTime = 0
freeTime= PrivilegeManager.GetPrivilegeRemainValue(freeTimesId) if freeTimesId > 0 then
RecruitManager.freeUseTimeList[freeTimesId]=freeTime freeTime = PrivilegeManager.GetPrivilegeRemainValue(freeTimesId)
RecruitManager.freeUseTimeList[freeTimesId] = freeTime
return freeTime and freeTime >= 1 return freeTime and freeTime >= 1
end end
end end
this.TimeLimitedTimes = 0 this.TimeLimitedTimes = 0
this.allData = {} this.allData = {}
@ -757,18 +759,18 @@ function this.InitDynamicActData()
local id = ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.DynamicAct) local id = ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.DynamicAct)
if (not id) or id < 1 then if (not id) or id < 1 then
return nil return nil
end end
this.allData = {} this.allData = {}
local allListData = ConfigManager.GetAllConfigsDataByKey(ConfigName.ThemeActivityTaskConfig, "ActivityId", id) local allListData = ConfigManager.GetAllConfigsDataByKey(ConfigName.ThemeActivityTaskConfig, "ActivityId", id)
local allMissionData = TaskManager.GetTypeTaskList(TaskTypeDef.DynamicActTask) local allMissionData = TaskManager.GetTypeTaskList(TaskTypeDef.DynamicActTask)
-- --LogGreen("allMissionData:"..#allMissionData) -- --LogGreen("allMissionData:"..#allMissionData)
for i=1,#allListData do for i = 1, #allListData do
for j=1,#allMissionData do for j = 1, #allMissionData do
if allListData[i].Id == allMissionData[j].missionId then if allListData[i].Id == allMissionData[j].missionId then
local data = {} local data = {}
data.id = allMissionData[j].missionId data.id = allMissionData[j].missionId
data.progress = allMissionData[j].progress data.progress = allMissionData[j].progress
local strs = string.split(GetLanguageStrById(allListData[i].Show),"#") local strs = string.split(GetLanguageStrById(allListData[i].Show), "#")
data.title = strs[1] data.title = strs[1]
data.content = strs[2] data.content = strs[2]
data.value = allListData[i].TaskValue[2][1] data.value = allListData[i].TaskValue[2][1]
@ -782,21 +784,22 @@ function this.InitDynamicActData()
-- data.state = 0 -- data.state = 0
-- end -- end
-- end -- end
data.type = allListData[i].Type data.type = allListData[i].Type
data.reward = {allListData[i].Integral[1][1],allListData[i].Integral[1][2]} data.reward = { allListData[i].Integral[1][1], allListData[i].Integral[1][2] }
data.jump = allListData[i].Jump[1] data.jump = allListData[i].Jump[1]
table.insert(this.allData,data) table.insert(this.allData, data)
end end
end end
end end
return this.allData return this.allData
end end
function this.CheckDynamicActTaskRed(red) function this.CheckDynamicActTaskRed(red)
this.InitDynamicActData() this.InitDynamicActData()
if not this.allData then if not this.allData then
return false return false
end end
local type local type
if red == RedPointType.DynamicActTask_MeiRi then if red == RedPointType.DynamicActTask_MeiRi then
type = 1 type = 1
elseif red == RedPointType.DynamicActTask_MeiZhou then elseif red == RedPointType.DynamicActTask_MeiZhou then
@ -804,13 +807,14 @@ function this.CheckDynamicActTaskRed(red)
else else
type = 0 type = 0
end end
for i=1,#this.allData do for i = 1, #this.allData do
if this.allData[i].state == 1 and (type == 0 or (this.allData[i].type == type)) then if this.allData[i].state == 1 and (type == 0 or (this.allData[i].type == type)) then
return true return true
end end
end end
return false return false
end end
function this.InitLeiJiChongZhiData(_type) function this.InitLeiJiChongZhiData(_type)
local id = 0 local id = 0
local type = _type local type = _type
@ -830,45 +834,48 @@ function this.InitLeiJiChongZhiData(_type)
end end
else else
type = ActivityTypeDef.AccumulativeRechargeExper type = ActivityTypeDef.AccumulativeRechargeExper
local tempConfig = ConfigManager.GetConfigData(ConfigName.GlobalActivity,id) local tempConfig = ConfigManager.GetConfigData(ConfigName.GlobalActivity, id)
if tempConfig and tempConfig.ShowArt == 1 then if tempConfig and tempConfig.ShowArt == 1 then
return nil return nil
end end
end end
end end
this.LeiJiChongZhiData = {} this.LeiJiChongZhiData = {}
local allListData = ConfigManager.GetAllConfigsDataByKey(ConfigName.ActivityRewardConfig, "ActivityId", id) local allListData = ConfigManager.GetAllConfigsDataByKey(ConfigName.ActivityRewardConfig, "ActivityId", id)
local allMissionData = ActivityGiftManager.GetActivityTypeInfo(type) local allMissionData = ActivityGiftManager.GetActivityTypeInfo(type)
for i=1,#allListData do for i = 1, #allListData do
for j=1,#allMissionData.mission do for j = 1, #allMissionData.mission do
if allListData[i].Id == allMissionData.mission[j].missionId then if allListData[i].Id == allMissionData.mission[j].missionId then
local data = {} local data = {}
data.id = allMissionData.mission[j].missionId data.id = allMissionData.mission[j].missionId
data.progress = allMissionData.value data.progress = allMissionData.value
data.value = allListData[i].Values[1][1] data.value = allListData[i].Values[1][1]
data.state = allMissionData.mission[j].state == 1 and allMissionData.mission[j].state or (data.progress>= data.value and 2 or 0) -- 0 前往 1已领奖 2领奖 data.state = allMissionData.mission[j].state == 1 and allMissionData.mission[j].state or
(data.progress >= data.value and 2 or 0) -- 0 前往 1已领奖 2领奖
data.reward = allListData[i].Reward data.reward = allListData[i].Reward
data.jump = allListData[i].Jump[1] data.jump = allListData[i].Jump[1]
table.insert(this.LeiJiChongZhiData,data) table.insert(this.LeiJiChongZhiData, data)
end end
end end
end end
return this.LeiJiChongZhiData return this.LeiJiChongZhiData
end end
function this.CheckLeiJiChongZhiRedData() function this.CheckLeiJiChongZhiRedData()
local mission = this.InitLeiJiChongZhiData() local mission = this.InitLeiJiChongZhiData()
if not mission or #mission < 1 then if not mission or #mission < 1 then
return false return false
end end
for j = 1,#mission do for j = 1, #mission do
-- --LogGreen(mission[j].id..":"..mission[j].state) -- --LogGreen(mission[j].id..":"..mission[j].state)
if mission[j].state == 2 then if mission[j].state == 2 then
return true return true
end end
end end
return false return false
end end
function this.CheckWeekGiftPageRedPoint() function this.CheckWeekGiftPageRedPoint()
local boughtNum = 0 local boughtNum = 0
local limitNum = 0 local limitNum = 0
@ -877,14 +884,15 @@ function this.CheckWeekGiftPageRedPoint()
if rechargeConfig[shopData[i].goodsId].ShowType == DirectBuyType.WEEK_GIFT then if rechargeConfig[shopData[i].goodsId].ShowType == DirectBuyType.WEEK_GIFT then
boughtNum = OperatingManager.GetGoodsBuyTime(GoodsTypeDef.DirectPurchaseGift, shopData[i].goodsId) boughtNum = OperatingManager.GetGoodsBuyTime(GoodsTypeDef.DirectPurchaseGift, shopData[i].goodsId)
limitNum = rechargeConfig[shopData[i].goodsId].Limit limitNum = rechargeConfig[shopData[i].goodsId].Limit
local isCanBuy = limitNum - boughtNum >0 local isCanBuy = limitNum - boughtNum > 0
if isCanBuy and rechargeConfig[shopData[i].goodsId].Price <= 0 then if isCanBuy and rechargeConfig[shopData[i].goodsId].Price <= 0 then
return true return true
end end
end end
end end
return false return false
end end
function this.CheckMonthGiftPageRedPoint() function this.CheckMonthGiftPageRedPoint()
local boughtNum = 0 local boughtNum = 0
local limitNum = 0 local limitNum = 0
@ -893,7 +901,7 @@ function this.CheckMonthGiftPageRedPoint()
if rechargeConfig[shopData[i].goodsId].ShowType == DirectBuyType.MONTH_GIFT then if rechargeConfig[shopData[i].goodsId].ShowType == DirectBuyType.MONTH_GIFT then
boughtNum = OperatingManager.GetGoodsBuyTime(GoodsTypeDef.DirectPurchaseGift, shopData[i].goodsId) boughtNum = OperatingManager.GetGoodsBuyTime(GoodsTypeDef.DirectPurchaseGift, shopData[i].goodsId)
limitNum = rechargeConfig[shopData[i].goodsId].Limit limitNum = rechargeConfig[shopData[i].goodsId].Limit
local isCanBuy = limitNum - boughtNum >0 local isCanBuy = limitNum - boughtNum > 0
if isCanBuy and rechargeConfig[shopData[i].goodsId].Price <= 0 then if isCanBuy and rechargeConfig[shopData[i].goodsId].Price <= 0 then
return true return true
end end
@ -911,32 +919,29 @@ function this.CheckTimeLimitHeroStoreRedPoint()
end end
local shopData = OperatingManager.GetGiftGoodsInfoList(GoodsTypeDef.DirectPurchaseGift) local shopData = OperatingManager.GetGiftGoodsInfoList(GoodsTypeDef.DirectPurchaseGift)
for i = 1, #shopData do for i = 1, #shopData do
if rechargeConfig[shopData[i].goodsId].ShowType == DirectBuyType.XIANSHIMIBAO then if rechargeConfig[shopData[i].goodsId].ShowType == DirectBuyType.XIANSHIMIBAO and rechargeConfig[shopData[i].goodsId].ShowType == 51 then
boughtNum = OperatingManager.GetGoodsBuyTime(GoodsTypeDef.DirectPurchaseGift, shopData[i].goodsId) boughtNum = OperatingManager.GetGoodsBuyTime(GoodsTypeDef.DirectPurchaseGift, shopData[i].goodsId)
limitNum = rechargeConfig[shopData[i].goodsId].Limit limitNum = rechargeConfig[shopData[i].goodsId].Limit
local isCanBuy = limitNum - boughtNum >0 local isCanBuy = limitNum - boughtNum > 0
if isCanBuy and rechargeConfig[shopData[i].goodsId].Price <= 0 then if isCanBuy and rechargeConfig[shopData[i].goodsId].Price <= 0 then
return true return true
end end
end end
end end
local red=DynamicActivityManager.CheckMingWangRed() local red = DynamicActivityManager.CheckMingWangRed()
if red then if red then
return true return true
end end
return false return false
end end
function this.CheckWishEquipStoreRedPoint() function this.CheckWishEquipStoreRedPoint()
local boughtNum = 0 local boughtNum = 0
local limitNum = 0 local limitNum = 0
local isOpen =CheckFunctionOpen(FUNCTION_OPEN_TYPE.EquipWish) local isOpen = CheckFunctionOpen(FUNCTION_OPEN_TYPE.EquipWish)
if isOpen==false then if isOpen == false then
return false return false
end end
local activityId = ActivityGiftManager.IsActivityTypeOpen(20015) local activityId = ActivityGiftManager.IsActivityTypeOpen(20015)
if not activityId then if not activityId then
@ -944,30 +949,27 @@ function this.CheckWishEquipStoreRedPoint()
end end
local shopData = OperatingManager.GetGiftGoodsInfoList(GoodsTypeDef.DirectPurchaseGift) local shopData = OperatingManager.GetGiftGoodsInfoList(GoodsTypeDef.DirectPurchaseGift)
for i = 1, #shopData do for i = 1, #shopData do
if rechargeConfig[shopData[i].goodsId].ShowType == DirectBuyType.XIANSHIMIBAO then if rechargeConfig[shopData[i].goodsId].ShowType == DirectBuyType.XIANSHIMIBAO and rechargeConfig[shopData[i].goodsId].ShowType == 60 then
boughtNum = OperatingManager.GetGoodsBuyTime(GoodsTypeDef.DirectPurchaseGift, shopData[i].goodsId) boughtNum = OperatingManager.GetGoodsBuyTime(GoodsTypeDef.DirectPurchaseGift, shopData[i].goodsId)
limitNum = rechargeConfig[shopData[i].goodsId].Limit limitNum = rechargeConfig[shopData[i].goodsId].Limit
local isCanBuy = limitNum - boughtNum >0 local isCanBuy = limitNum - boughtNum > 0
if isCanBuy and rechargeConfig[shopData[i].goodsId].Price <= 0 then if isCanBuy and rechargeConfig[shopData[i].goodsId].Price <= 0 then
return true return true
end end
end end
end end
local red=DynamicActivityManager.CheckMingWangRed() local red = DynamicActivityManager.CheckMingWangRed()
if red then if red then
return true return true
end end
return false return false
end end
--为限时神装写的(只有一个) --为限时神装写的(只有一个)
function this.GetTimeLimitSkinInfoList() function this.GetTimeLimitSkinInfoList()
local giftList={} local giftList = {}
local infoList = OperatingManager.GetGiftGoodsInfoList(GoodsTypeDef.DirectPurchaseGift)--拿取所有类型5礼包信息(包含需要的礼包) local infoList = OperatingManager.GetGiftGoodsInfoList(GoodsTypeDef.DirectPurchaseGift) --拿取所有类型5礼包信息(包含需要的礼包)
local infoList2 = ConfigManager.GetConfigDataByKey(ConfigName.RechargeCommodityConfig,"ShowType",29) local infoList2 = ConfigManager.GetConfigDataByKey(ConfigName.RechargeCommodityConfig, "ShowType", 29)
for index, value in pairs(infoList) do for index, value in pairs(infoList) do
if infoList2.Id == value.goodsId and value.dynamicBuyTimes > 0 then if infoList2.Id == value.goodsId and value.dynamicBuyTimes > 0 then
return value return value
@ -975,36 +977,30 @@ function this.GetTimeLimitSkinInfoList()
end end
return nil return nil
end end
--为限时折扣写的(含有多个) --为限时折扣写的(含有多个)
function this.GetInfoList(showData) function this.GetInfoList(showData)
local giftList={} local giftList = {}
local infoList = OperatingManager.GetGiftGoodsInfoList(GoodsTypeDef.DirectPurchaseGift)--拿取所有类型5礼包信息(包含需要的礼包) local infoList = OperatingManager.GetGiftGoodsInfoList(GoodsTypeDef.DirectPurchaseGift) --拿取所有类型5礼包信息(包含需要的礼包)
if not showData or #showData < 1 then if not showData or #showData < 1 then
return giftList return giftList
end end
local giftList2 = {} local giftList2 = {}
for i = 1,#showData[1] do for i = 1, #showData[1] do
local infoList2 = ConfigManager.TryGetAllConfigsDataByKey(ConfigName.RechargeCommodityConfig,"ShowType",showData[1][i]) local infoList2 = ConfigManager.GetAllConfigsDataByKey(ConfigName.RechargeCommodityConfig, "ShowType",
if infoList2 then showData[1][i])
for i = 1, #infoList2 do for i = 1, #infoList2 do
table.insert(giftList2,infoList2[i]) table.insert(giftList2, infoList2[i])
end
else
LogError("没有ShowType的推送礼包====="..showData[1][i])
end end
end end
if infoList then for index, value in pairs(infoList) do
for index, value in pairs(infoList) do for i = 1, #giftList2 do
for i = 1, #giftList2 do if giftList2[i].Id == value.goodsId and value.dynamicBuyTimes > 0 then
if giftList2[i].Id == value.goodsId and value.dynamicBuyTimes > 0 then table.insert(giftList, value)
table.insert(giftList,value)
end
end end
end end
end end
return giftList return giftList
end end
return this return this

View File

@ -1,4 +1,4 @@
local RechargeView = {} local RechargeView = {}
function RechargeView:New(gameObject) function RechargeView:New(gameObject)
local b = {} local b = {}
b.gameObject = gameObject b.gameObject = gameObject
@ -102,4 +102,3 @@ end
return RechargeView return RechargeView

View File

@ -10,12 +10,12 @@ end
--添加事件监听(用于子类重写) --添加事件监听(用于子类重写)
function RechargeViewNew:AddListener() function RechargeViewNew:AddListener()
Game.GlobalEvent:AddEvent(GameEvent.MoneyPay.OnPayResultSuccess,self.SetGrowGift,self) 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) Game.GlobalEvent:RemoveEvent(GameEvent.MoneyPay.OnPayResultSuccess, self.SetGrowGift, self)
end end
function RechargeViewNew:InitComponent() function RechargeViewNew:InitComponent()
@ -28,9 +28,9 @@ function RechargeViewNew:InitComponent()
end end
-- 显示特权信息 -- 显示特权信息
--===================成长礼包================ --===================成长礼包================
self.grow = Util.GetGameObject(self.gameObject,"growPack/Content") self.grow = Util.GetGameObject(self.gameObject, "growPack/Content")
self.tip = Util.GetGameObject(self.grow,"Tip"):GetComponent("Text") self.tip = Util.GetGameObject(self.grow, "Tip"):GetComponent("Text")
self.icon = Util.GetGameObject(self.grow,"Icon"):GetComponent("Image") self.icon = Util.GetGameObject(self.grow, "Icon"):GetComponent("Image")
self.Level = Util.GetGameObject(self.grow,"Icon/Level"):GetComponent("Text") self.Level = Util.GetGameObject(self.grow,"Icon/Level"):GetComponent("Text")
self.name = Util.GetGameObject(self.grow,"Name"):GetComponent("Image") self.name = Util.GetGameObject(self.grow,"Name"):GetComponent("Image")
self.name.sprite=self.spLoader:LoadSprite("gm_mingwang_title") self.name.sprite=self.spLoader:LoadSprite("gm_mingwang_title")
@ -49,13 +49,13 @@ function RechargeViewNew:InitComponent()
self.endTimeBg = Util.GetGameObject(self.gameObject,"growPack/Time") self.endTimeBg = Util.GetGameObject(self.gameObject,"growPack/Time")
self.endTimeBg.gameObject:SetActive(false) self.endTimeBg.gameObject:SetActive(false)
self.ItemList = {} self.ItemList = {}
end end
function RechargeViewNew:BindEvent() function RechargeViewNew:BindEvent()
end end
--界面打开时调用(用于子类重写) --界面打开时调用(用于子类重写)
function RechargeViewNew:OnOpen(_activityConfig,_index,parent) function RechargeViewNew:OnOpen(_activityConfig, _index, parent)
self.actConfig = _activityConfig self.actConfig = _activityConfig
self.pageIndex = _index self.pageIndex = _index
self.parent = parent self.parent = parent
@ -67,7 +67,12 @@ end
function RechargeViewNew:OnShow(_sortingOrder) function RechargeViewNew:OnShow(_sortingOrder)
self.gameObject:SetActive(true) self.gameObject:SetActive(true)
self.sortingOrder = _sortingOrder self.sortingOrder = _sortingOrder
self.shopView:ShowShop(SHOP_TYPE.SOUL_STONE_SHOP, self.sortingOrder) LogError("self.actConfig=============" .. self.actConfig.ShopData[1][3])
local showType = 3
if self.actConfig.ShopData and #self.actConfig.ShopData > 0 then
showType = self.actConfig.ShopData[1][3]
end
self.shopView:ShowShop(SHOP_TYPE.SOUL_STONE_SHOP, self.sortingOrder, showType)
self:SetGrowGift() self:SetGrowGift()
end end
@ -103,7 +108,7 @@ function RechargeViewNew:SetGrowGift()
end end
end end
Log("当前声望Level:"..tostring(DynamicActivityManager.curLevel).." Index:"..tostring(DynamicActivityManager.Index)) Log("当前声望Level:" .. tostring(DynamicActivityManager.curLevel) .. " Index:" .. tostring(DynamicActivityManager.Index))
--如果有当前声望数据,就显示,没有就显示上一档位 --如果有当前声望数据,就显示,没有就显示上一档位
--local data = not not growData[DynamicActivityManager.Index] and growData[DynamicActivityManager.Index] or growData[DynamicActivityManager.Index-1] --local data = not not growData[DynamicActivityManager.Index] and growData[DynamicActivityManager.Index] or growData[DynamicActivityManager.Index-1]
local data=growData[DynamicActivityManager.Index] local data=growData[DynamicActivityManager.Index]
@ -112,24 +117,25 @@ function RechargeViewNew:SetGrowGift()
end end
self:RefreshReward(data) self:RefreshReward(data)
Util.AddOnceClick(self.btnLeft,function () Util.AddOnceClick(self.btnLeft, function()
if growData[DynamicActivityManager.Index - 1] then if growData[DynamicActivityManager.Index - 1] then
DynamicActivityManager.Index = DynamicActivityManager.Index - 1 DynamicActivityManager.Index = DynamicActivityManager.Index - 1
self:RefreshReward(growData[DynamicActivityManager.Index]) self:RefreshReward(growData[DynamicActivityManager.Index])
end end
end) end)
Util.AddOnceClick(self.btnRight,function () Util.AddOnceClick(self.btnRight, function()
if growData[DynamicActivityManager.Index + 1] then if growData[DynamicActivityManager.Index + 1] then
DynamicActivityManager.Index = DynamicActivityManager.Index + 1 DynamicActivityManager.Index = DynamicActivityManager.Index + 1
self:RefreshReward(growData[DynamicActivityManager.Index]) self:RefreshReward(growData[DynamicActivityManager.Index])
end end
end) end)
end end
--刷新奖励、按钮显示 --刷新奖励、按钮显示
function RechargeViewNew:RefreshReward(Data) function RechargeViewNew:RefreshReward(Data)
local rechargeNum =BagManager.GetItemCountById(1351) --VipManager.GetChargedNum()--已经充值的金额 local rechargeNum = BagManager.GetItemCountById(1351) --VipManager.GetChargedNum()--已经充值的金额
self.btnLeft:SetActive(not not growData[DynamicActivityManager.Index - 1])--左按钮显示 self.btnLeft:SetActive(not not growData[DynamicActivityManager.Index - 1]) --左按钮显示
self.btnRight:SetActive(not not growData[DynamicActivityManager.Index + 1])--右按钮显示 self.btnRight:SetActive(not not growData[DynamicActivityManager.Index + 1]) --右按钮显示
-- LogPink(DynamicActivityManager.Index.." 金额:"..tostring(Data.data.shopItemData.BuyRule[2]).." 限购:"..tostring(Data.data.limitNum).." 已购:"..tostring(Data.data.boughtNum).." rechargeNum:"..tostring(rechargeNum)) -- LogPink(DynamicActivityManager.Index.." 金额:"..tostring(Data.data.shopItemData.BuyRule[2]).." 限购:"..tostring(Data.data.limitNum).." 已购:"..tostring(Data.data.boughtNum).." rechargeNum:"..tostring(rechargeNum))
local text = 1 local text = 1
local num = 0 local num = 0
@ -142,8 +148,8 @@ function RechargeViewNew:RefreshReward(Data)
text = DynamicActivityManager.Index text = DynamicActivityManager.Index
num = growData[DynamicActivityManager.Index].data.shopItemData.BuyRule[2] num = growData[DynamicActivityManager.Index].data.shopItemData.BuyRule[2]
end end
num=DynamicActivityManager.GetMingWangLv(num) num = DynamicActivityManager.GetMingWangLv(num)
local aaa=growData[DynamicActivityManager.curLevel].data.shopItemData.BuyRule[2] local aaa = growData[DynamicActivityManager.curLevel].data.shopItemData.BuyRule[2]
if DynamicActivityManager.curLevel <= 2 then if DynamicActivityManager.curLevel <= 2 then
--self.tip.text = string.format("再获得%s积分升至名望1",num - rechargeNum) --self.tip.text = string.format("再获得%s积分升至名望1",num - rechargeNum)
elseif DynamicActivityManager.curLevel + 1 >= #growData and rechargeNum >= DynamicActivityManager.GetMingWangLv(aaa) then elseif DynamicActivityManager.curLevel + 1 >= #growData and rechargeNum >= DynamicActivityManager.GetMingWangLv(aaa) then
@ -215,6 +221,7 @@ function RechargeViewNew:RefreshReward(Data)
self.ItemList[i] = SubUIManager.Open(SubUIConfig.ItemView,self.reward.transform) self.ItemList[i] = SubUIManager.Open(SubUIConfig.ItemView,self.reward.transform)
end end
self.ItemList[i]:OnOpen(false, {Data.data.shows[i][1],Data.data.shows[i][2],Data.data.shows[i][3]}, 0.9,false,false,false,self.sortingOrder) self.ItemList[i]:OnOpen(false, {Data.data.shows[i][1],Data.data.shows[i][2],Data.data.shows[i][3]}, 0.9,false,false,false,self.sortingOrder)
--false, false, false, self.sortingOrder)
self.ItemList[i].gameObject:SetActive(true) self.ItemList[i].gameObject:SetActive(true)
end end
@ -259,7 +266,4 @@ function RechargeViewNew:OnDestroy()
end end
end end
return RechargeViewNew return RechargeViewNew

View File

@ -1,4 +1,6 @@
local _ShopTypeConfig = ConfigManager.GetConfig(ConfigName.StoreTypeConfig) local _ShopTypeConfig = ConfigManager.GetConfig(ConfigName.StoreTypeConfig)
local itemConfig = ConfigManager.GetConfig(ConfigName.ItemConfig)
local rechargeOrder = ConfigManager.GetConfig(ConfigName.RechargeCommodityorder)
-- 通用得商店逻辑 -- 通用得商店逻辑
local ShopView = {} local ShopView = {}
local this = ShopView local this = ShopView
@ -54,13 +56,12 @@ function this:InitComponent()
self.rechargeShopItem = Util.GetGameObject(self.gameObject, "scrollbg/scrollroot/item") self.rechargeShopItem = Util.GetGameObject(self.gameObject, "scrollbg/scrollroot/item")
self.titleBg = Util.GetGameObject(self.gameObject, "titlebg") self.titleBg = Util.GetGameObject(self.gameObject, "titlebg")
self.titleImg = Util.GetGameObject(self.gameObject, "titlebg/title") self.titleImg = Util.GetGameObject(self.gameObject, "titlebg/title")
self.titleText = Util.GetGameObject(self.gameObject, "titlebg/title/titleText")
self.helpBtn = Util.GetGameObject(self.gameObject, "titlebg/helpBtn") --scrollbg/titlebg/ self.helpBtn = Util.GetGameObject(self.gameObject, "titlebg/helpBtn") --scrollbg/titlebg/
self.helpPosition = self.helpBtn:GetComponent("RectTransform").localPosition self.helpPosition = self.helpBtn:GetComponent("RectTransform").localPosition
-- 创建循环列表 -- 创建循环列表
if not self.ScrollView then if not self.ScrollView then
self.ScrollView = SubUIManager.Open(SubUIConfig.ScrollCycleView, self.scrollRoot.transform, self.ScrollView = SubUIManager.Open(SubUIConfig.ScrollCycleView, self.scrollRoot.transform,
self.shopItem, nil, Vector2.New(1060, 1000), 1, 2, Vector2.New(25, 20)) self.shopItem, nil, Vector2.New(1000, 1024), 1, 3, Vector2.New(80, 0))
self.ScrollView.moveTween.MomentumAmount = 1 self.ScrollView.moveTween.MomentumAmount = 1
self.ScrollView.moveTween.Strength = 2 self.ScrollView.moveTween.Strength = 2
end end
@ -69,7 +70,7 @@ function this:InitComponent()
-- 创建循环列表 -- 创建循环列表
if not self.RechargeScrollView then if not self.RechargeScrollView then
self.RechargeScrollView = SubUIManager.Open(SubUIConfig.ScrollCycleView, self.scrollRoot.transform, self.RechargeScrollView = SubUIManager.Open(SubUIConfig.ScrollCycleView, self.scrollRoot.transform,
self.rechargeShopItem, nil, Vector2.New(1000, 1024), 1, 3, Vector2.New(40, 10)) self.rechargeShopItem, nil, Vector2.New(1000, 1024), 1, 3, Vector2.New(80, 0))
self.RechargeScrollView.moveTween.MomentumAmount = 1 self.RechargeScrollView.moveTween.MomentumAmount = 1
self.RechargeScrollView.moveTween.Strength = 2 self.RechargeScrollView.moveTween.Strength = 2
self.RechargeScrollView.gameObject.transform.localPosition = Vector3.New(0, -20, 0) self.RechargeScrollView.gameObject.transform.localPosition = Vector3.New(0, -20, 0)
@ -220,11 +221,14 @@ end
-- 刷新商店内容显示 -- 刷新商店内容显示
function this:RefreshShopInfo(isRefresh, isTop, isAni) function this:RefreshShopInfo(isRefresh, isTop, isAni)
if self.ShopType == SHOP_TYPE.SOUL_STONE_SHOP then if self.ShopType == SHOP_TYPE.SOUL_STONE_SHOP then
self.RechargeShopData = OperatingManager.GetGiftGoodsInfoList(GoodsTypeDef.DemonCrystal) if self.showType and self.showType ~= 0 then
LogError("slef.shwotype==========================" .. self.showType)
self.RechargeShopData = OperatingManager.GetGiftGoodsInfoList(self.showType)
end
else else
self.ShopData = ShopManager.GetShopDataByType(self.ShopType) self.ShopData = ShopManager.GetShopDataByType(self.ShopType)
end end
LogError("ccccccccccccccccccc" .. tostring(self.ShopType) .. "/" .. tostring(self.showType))
self:RefreshLive() self:RefreshLive()
self:RefreshBase() self:RefreshBase()
self:RefreshItemList(isRefresh, isTop, isAni) self:RefreshItemList(isRefresh, isTop, isAni)
@ -429,7 +433,22 @@ function this:RefreshItemList(isRefresh, isTop, isAni)
self.ScrollView.gameObject:SetActive(false) self.ScrollView.gameObject:SetActive(false)
self.RechargeScrollView.gameObject:SetActive(true) self.RechargeScrollView.gameObject:SetActive(true)
local itemlist = self.RechargeShopData local itemlist = self.RechargeShopData
self.RechargeScrollView:SetData(itemlist, function(index, shopItem) local showList = {}
LogError("#itemlist================================" .. #itemlist)
for i = 1, #itemlist do
local isCan = true
for k, v in ConfigPairs(rechargeOrder) do
if v.BehindCommodity == itemlist[i].goodsId then
if VipManager.GetChargedNum() < v.RechargeAmount then
isCan = false
end
end
end
if isCan then
table.insert(showList, itemlist[i])
end
end
self.RechargeScrollView:SetData(showList, function(index, shopItem)
local itemData = itemlist[index] local itemData = itemlist[index]
self:RechargeShopItemAdapter(shopItem, itemData) self:RechargeShopItemAdapter(shopItem, itemData)
-- if isPlayShow then -- if isPlayShow then
@ -485,11 +504,11 @@ function this:ShopItemAdapter(shopItem, itemData)
local itemDes = Util.GetGameObject(bg, "itemDes"):GetComponent("Text") local itemDes = Util.GetGameObject(bg, "itemDes"):GetComponent("Text")
local limitBg = Util.GetGameObject(bg, "buyLimitbg") local limitBg = Util.GetGameObject(bg, "buyLimitbg")
local limitTip = Util.GetGameObject(limitBg, "tip"):GetComponent("Text") local limitTip = Util.GetGameObject(limitBg, "tip"):GetComponent("Text")
Util.GetGameObject(limitBg, "buyLimit"):GetComponent("Text").text = ""
local priceBg = Util.GetGameObject(bg, "pricebg") local priceBg = Util.GetGameObject(bg, "pricebg")
local itemPrice = Util.GetGameObject(bg, "pricebg/price"):GetComponent("Text") local itemPrice = Util.GetGameObject(bg, "pricebg/price"):GetComponent("Text")
local costIcon = Util.GetGameObject(bg, "pricebg/costIcon"):GetComponent("Image") local costIcon = Util.GetGameObject(bg, "pricebg/costIcon"):GetComponent("Image")
local discountbg = Util.GetGameObject(bg, "discountbg/zekouImage") local discountbg = Util.GetGameObject(bg, "discountbg/zekouImage")
local discountbg1 = Util.GetGameObject(bg, "discountbg")
local empty = Util.GetGameObject(shopItem, "empty") local empty = Util.GetGameObject(shopItem, "empty")
local yihuode = Util.GetGameObject(shopItem, "yihuode") local yihuode = Util.GetGameObject(shopItem, "yihuode")
local lock = Util.GetGameObject(shopItem, "lock") local lock = Util.GetGameObject(shopItem, "lock")
@ -510,6 +529,7 @@ function this:ShopItemAdapter(shopItem, itemData)
itemName.text = itemName.text .. itemName.text = itemName.text ..
"\n" .. "\n" ..
string.format("<color=%s><size=%s>%s(%s/%s)</size></color>", "#FAE05C", "25", "拥有:", haveCount, string.format("<color=%s><size=%s>%s(%s/%s)</size></color>", "#FAE05C", "25", "拥有:", haveCount,
haveCount,
con.UsePerCount) con.UsePerCount)
end end
if con.ItemType == ItemType.Talisman then if con.ItemType == ItemType.Talisman then
@ -517,7 +537,7 @@ function this:ShopItemAdapter(shopItem, itemData)
if con.ItemDescribe then if con.ItemDescribe then
local str = string.split(con.ItemDescribe, '') local str = string.split(con.ItemDescribe, '')
if str[1] then if str[1] then
itemDes.text = str[1] itemDes.text = GetLanguageStrById(str[1])
end end
else else
itemDes.gameObject:SetActive(false) itemDes.gameObject:SetActive(false)
@ -530,13 +550,12 @@ function this:ShopItemAdapter(shopItem, itemData)
if price == 0 then if price == 0 then
discountbg1:SetActive(true) discountbg1:SetActive(true)
discountbg1:GetComponent("Image").sprite = self.spLoader:LoadSprite("X1_jingjichang_mianfei_zh") discountbg1:GetComponent("Image").sprite = self.spLoader:LoadSprite("X1_jingjichang_mianfei_zh")
discountbg:SetActive(false)
else else
local isDiscount = itemInfo.IsDiscount == 1 local isDiscount = itemInfo.IsDiscount == 1
discountbg1:SetActive(isDiscount)
discountbg:SetActive(isDiscount) discountbg:SetActive(isDiscount)
if isDiscount then if isDiscount then
discountbg:GetComponent("Text").text = itemInfo.DiscountDegree discountbg:GetComponent("Image").sprite = self.spLoader:LoadSprite("s_shop_zhekou_0" ..
itemInfo.DiscountDegree .. "_zh")
end end
end end
-- 消耗物品的信息 -- 消耗物品的信息
@ -553,13 +572,13 @@ function this:ShopItemAdapter(shopItem, itemData)
end end
end end
lock:SetActive(not _IsUnLock) lock:SetActive(not _IsUnLock)
--priceBg.gameObject:SetActive(_IsUnLock) priceBg.gameObject:SetActive(_IsUnLock)
itemName.gameObject:SetActive(_IsUnLock) itemName.gameObject:SetActive(_IsUnLock)
-- -- 限购 -- -- 限购
limitBg:SetActive(maxLimitCount ~= -1) limitBg:SetActive(maxLimitCount ~= -1)
limitTip.text = Language[12037] .. " " .. maxLimitCount limitTip.text = Language[12037] .. " " .. maxLimitCount
SetTextVerTial(limitTip, Vector3.New(12.65, -4.2, 0), "MiddleLeft") --SetTextVerTial(limitTip, Vector3.New(12.65, -4.2, 0), "MiddleLeft")
-- 售空 限购次数为-1 表示不限购 -- 售空 限购次数为-1 表示不限购
local isEmpty = maxLimitCount ~= -1 and curBuyCount >= maxLimitCount local isEmpty = maxLimitCount ~= -1 and curBuyCount >= maxLimitCount
if curBuyCount >= maxLimitCount then if curBuyCount >= maxLimitCount then
@ -590,7 +609,7 @@ function this:ShopItemAdapter(shopItem, itemData)
local bgImage = Util.GetGameObject(bg, "Image") local bgImage = Util.GetGameObject(bg, "Image")
imgColor = isEmpty and Color.New(0.5, 0.5, 0.5, 1) or Color.New(0.54, 0.38, 0.81, 1) imgColor = isEmpty and Color.New(0.5, 0.5, 0.5, 1) or Color.New(0.54, 0.38, 0.81, 1)
local pricebg = Util.GetGameObject(bg, "pricebg"):GetComponent("Image") local pricebg = Util.GetGameObject(bg, "pricebg"):GetComponent("Image")
pricebg.color =isEmpty and Color.New(0.1, 0.1, 0.1, 1) or Color.New(0.15, 0.15, 0.15, 1) pricebg.color = isEmpty and Color.New(0.1, 0.1, 0.1, 1) or Color.New(0.15, 0.15, 0.15, 1)
Util.SetColor(bgImage, imgColor) Util.SetColor(bgImage, imgColor)
SetAlpha(itemName, textA) SetAlpha(itemName, textA)
--SetAlpha(limitTip, textA) --SetAlpha(limitTip, textA)
@ -675,7 +694,12 @@ function this:RechargeShopItemAdapter(shopItem, itemData)
-- 判断首充赠送 -- 判断首充赠送
local curBuyCount = itemData.buyTimes local curBuyCount = itemData.buyTimes
first:SetActive(curBuyCount < 1) first:SetActive(curBuyCount < 1)
firstNum.text = itemInfo.FirstMultiple[1][2] if itemInfo.FirstMultiple then
firstNum.text = itemInfo.FirstMultiple[1][2]
else
firstNum.text = ""
end
if itemInfo.ContinuedMultiple and tonumber(itemInfo.ContinuedMultiple[1]) ~= nil then if itemInfo.ContinuedMultiple and tonumber(itemInfo.ContinuedMultiple[1]) ~= nil then
xuChong:SetActive(curBuyCount >= 1) xuChong:SetActive(curBuyCount >= 1)
xuNum.text = itemInfo.ContinuedMultiple[2] xuNum.text = itemInfo.ContinuedMultiple[2]
@ -702,7 +726,7 @@ end
---=====================================对外接口=============================---- ---=====================================对外接口=============================----
-- 设置要显示的商店类型 -- 设置要显示的商店类型
function this:ShowShop(shopType, _sortingOrder) function this:ShowShop(shopType, _sortingOrder, _showType)
self.ScrollView:ForeachItemGO(function(index, go) self.ScrollView:ForeachItemGO(function(index, go)
go.gameObject:SetActive(false) go.gameObject:SetActive(false)
end) end)
@ -728,6 +752,7 @@ function this:ShowShop(shopType, _sortingOrder)
-- 刷新显示 -- 刷新显示
self.ShopType = shopType self.ShopType = shopType
self.showType = _showType
isPlayShow = true isPlayShow = true
self.ShopId = ShopManager.GetShopDataByType(self.ShopType).id self.ShopId = ShopManager.GetShopDataByType(self.ShopType).id
self.ShopConfig = _ShopTypeConfig[self.ShopId] self.ShopConfig = _ShopTypeConfig[self.ShopId]

View File

@ -75,6 +75,9 @@ function ForceRebuildLayout(_transform)
end end
LayoutRebuilder.ForceRebuildLayoutImmediate(_transform) LayoutRebuilder.ForceRebuildLayoutImmediate(_transform)
end end
if not LayoutRebuilder then
LayoutRebuilder = UnityEngine.UI.LayoutRebuilder
end
end end
function LoadStreamingTexture(spLoader, name, func) function LoadStreamingTexture(spLoader, name, func)