From a38670f4c5f4849952158f9f252901e9cb7a2a23 Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Tue, 27 Jun 2023 14:38:03 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BE=8E=E9=A3=9F=E5=9F=8E=E5=9B=BE=E9=89=B4?= =?UTF-8?q?=E7=BA=A2=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- comm/const.go | 3 +++ modules/gourmet/model_food.go | 12 ++++++++++++ modules/gourmet/module.go | 12 +++++++++++- 3 files changed, 26 insertions(+), 1 deletion(-) diff --git a/comm/const.go b/comm/const.go index ba1b97067..fa30474e2 100644 --- a/comm/const.go +++ b/comm/const.go @@ -486,6 +486,9 @@ const ( Reddot24101 ReddotType = 24101 // 主线章节有奖励没领取 // 好友 Reddot21101 ReddotType = 21101 //当好友申请存在时,一级位置:好友界面左边申请列表图标上右上角位置 当好友申请处理完红点消失 + + //23101 烹饪 + Reddot23101 ReddotType = 23101 // 烹饪奖励菜谱图鉴图标 ) type TaskType int32 diff --git a/modules/gourmet/model_food.go b/modules/gourmet/model_food.go index 4a64b9e98..38c807720 100644 --- a/modules/gourmet/model_food.go +++ b/modules/gourmet/model_food.go @@ -44,3 +44,15 @@ func (this *modelAtlas) getGourmetAtlasList(uid string) (result *pb.DBGourmetAtl func (this *modelAtlas) modifyGourmetAtlasByObjId(uid string, data map[string]interface{}) error { return this.Change(uid, data) } + +// 美食城图鉴红点 +func (this *modelAtlas) checkReddot2301(uid string) bool { + if rst, err := this.getGourmetAtlasList(uid); err == nil { + for _, v := range rst.Atlas { + if v == -1 { + return true + } + } + } + return false +} diff --git a/modules/gourmet/module.go b/modules/gourmet/module.go index 22aea7359..c8fca7e6a 100644 --- a/modules/gourmet/module.go +++ b/modules/gourmet/module.go @@ -44,7 +44,17 @@ func (this *Gourmet) OnInstallComp() { //红点查询 func (this *Gourmet) Reddot(session comm.IUserSession, rid ...comm.ReddotType) (reddot map[comm.ReddotType]*pb.ReddotItem) { - + reddot = make(map[comm.ReddotType]*pb.ReddotItem) + for _, v := range rid { + switch v { + case comm.Reddot23101: // 铁匠铺手册台 + reddot[comm.Reddot23101] = &pb.ReddotItem{ + Rid: int32(comm.Reddot23101), + Activated: this.modelAtlas.checkReddot2301(session.GetUserId()), + } + break + } + } return }