公会福利红包修改提交

dev_chengFeng
wangzhenxing 2021-05-25 14:52:02 +08:00
parent 42b6dd4d7a
commit 69d0f3ab39
8 changed files with 21 additions and 13 deletions

View File

@ -262,6 +262,7 @@ function this.ChatDataAdapter(channel, data)
-- newChat.multiple = 1
GuildRedPacketManager.isCheck = true
MyGuildManager.PackageNum=MyGuildManager.PackageNum+1
CheckRedPointStatus(RedPointType.Guild_RedPacket)
CheckRedPointStatus(RedPointType.Guid_GetPackage)
end

View File

@ -189,6 +189,8 @@ function GuildInfoPopup:BindEvent()
MyGuildManager.RequestQuitGuild(function()
this:ClosePanel()
GuildManager.RefreshGuildAllRedState()
MyGuildManager.PackageNum=0
CheckRedPointStatus(RedPointType.Guid_GetPackage)
UIManager.OpenPanel(UIName.MainPanel)
end)
end)

View File

@ -215,11 +215,11 @@ function MyGuildManager.SetMyGuidRedPackage(data)
local list={}
if data then
for key, value in pairs(data) do
if value.id then
if value.id and value.num then
LogError(" package id =="..value.id.." num=="..value.num)
local data={}
data.num=value.num
list[value.id]=data
local aaa={}
aaa.num=value.num
list[value.id]=aaa
end
end
end
@ -424,6 +424,8 @@ function MyGuildManager.RequestQuitGuild(func)
this.MyGuildMemList = {}
this.MyGuildApplyList = {}
this.MyGuildLogList = {}
this.MyGuidRedPackage={}
this.PackageNum=0
if func then func() end
-- 退出公会成功事件
Game.GlobalEvent:DispatchEvent(GameEvent.Guild.OnQuitGuild)

View File

@ -16,11 +16,11 @@ function this.CheckGuildRedPacketRedPoint()
-- else
-- return false
-- end
LogError("检测发红包红点")
local list=MyGuildManager.GetMyGuidRedPackage()
if list then
LogRed("检测发红包红点")
for key, value in pairs(list) do
if value.num>0 then
if value and value.num and value.num>0 then
return true
end
end

View File

@ -78,13 +78,13 @@ function this.InitView(redId,id)
index=4
end
this.title.sprite=Util.LoadSprite(RedPacketName[index])
LogError("BaseType=="..config.BaseType)
if config.BaseType==1 then
this.titleTip.text=GetLanguageStrById(config.SendWord)
elseif config.BaseType==2 then
this.titleTip.text=GetLanguageStrById(config.RuleDes)
end
this.title.sprite=this.spLoader:LoadSprite(RedPacketName[index])
this.titleTip.text=GetLanguageStrById(config.SendWord)
NetManager.GetRedPackageDetailRequest(redId,function(msg)
-- logWarnTrance(TimeToDHMS(msg.remainTime))
-- for k,v in ipairs(msg.info) do

View File

@ -5,7 +5,7 @@ local sortingOrder=0
local RedPacketName={"g_ghhb_ming_01_zh","g_ghhb_ming_02_zh","g_ghhb_ming_03_zh","g_ghhb_ming_04_zh"}
--红包按钮状态图片
local BtnStateImage={"g_ghhb_qiang_zh","g_ghhb_lingqu_zh","g_ghhb_lingwan_zh"}--抢 已领取 已领完
local SpecialConfig=ConfigManager.GetConfigData(ConfigName.SpecialConfig,115)
function this:InitComponent(gameObject)
this.spLoader = SpriteLoader.New()
@ -72,7 +72,6 @@ function this:InitGetView()
for i,v in ipairs(msg.info) do
table.insert(data,v)
end
LogError("len=========="..LengthOfTable(data))
this:DataSort(data)
dataLength=#msg.info
@ -88,7 +87,7 @@ function this:InitGetView()
if value.isGet==0 and (config.Num-value.getCount)>0 and isAuto then
if config.BaseType~=2 or PlayerManager.dailyRedPack< tonumber(SpecialConfig.Value) then
isAuto=false
LogError("redid============"..value.redId)
--LogError("redid============"..value.redId)
NetManager.GetRobRedPackageRequest(value.redId,function(msg)
local success=msg.isSuccess
local itemId=msg.itemId
@ -121,7 +120,6 @@ end
function this:SetView(root,data)
LogError("-------------------")
local nameImage=Util.GetGameObject(root,"NameImage"):GetComponent("Image")--红包名
local fromPlayer=Util.GetGameObject(root,"FromPlayer"):GetComponent("Text")--红包来自玩家名
local getBtn=Util.GetGameObject(root,"GetBtn")--抢红包按钮
@ -166,6 +164,10 @@ function this:SetView(root,data)
getBtnImage:SetNativeSize()
Util.AddOnceClick(getBtn,function()
if data.redType>3 and PlayerManager.dailyRedPack>=tonumber(SpecialConfig.Value) then
PopupTipPanel.ShowTip("今日福利红包抢夺次数到达上限!")
return
end
NetManager.GetRobRedPackageRequest(redId,function(msg)
local success=msg.isSuccess
local itemId=msg.itemId
@ -173,7 +175,6 @@ function this:SetView(root,data)
if success==1 then--红包抢成功
local itemName=GetLanguageStrById(ConfigManager.GetConfigData(ConfigName.ItemConfig,itemId).Name)
UIManager.OpenPanel(UIName.RedPacketPopup,redId,data.redType)
--红包类型大于3的是福利红包
if data.redType>3 then
PlayerManager.SettDailyRedPackageTime(PlayerManager.dailyRedPack+1)
end

View File

@ -262,6 +262,7 @@ function this.RechargeSuccessFunc(id)
this.SetInfo(curIndex)
--PopupTipPanel.ShowTip(string.format( Language[11051],GetLanguageStrById(redpack.Name)))
ChatManager.RequestSendRedPacket(curIndex)
--MyGuildManager.ReuqsetRedPackage()
CheckRedPointStatus(RedPointType.Guid_GetPackage)
end

View File

@ -89,6 +89,7 @@ end)
this.scrollView:SetData(showList,function(index,root)
this:ShowItemInfo(root,showList[index])
end)
CheckRedPointStatus(RedPointType.Guid_SendPackage)
end
--显示红包数据
function this:ShowItemInfo(go,data)
@ -115,7 +116,7 @@ function this:ShowItemInfo(go,data)
PopupTipPanel.ShowTip("成功发送福利红包!")
this:InitView()
--刷新发送福利红包按钮红点
CheckRedPointStatus(RedPointType.Guid_SendPackage)
CheckRedPointStatus(RedPointType.Guid_GetPackage)
MyGuildManager.ReuqsetRedPackage(function()
CheckRedPointStatus(RedPointType.Guid_GetPackage)
end)