MessageManager = class("MessageManager"); function MessageManager:ctor() end function MessageManager:init() if app.php.activityRedPoint then --活动数据处理 app.php.activityRedPoint.tasks.count = 0 for k,v in pairs(NOTICE_REDPOINT) do local value = app.php.activityRedPoint.tasks[v] if value == 1 then app.php.activityRedPoint.tasks.count = app.php.activityRedPoint.tasks.count + 1 end end --dump(app.php.activityRedPoint,"initMessageManager") end end --[[ 一维红点key传空,name传对应的红点字段 多维红点key,name都需要传 ]] function MessageManager:removeMsg(key,name) --本地内存数据改变 if app.php.activityRedPoint then if key then if app.php.activityRedPoint[key][name] and app.php.activityRedPoint[key][name] == 0 then return end app.php.activityRedPoint[key][name] = 0 if app.php.activityRedPoint[key].count then app.php.activityRedPoint[key].count = app.php.activityRedPoint[key].count - 1 if app.php.activityRedPoint[key].count <= 0 then app.php.activityRedPoint[key].count = 0; end end else app.php.activityRedPoint[name] = 0 end --dump(app.php.activityRedPoint,"removeMsgMessageManager") end --服务器数据发送 app.php:requestReadRedPoint(name) end return MessageManager