TCX_LongZhu
DESKTOP-RH64908\Administrator 2025-12-29 16:40:35 +08:00
parent 03579e1c48
commit eceabf4ae8
4 changed files with 239 additions and 235 deletions

View File

@ -208,6 +208,7 @@ function FirstRechargePanel:OnShow()
local money = activityRewardConfig[missInfo.missionId].Values[1][1] local money = activityRewardConfig[missInfo.missionId].Values[1][1]
--LogError("money===="..money) --LogError("money===="..money)
--local index = FirstRechargeManager.GetFirstRechargeIndexByMoney(money) --local index = FirstRechargeManager.GetFirstRechargeIndexByMoney(money)
LogError("ddddddddddddddddddddddddddddddddd"..tostring(money))
local index = FirstRechargeManager.GetFirstRechargeIndexByMoney(money) local index = FirstRechargeManager.GetFirstRechargeIndexByMoney(money)
if not _MoneyDataNum[index] then if not _MoneyDataNum[index] then
_MoneyDataNum[index] = {} _MoneyDataNum[index] = {}
@ -309,7 +310,7 @@ function FirstRechargePanel:OnTabChanged(index)
for _, missInfo in ipairs(tempData) do for _, missInfo in ipairs(tempData) do
if missInfo and missInfo.progress and activityRewardConfig[missInfo.missionId].Values[1][1] == money then if missInfo and missInfo.progress and activityRewardConfig[missInfo.missionId].Values[1][1] == money then
AccumRecharge = missInfo.progress AccumRecharge = missInfo.progress
LogError("missionInfo.state==" .. missInfo.state) LogError("missionInfo.state==" ..tostring(missInfo.missionId).."/".. missInfo.state..""..tostring(money))
-- if AccumRecharge >= activityRewardConfig[missInfo.missionId].Values[1][1] then -- if AccumRecharge >= activityRewardConfig[missInfo.missionId].Values[1][1] then
-- local day = GetTimePass(FirstRechargeManager.GetRechargeTime())--FirstRechargeManager.GetRechargeTime() -- local day = GetTimePass(FirstRechargeManager.GetRechargeTime())--FirstRechargeManager.GetRechargeTime()
-- if missInfo.state ~= 1 and activityRewardConfig[missInfo.missionId].Values[1][2] <= day then -- if missInfo.state ~= 1 and activityRewardConfig[missInfo.missionId].Values[1][2] <= day then
@ -350,7 +351,7 @@ end
function FirstRechargePanel:ShowContent(index) function FirstRechargePanel:ShowContent(index)
local tempData = {} local tempData = {}
LogError("sssssssssssssssssssssssssssss" .. tostring(index)) --LogError("sssssssssssssssssssssssssssss" .. tostring(index))
for _, missionInfo in ipairs(_MoneyDataNum[index]) do for _, missionInfo in ipairs(_MoneyDataNum[index]) do
table.insert(tempData, activityRewardConfig[missionInfo.missionId]) table.insert(tempData, activityRewardConfig[missionInfo.missionId])
end end

View File

@ -122,6 +122,7 @@ end
local ActTypeConfigList = {} -- 做一个缓存避免重复遍历表数据 local ActTypeConfigList = {} -- 做一个缓存避免重复遍历表数据
function this.GetTableDataByTypeId(typeId) function this.GetTableDataByTypeId(typeId)
if not ActTypeConfigList[typeId] then if not ActTypeConfigList[typeId] then
LogError("ffffffffffffffffffffffffff"..tostring(typeId))
ActTypeConfigList[typeId] = ConfigManager.GetAllConfigsDataByKey(ConfigName.GlobalSystemConfig, "IsIDdSame", typeId) ActTypeConfigList[typeId] = ConfigManager.GetAllConfigsDataByKey(ConfigName.GlobalSystemConfig, "IsIDdSame", typeId)
end end
return ActTypeConfigList[typeId] return ActTypeConfigList[typeId]

View File

@ -20,7 +20,7 @@ local LoginRoot_Channel = ServerConfigManager.GetVersionInfo("channel")
local LoginRoot_Version = ServerConfigManager.GetVersionInfo("version") local LoginRoot_Version = ServerConfigManager.GetVersionInfo("version")
local LoginRoot_PackageVersion = ServerConfigManager.GetVersionInfo("packageVersion") local LoginRoot_PackageVersion = ServerConfigManager.GetVersionInfo("packageVersion")
local LoginRoot_NoticeChannel = ServerConfigManager.GetSettingValue(ServerConfigManager.SettingConfig.NOTICE_CHANNEL) or local LoginRoot_NoticeChannel = ServerConfigManager.GetSettingValue(ServerConfigManager.SettingConfig.NOTICE_CHANNEL) or
"" ""
local LoginRoot_UserChannel = ServerConfigManager.GetSettingValue(ServerConfigManager.SettingConfig.USER_CHANNEL) or "" local LoginRoot_UserChannel = ServerConfigManager.GetSettingValue(ServerConfigManager.SettingConfig.USER_CHANNEL) or ""
local orginLayer local orginLayer
local IsUserProtoActive = ServerConfigManager.IsSettingActive(ServerConfigManager.SettingConfig.USER_PROTO) local IsUserProtoActive = ServerConfigManager.IsSettingActive(ServerConfigManager.SettingConfig.USER_PROTO)
@ -630,7 +630,7 @@ function this.SetServerList(data)
end end
end end
end end
LogError("=================="..tostring(#this.serverList)) LogError("==================" .. tostring(#this.serverList))
PlayerManager.serverInfo = this.serverList[lastIndex] PlayerManager.serverInfo = this.serverList[lastIndex]
LoginManager.SocketAddress = this.serverList[lastIndex].ip LoginManager.SocketAddress = this.serverList[lastIndex].ip
LoginManager.SocketPort = tonumber(this.serverList[lastIndex].port) LoginManager.SocketPort = tonumber(this.serverList[lastIndex].port)
@ -703,8 +703,10 @@ function this.ExecuteLoading()
--[[[26] =]] function() NetManager.GuildHelpGetAllRequest(LoadingPanel.OnStep) end, -- 公会援助 --[[[26] =]] function() NetManager.GuildHelpGetAllRequest(LoadingPanel.OnStep) end, -- 公会援助
--[[[27] =]] function() DeathPosManager.InitData(LoadingPanel.OnStep) end, -- 十绝阵 --[[[27] =]] function() DeathPosManager.InitData(LoadingPanel.OnStep) end, -- 十绝阵
--[[[28] =]] function() NetManager.TreasureOfHeavenScoreRequest(LoadingPanel.OnStep) end, -- 天宫秘宝积分 --[[[28] =]] function() NetManager.TreasureOfHeavenScoreRequest(LoadingPanel.OnStep) end, -- 天宫秘宝积分
--[[[29] =]] function() NetManager.RankFirstRequest({ 3, 22, 20, 4, 21 }, { 0, 0, 0, 0, 20 }, LoadingPanel --[[[29] =]] function()
.OnStep) end, -- 排行榜数据 NetManager.RankFirstRequest({ 3, 22, 20, 4, 21 }, { 0, 0, 0, 0, 20 }, LoadingPanel
.OnStep)
end, -- 排行榜数据
--[[[30] =]] function() NetManager.GetSituationInfoRequest(LoadingPanel.OnStep) end, --轩辕宝镜 --[[[30] =]] function() NetManager.GetSituationInfoRequest(LoadingPanel.OnStep) end, --轩辕宝镜
--[[[31] =]] function() NetManager.RefreshTimeSLRequest(LoadingPanel.OnStep) end, --青龙秘宝倒计时 --[[[31] =]] function() NetManager.RefreshTimeSLRequest(LoadingPanel.OnStep) end, --青龙秘宝倒计时
--[[[32] =]] function() HeroManager.CheckRepeatTreasure(LoadingPanel.OnStep) end, --检测所有重复穿戴的宝器并卸下 --[[[32] =]] function() HeroManager.CheckRepeatTreasure(LoadingPanel.OnStep) end, --检测所有重复穿戴的宝器并卸下
@ -749,7 +751,8 @@ function this.ExecuteLoading()
-- 登录时初始化主界面竖条显示为打开状态 -- 登录时初始化主界面竖条显示为打开状态
PlayerPrefs.SetInt(PlayerManager.uid .. "MainRightBarSetting", 1) PlayerPrefs.SetInt(PlayerManager.uid .. "MainRightBarSetting", 1)
if AppConst.isGuide then if AppConst.isGuide then
if GuideManager.GetCurId(GuideType.Force) == 1 and PlayerManager.nickName == tostring(PlayerManager.uid) and PlayerManager.level == 1 then local data = ConfigManager.GetConfigData(ConfigName.GlobalSystemConfig, 161)
if data.IsOpen == 1 and GuideManager.GetCurId(GuideType.Force) == 1 and PlayerManager.nickName == tostring(PlayerManager.uid) and PlayerManager.level == 1 then
-- 新的引导 -- 新的引导
-- StoryManager.EventTrigger(300001) -- StoryManager.EventTrigger(300001)
--创号阶段先进入剧情对话,进入假战斗,然后对话起名,最后进入主界面 --创号阶段先进入剧情对话,进入假战斗,然后对话起名,最后进入主界面

View File

@ -2,27 +2,27 @@ require("Base/BasePanel")
local WeekCardPanel = Inherit(BasePanel) local WeekCardPanel = Inherit(BasePanel)
local sortingOrder = 0 local sortingOrder = 0
local _WeekcardConfig = ConfigManager.GetConfig(ConfigName.WeekcardConfig) local _WeekcardConfig = ConfigManager.GetConfig(ConfigName.WeekcardConfig)
local weekReward=ConfigManager.GetConfig(ConfigName.WeekRewardConfig) local weekReward = ConfigManager.GetConfig(ConfigName.WeekRewardConfig)
local _ItemConfig = ConfigManager.GetConfig(ConfigName.ItemConfig) local _ItemConfig = ConfigManager.GetConfig(ConfigName.ItemConfig)
local _RechargeCommodityConfig = ConfigManager.GetConfig(ConfigName.RechargeCommodityConfig) local _RechargeCommodityConfig = ConfigManager.GetConfig(ConfigName.RechargeCommodityConfig)
local weekcardR=nil local weekcardR = nil
--初始化组件(用于子类重写) --初始化组件(用于子类重写)
function WeekCardPanel:InitComponent() function WeekCardPanel:InitComponent()
self.spLoader = SpriteLoader.New() self.spLoader = SpriteLoader.New()
self.grid = Util.GetGameObject(self.gameObject, "grid") self.grid = Util.GetGameObject(self.gameObject, "grid")
self.cardPres = {} self.cardPres = {}
self.timerList = {} self.timerList = {}
self.tabs={} self.tabs = {}
self.selectObj=Util.GetGameObject(self.gameObject, "selectObj") self.selectObj = Util.GetGameObject(self.gameObject, "selectObj")
self.selectTxt=Util.GetGameObject(self.gameObject, "selectObj/Text"):GetComponent("Text") self.selectTxt = Util.GetGameObject(self.gameObject, "selectObj/Text"):GetComponent("Text")
self.info1=Util.GetGameObject(self.gameObject, "info1"):GetComponent("Text") self.info1 = Util.GetGameObject(self.gameObject, "info1"):GetComponent("Text")
self.info2=Util.GetGameObject(self.gameObject, "info2"):GetComponent("Text") self.info2 = Util.GetGameObject(self.gameObject, "info2"):GetComponent("Text")
self.info1.text="·购买后可领取活动前期累计奖励 及 后续奖励" self.info1.text = "·购买后可领取活动前期累计奖励 及 后续奖励"
self.info2.text="·每日0点刷新奖励可累计领取" self.info2.text = "·每日0点刷新奖励可累计领取"
self.titleImg=Util.GetGameObject(self.gameObject, "titleImg"):GetComponent("Image") self.titleImg = Util.GetGameObject(self.gameObject, "titleImg"):GetComponent("Image")
self.timeTxt=Util.GetGameObject(self.gameObject, "time"):GetComponent("Text") self.timeTxt = Util.GetGameObject(self.gameObject, "time"):GetComponent("Text")
self.titleImg.sprite=self.spLoader:LoadSprite("r_zhouka_zksh_zh") self.titleImg.sprite = self.spLoader:LoadSprite("r_zhouka_zksh_zh")
for i= 1 ,self.grid.transform.childCount do for i = 1, self.grid.transform.childCount do
self.cardPres[i] = {} self.cardPres[i] = {}
self.cardPres[i].go = self.grid.transform:GetChild(i - 1).gameObject self.cardPres[i].go = self.grid.transform:GetChild(i - 1).gameObject
self.cardPres[i].bg = self.cardPres[i].go:GetComponent("Image") self.cardPres[i].bg = self.cardPres[i].go:GetComponent("Image")
@ -45,18 +45,17 @@ function WeekCardPanel:InitComponent()
self.cardPres[i].btnText = Util.GetGameObject(self.cardPres[i].go, "btn/Text"):GetComponent("Text") self.cardPres[i].btnText = Util.GetGameObject(self.cardPres[i].go, "btn/Text"):GetComponent("Text")
self.cardPres[i].red = Util.GetGameObject(self.cardPres[i].go, "btn/redPoint") self.cardPres[i].red = Util.GetGameObject(self.cardPres[i].go, "btn/redPoint")
self.cardPres[i].rewardGrid = Util.GetGameObject(self.cardPres[i].go, "grid") self.cardPres[i].rewardGrid = Util.GetGameObject(self.cardPres[i].go, "grid")
self.cardPres[i].rewards={} self.cardPres[i].rewards = {}
for j= 1 ,self.cardPres[i].rewardGrid.transform.childCount do for j = 1, self.cardPres[i].rewardGrid.transform.childCount do
table.insert(self.cardPres[i].rewards,self.cardPres[i].rewardGrid.transform:GetChild(j - 1).gameObject) table.insert(self.cardPres[i].rewards, self.cardPres[i].rewardGrid.transform:GetChild(j - 1).gameObject)
self.cardPres[i].rewardGrid.transform:GetChild(j - 1).gameObject:SetActive(false) self.cardPres[i].rewardGrid.transform:GetChild(j - 1).gameObject:SetActive(false)
end end
end end
self.btnBack = Util.GetGameObject(self.gameObject,"btnClose") self.btnBack = Util.GetGameObject(self.gameObject, "btnClose")
self.helpBtn = Util.GetGameObject(self.gameObject, "helpBtn") self.helpBtn = Util.GetGameObject(self.gameObject, "helpBtn")
for i=1,5 do for i = 1, 5 do
table.insert(self.tabs,Util.GetGameObject(self.gameObject, "scrollrect/tabs/"..i)) table.insert(self.tabs, Util.GetGameObject(self.gameObject, "scrollrect/tabs/" .. i))
end end
end end
@ -86,106 +85,103 @@ function WeekCardPanel:OnOpen(args)
-- self.actConfig = _activityConfig -- self.actConfig = _activityConfig
-- self.pageIndex = _index -- self.pageIndex = _index
-- self.parent = parent -- self.parent = parent
activityId=args activityId = args
end end
function WeekCardPanel:OnSortingOrderChange() function WeekCardPanel:OnSortingOrderChange()
end end
-- 打开,重新打开时回调 -- 打开,重新打开时回调
local allcards={} local allcards = {}
local curKey=0 local curKey = 0
local curIndex=0 local curIndex = 0
--local activityId=0 --local activityId=0
local endTime=0 local endTime = 0
function WeekCardPanel:OnShow() function WeekCardPanel:OnShow()
self.gameObject:SetActive(true) self.gameObject:SetActive(true)
sortingOrder = _sortingOrder sortingOrder = _sortingOrder
local serverOpenTime = PlayerManager.GetServerOpenTime() local serverOpenTime = PlayerManager.GetServerOpenTime()
-- 查看周卡界面刷新红点 -- 查看周卡界面刷新红点
PlayerPrefs.SetInt("IsCheckWeekCard_"..PlayerManager.uid, 1) PlayerPrefs.SetInt("IsCheckWeekCard_" .. PlayerManager.uid, 1)
CheckRedPointStatus(RedPointType.WeekCard) CheckRedPointStatus(RedPointType.WeekCard)
local id = ActivityGiftManager.GetActivityTypeInfo(102) local id = ActivityGiftManager.GetActivityTypeInfo(102)
endTime=id.endTime endTime = id.endTime
self.timeTxt.text="活动时间:"..TimeStampToDateStr6(id.startTime)..""..TimeStampToDateStr6(id.endTime) self.timeTxt.text = "活动时间:" .. TimeStampToDateStr6(id.startTime) .. "" .. TimeStampToDateStr6(id.endTime)
weekcardR=ConfigManager.GetConfigDataByKey(ConfigName.WeekcardRotationConfig,"GlobalActivity",id.activityId) weekcardR = ConfigManager.GetConfigDataByKey(ConfigName.WeekcardRotationConfig, "GlobalActivity", id.activityId)
--weekcardR=ConfigManager.GetConfigData(ConfigName.WeekcardRotationConfig,1) --weekcardR=ConfigManager.GetConfigData(ConfigName.WeekcardRotationConfig,1)
local cardTypes={} local cardTypes = {}
for i=1,#weekcardR.WeekcardType do for i = 1, #weekcardR.WeekcardType do
local id=weekcardR.WeekcardType[i][3] local id = weekcardR.WeekcardType[i][3]
local min=weekcardR.WeekcardType[i][1] local min = weekcardR.WeekcardType[i][1]
local max=weekcardR.WeekcardType[i][2] local max = weekcardR.WeekcardType[i][2]
local type=_WeekcardConfig[id].Type local type = _WeekcardConfig[id].Type
local data=WeekCardManager.GetWeekCardData(id) local data = WeekCardManager.GetWeekCardData(id)
--已经购买 --已经购买
if data then if data then
if allcards[type]==nil then if allcards[type] == nil then
allcards[type]={} allcards[type] = {}
end end
table.insert(allcards[type],_WeekcardConfig[id]) table.insert(allcards[type], _WeekcardConfig[id])
table.insert(cardTypes,_WeekcardConfig[id].WeekcardType) table.insert(cardTypes, _WeekcardConfig[id].WeekcardType)
else else
if PlayerManager.level>=min and PlayerManager.level<=max and not cardTypes[_WeekcardConfig[id].WeekcardType] then if PlayerManager.level >= min and PlayerManager.level <= max and not cardTypes[_WeekcardConfig[id].WeekcardType] then
if allcards[type]==nil then if allcards[type] == nil then
allcards[type]={} allcards[type] = {}
end end
table.insert(allcards[type],_WeekcardConfig[id]) table.insert(allcards[type], _WeekcardConfig[id])
end end
end end
--table.insert(allcards,weekcardR.WeekcardType[i][3]) --table.insert(allcards,weekcardR.WeekcardType[i][3])
end end
for i=1, 5 do for i = 1, 5 do
self.tabs[i]:SetActive(false) self.tabs[i]:SetActive(false)
end end
local i=0 local i = 0
local firstKey=0 local firstKey = 0
for key, value in pairs(allcards) do for key, value in pairs(allcards) do
i=i+1 i = i + 1
self.tabs[i]:SetActive(true) self.tabs[i]:SetActive(true)
local name=Util.GetGameObject(self.tabs[i], "Text"):GetComponent("Text") local name = Util.GetGameObject(self.tabs[i], "Text"):GetComponent("Text")
name.text=value[1].Desc name.text = value[1].Desc
local red=Util.GetGameObject(self.tabs[i], "redpoint") local red = Util.GetGameObject(self.tabs[i], "redpoint")
red:SetActive(false) red:SetActive(false)
if firstKey == 0 then if firstKey == 0 then
firstKey = key firstKey = key
curIndex=i curIndex = i
end end
local kk=key local kk = key
Util.AddClick(self.tabs[i], function() Util.AddClick(self.tabs[i], function()
curKey = kk
curKey=kk curIndex = i
curIndex=i
self:SetCardWind(curKey) self:SetCardWind(curKey)
end) end)
LogError("key=="..key.." value=="..value[1].Id.." value2=="..value[2].Id) LogError("key==" .. key .. " value==" .. value[1].Id .. " value2==" .. value[2].Id)
end end
self:CheckTabRed() self:CheckTabRed()
if curKey==0 then if curKey == 0 then
curKey=firstKey curKey = firstKey
end end
self:SetCardWind(firstKey) self:SetCardWind(firstKey)
end end
function WeekCardPanel:CheckTabRed() function WeekCardPanel:CheckTabRed()
--检测页签红点 --检测页签红点
local num=0 local num = 0
for key, value in pairs(allcards) do for key, value in pairs(allcards) do
num=num+1 num = num + 1
local isTrue=false local isTrue = false
Util.GetGameObject(self.tabs[num], "redpoint"):SetActive(false) Util.GetGameObject(self.tabs[num], "redpoint"):SetActive(false)
for i=1,#value do for i = 1, #value do
isTrue=WeekCardManager.CheckTabRedReward(value[i].Id) isTrue = WeekCardManager.CheckTabRedReward(value[i].Id)
if isTrue then if isTrue then
Util.GetGameObject(self.tabs[num], "redpoint"):SetActive(isTrue) Util.GetGameObject(self.tabs[num], "redpoint"):SetActive(isTrue)
end end
end end
end end
end end
-- 钻石数量显示 -- 钻石数量显示
function WeekCardPanel:RefreshShow() function WeekCardPanel:RefreshShow()
-- local allData = WeekCardManager.GetWeekCardDataArray() -- local allData = WeekCardManager.GetWeekCardDataArray()
@ -199,15 +195,14 @@ function WeekCardPanel:RefreshShow()
self:SetCardWind(curKey) self:SetCardWind(curKey)
end end
--设置周卡界面 --设置周卡界面
function WeekCardPanel:SetCardWind(key) function WeekCardPanel:SetCardWind(key)
curkey=key curkey = key
if allcards[curkey] then if allcards[curkey] then
local aaa=0 local aaa = 0
for k, value in pairs(allcards) do for k, value in pairs(allcards) do
aaa=aaa+1 aaa = aaa + 1
if k==curkey then if k == curkey then
break break
end end
end end
@ -215,16 +210,24 @@ function WeekCardPanel:SetCardWind(key)
self.selectObj.transform.localScale = Vector3.one self.selectObj.transform.localScale = Vector3.one
self.selectObj.transform.localPosition = Vector3.zero self.selectObj.transform.localPosition = Vector3.zero
self.selectTxt:GetComponent("Text").text = Util.GetGameObject(self.tabs[aaa], "Text"):GetComponent("Text").text self.selectTxt:GetComponent("Text").text = Util.GetGameObject(self.tabs[aaa], "Text"):GetComponent("Text").text
for i=1,#allcards[curkey] do --[[
self:ShowCardInfo(i,allcards[curkey][i]) if aaa == 1 then
self.selectTxt:GetComponent("Text").text = "精英周卡"
Util.GetGameObject(self.tabs[aaa], "Text"):GetComponent("Text").text = "精英周卡"
elseif aaa == 2 then
self.selectTxt:GetComponent("Text").text = "传奇周卡"
Util.GetGameObject(self.tabs[aaa], "Text"):GetComponent("Text").text = "传奇周卡"
end
]]
for i = 1, #allcards[curkey] do
self:ShowCardInfo(i, allcards[curkey][i])
end end
end end
end end
--显示周卡信息 --显示周卡信息
function WeekCardPanel:ShowCardInfo(index,config) function WeekCardPanel:ShowCardInfo(index, config)
local pre = self.cardPres[index] local pre = self.cardPres[index]
if not pre then if not pre then
return return
@ -235,17 +238,16 @@ function WeekCardPanel:ShowCardInfo(index,config)
-- 背景 -- 背景
-- 物品名称 -- 物品名称
if config.QualityType==1 then if config.QualityType == 1 then
pre.name.text =config.Name-- "普通" pre.name.text = config.Name -- "普通"
pre.bg.sprite = self.spLoader:LoadSprite("X1_chongzhi_zuanshidiban") pre.bg.sprite = self.spLoader:LoadSprite("X1_chongzhi_zuanshidiban")
pre.btnImg.sprite=self.spLoader:LoadSprite("X1_shouzha_yeqianxuanzhong_01") pre.btnImg.sprite = self.spLoader:LoadSprite("X1_shouzha_yeqianxuanzhong_01")
pre.nameBg.sprite=self.spLoader:LoadSprite("UI_hz_zhonghe01_64") pre.nameBg.sprite = self.spLoader:LoadSprite("UI_hz_zhonghe01_64")
else else
pre.name.text = config.Name--"豪华" pre.name.text = config.Name --"豪华"
pre.bg.sprite = self.spLoader:LoadSprite("X1_chongzhi_zuanshidiban") pre.bg.sprite = self.spLoader:LoadSprite("X1_chongzhi_zuanshidiban")
pre.btnImg.sprite=self.spLoader:LoadSprite("X1_shouzha_yeqianxuanzhong_03") pre.btnImg.sprite = self.spLoader:LoadSprite("X1_shouzha_yeqianxuanzhong_03")
pre.nameBg.sprite=self.spLoader:LoadSprite("UI_hz_zhonghe01_64") pre.nameBg.sprite = self.spLoader:LoadSprite("UI_hz_zhonghe01_64")
end end
-- 每日奖励数量 -- 每日奖励数量
@ -253,35 +255,36 @@ function WeekCardPanel:ShowCardInfo(index,config)
local dayNum = 0 local dayNum = 0
-- pre.rewards -- pre.rewards
-- weekReward -- weekReward
local allNum=0 local allNum = 0
local name="" local name = ""
local icon="" local icon = ""
local oneNum=0 local oneNum = 0
for i=1,#config.BaseRewardID do for i = 1, #config.BaseRewardID do
if pre.rewards[i] then if pre.rewards[i] then
pre.rewards[i]:SetActive(true) pre.rewards[i]:SetActive(true)
local dayTxt=Util.GetGameObject(pre.rewards[i],"day"):GetComponent("Text") local dayTxt = Util.GetGameObject(pre.rewards[i], "day"):GetComponent("Text")
dayTxt.text=""..NumToChinese[config.BaseRewardID[i][1]].."" dayTxt.text = "" .. NumToChinese[config.BaseRewardID[i][1]] .. ""
local rewardId=config.BaseRewardID[i][2] local rewardId = config.BaseRewardID[i][2]
if weekReward[rewardId] then if weekReward[rewardId] then
local id= weekReward[rewardId].BaseReward[1] local id = weekReward[rewardId].BaseReward[1]
local num= weekReward[rewardId].BaseReward[2] local num = weekReward[rewardId].BaseReward[2]
name=_ItemConfig[id].Name name = _ItemConfig[id].Name
oneNum=num oneNum = num
icon=GetResourcePath(_ItemConfig[id].ResourceID) icon = GetResourcePath(_ItemConfig[id].ResourceID)
itemId=id itemId = id
pre.rewards[i]:GetComponent("Image").sprite=self.spLoader:LoadSprite(GetQuantityImageByquality(_ItemConfig[id].Quantity)) pre.rewards[i]:GetComponent("Image").sprite = self.spLoader:LoadSprite(GetQuantityImageByquality(
local icon1=Util.GetGameObject(pre.rewards[i],"Image"):GetComponent("Image") _ItemConfig[id].Quantity))
icon1.sprite=self.spLoader:LoadSprite(icon) local icon1 = Util.GetGameObject(pre.rewards[i], "Image"):GetComponent("Image")
local stateTxt=Util.GetGameObject(pre.rewards[i],"Text"):GetComponent("Text") icon1.sprite = self.spLoader:LoadSprite(icon)
local numTxt=Util.GetGameObject(pre.rewards[i],"num"):GetComponent("Text") local stateTxt = Util.GetGameObject(pre.rewards[i], "Text"):GetComponent("Text")
if num>10000 then local numTxt = Util.GetGameObject(pre.rewards[i], "num"):GetComponent("Text")
numTxt.text=PrintWanNum2(num) if num > 10000 then
numTxt.text = PrintWanNum2(num)
else else
numTxt.text=num numTxt.text = num
end end
allNum=allNum+num allNum = allNum + num
end end
-- pre.rewards[i]:GetComponent("Image").sprite=self.spLoader:LoadSprite(config.TypeImage) -- pre.rewards[i]:GetComponent("Image").sprite=self.spLoader:LoadSprite(config.TypeImage)
@ -289,29 +292,29 @@ function WeekCardPanel:ShowCardInfo(index,config)
end end
pre.icon.sprite = self.spLoader:LoadSprite(icon) pre.icon.sprite = self.spLoader:LoadSprite(icon)
Util.AddClick(pre.icon.gameObject,function() Util.AddClick(pre.icon.gameObject, function()
UIManager.OpenPanel(UIName.RewardItemSingleShowPopup,itemId,nil) UIManager.OpenPanel(UIName.RewardItemSingleShowPopup, itemId, nil)
end ) end)
pre.Text.text = name.."*"..PrintWanNum2(oneNum) pre.Text.text = name .. "*" .. PrintWanNum2(oneNum)
local str=name.."*"..PrintWanNum2(allNum) local str = name .. "*" .. PrintWanNum2(allNum)
pre.hint.text = "共计: ".."<color=#F47B22>"..str.."</color>" pre.hint.text = "共计: " .. "<color=#F47B22>" .. str .. "</color>"
local rechargeCfg = _RechargeCommodityConfig[config.RechargeId] local rechargeCfg = _RechargeCommodityConfig[config.RechargeId]
if not rechargeCfg then if not rechargeCfg then
return return
end end
local data=WeekCardManager.GetWeekCardData(config.Id) local data = WeekCardManager.GetWeekCardData(config.Id)
-- 按钮状态 -- 按钮状态
if data then if data then
local getNum=0 local getNum = 0
for i=1,#data.leaveGetRewardDays do for i = 1, #data.leaveGetRewardDays do
if data.leaveGetRewardDays[i].state==1 then if data.leaveGetRewardDays[i].state == 1 then
getNum=getNum+1 getNum = getNum + 1
end end
end end
local residueTimeNum = endTime - GetTimeStamp() local residueTimeNum = endTime - GetTimeStamp()
local dayNum = math.floor(residueTimeNum / (24 * 3600)) local dayNum = math.floor(residueTimeNum / (24 * 3600))
pre.timeTxt.text="(剩余"..dayNum.."天)" pre.timeTxt.text = "(剩余" .. dayNum .. "天)"
if dayNum==0 then if dayNum == 0 then
pre.timeTxt.gameObject:SetActive(false) pre.timeTxt.gameObject:SetActive(false)
else else
pre.timeTxt.gameObject:SetActive(true) pre.timeTxt.gameObject:SetActive(true)
@ -324,7 +327,7 @@ function WeekCardPanel:ShowCardInfo(index,config)
Util.AddOnceClick(pre.btn, function() Util.AddOnceClick(pre.btn, function()
local id = ActivityGiftManager.GetActivityTypeInfo(102) local id = ActivityGiftManager.GetActivityTypeInfo(102)
--LogError("cardid=="..data.id.." id=="..id.activityId) --LogError("cardid=="..data.id.." id=="..id.activityId)
WeekCardManager.RequestGetWeekCardReward(data.id, id.activityId,function() WeekCardManager.RequestGetWeekCardReward(data.id, id.activityId, function()
-- 刷新显示 -- 刷新显示
self:RefreshShow() self:RefreshShow()
end) end)
@ -354,13 +357,8 @@ function WeekCardPanel:ShowCardInfo(index,config)
end) end)
end) end)
end end
end end
function WeekCardPanel:SetCardShow(index, data) function WeekCardPanel:SetCardShow(index, data)
local pre = self.cardPres[index] local pre = self.cardPres[index]
if not pre then if not pre then
@ -448,10 +446,11 @@ function WeekCardPanel:OnClose()
CheckRedPointStatus(RedPointType.WeekCardOpen) CheckRedPointStatus(RedPointType.WeekCardOpen)
CheckRedPointStatus(RedPointType.WeekCardReward) CheckRedPointStatus(RedPointType.WeekCardReward)
end end
--界面销毁时调用(用于子类重写) --界面销毁时调用(用于子类重写)
function WeekCardPanel:OnDestroy() function WeekCardPanel:OnDestroy()
self.spLoader:Destroy() self.spLoader:Destroy()
self.cardPres = {} self.cardPres = {}
end end
return WeekCardPanel
return WeekCardPanel