future 1 年間 前
コミット
2be089107e

+ 5 - 5
assets/resources/ui/home.prefab

@@ -149,7 +149,7 @@
     "_contentSize": {
       "__type__": "cc.Size",
       "width": 1080,
-      "height": 1920
+      "height": 1920.0000000000002
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",
@@ -296,7 +296,7 @@
     "_lpos": {
       "__type__": "cc.Vec3",
       "x": 0,
-      "y": 285,
+      "y": 285.0000000000001,
       "z": 0
     },
     "_lrot": {
@@ -4038,7 +4038,7 @@
     "_lpos": {
       "__type__": "cc.Vec3",
       "x": 0,
-      "y": -960,
+      "y": -960.0000000000001,
       "z": 0
     },
     "_lrot": {
@@ -12409,7 +12409,7 @@
     "_lpos": {
       "__type__": "cc.Vec3",
       "x": 0,
-      "y": 145,
+      "y": 145.0000000000001,
       "z": 0
     },
     "_lrot": {
@@ -15271,7 +15271,7 @@
     "_contentSize": {
       "__type__": "cc.Size",
       "width": 1080,
-      "height": 1920
+      "height": 1920.0000000000002
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",

+ 3 - 3
assets/script/config.ts

@@ -150,9 +150,7 @@ export class config  {
         GET_NEW_CAR:"get_new_car",
         UPDATE_USER_DEFAULT_CAR:"update_user_default_car",
         UPDATE_USER_INFO:"update_user_info",
-        UPDATE_SIGN_RED_DOT_STATUS:"update_sign_red_dot_status",
-        UPDATE_MAIL_RED_DOT_STATUS:"update_mail_red_dot_status",
-        UPDATE_ANNOUNCEMENT_RED_DOT_STATUS:"update_announcement_red_dot_status",
+        UPDATE_RED_DOT_STATUS:"update_red_dot_status",
     }
     
     public static EVENT_TYPE = {
@@ -205,6 +203,8 @@ export class config  {
 
     public static RED_DOT_TYPE = {
         announcement:1,   //公告
+        sign:101,         //签到
+        mail:102,         //邮件
     }
 }
 

+ 1 - 1
assets/script/ui/announcement.ts

@@ -64,7 +64,7 @@ export class announcement extends base_ui {
         }
         GameManager.requestUserSetReadRedDot(config.RED_DOT_TYPE.announcement, ()=>{
             tools.user_red_dot_data.bulletin_red_dot = 0
-            ClientEvent.dispatchEvent(config.UI_EVENT.UPDATE_ANNOUNCEMENT_RED_DOT_STATUS)
+            ClientEvent.dispatchEvent(config.UI_EVENT.UPDATE_RED_DOT_STATUS,config.RED_DOT_TYPE.announcement)
         })
     }
 }

+ 40 - 27
assets/script/ui/home/home.ts

@@ -34,9 +34,7 @@ export class home extends Component {
         ClientEvent.on(config.UI_EVENT.GET_NEW_CAR,this.onGetNewCar.bind(this),this)
         ClientEvent.on(config.UI_EVENT.UPDATE_USER_DEFAULT_CAR,this.onUpdateUserDefaultCar.bind(this),this)
         ClientEvent.on(config.UI_EVENT.UPDATE_USER_INFO,this.onUpdateUserInfo.bind(this),this)
-        ClientEvent.on(config.UI_EVENT.UPDATE_SIGN_RED_DOT_STATUS,this.onUpdateSignRedDotStatus.bind(this),this)
-        ClientEvent.on(config.UI_EVENT.UPDATE_MAIL_RED_DOT_STATUS,this.onUpdateMailRedDotStatus.bind(this),this)
-        ClientEvent.on(config.UI_EVENT.UPDATE_ANNOUNCEMENT_RED_DOT_STATUS,this.onUpdateAnnouncementRedDotStatus.bind(this),this)
+        ClientEvent.on(config.UI_EVENT.UPDATE_RED_DOT_STATUS,this.onUpdateRedDotStatus.bind(this),this)
         ClientEvent.on(config.EVENT_TYPE.MSG_DATA,this.onMsgData.bind(this),this)
     }
 
@@ -80,27 +78,19 @@ export class home extends Component {
         this.top.getComponent(home_top).reloadUserInfo()
     }
 
-    onUpdateSignRedDotStatus() {
-        if(tools.user_red_dot_data.sign_red_dot==1) {
-            this.modules.getComponent(home_modules).showRedDotQiandao(true)
-        } else {
-            this.modules.getComponent(home_modules).showRedDotQiandao(false)
-        }
-    }
-
-    onUpdateMailRedDotStatus() {
-        if(tools.user_red_dot_data.mail_unread_number>0) {
-            this.modules.getComponent(home_modules).showRedDotYoujian(true)
-        } else {
-            this.modules.getComponent(home_modules).showRedDotYoujian(false)
-        }
-    }
-
-    onUpdateAnnouncementRedDotStatus() {
-        if(tools.user_red_dot_data.bulletin_red_dot==1) {
-            this.modules.getComponent(home_modules).showRedDotGonggao(true)
-        } else {
-            this.modules.getComponent(home_modules).showRedDotGonggao(false)
+    onUpdateRedDotStatus(type:number) {
+        switch (type) {
+            case config.RED_DOT_TYPE.announcement:
+                this.updateAnnouncementRedDotStatus()
+                break;
+            case config.RED_DOT_TYPE.sign:
+                this.updateSignRedDotStatus()
+                break;
+            case config.RED_DOT_TYPE.mail:
+                this.updateMailRedDotStatus()
+                break;
+            default:
+                break;
         }
     }
 
@@ -123,16 +113,39 @@ export class home extends Component {
                 break;
             case config.MSG_TYPE.announcement:
                 tools.user_red_dot_data.bulletin_red_dot = msg.bulletin_red_dot
-                this.onUpdateAnnouncementRedDotStatus()
+                this.updateAnnouncementRedDotStatus()
                 break
             case config.MSG_TYPE.mail:
                 tools.user_red_dot_data.mail_unread_number = msg.mail_unread_number
-                this.onUpdateMailRedDotStatus()
+                this.updateMailRedDotStatus()
                 break
             default:
                 break;
+        }   
+    }
+
+    private updateAnnouncementRedDotStatus() {
+        if(tools.user_red_dot_data.bulletin_red_dot==1) {
+            this.modules.getComponent(home_modules).showRedDotGonggao(true)
+        } else {
+            this.modules.getComponent(home_modules).showRedDotGonggao(false)
+        }
+    }
+
+    private updateSignRedDotStatus() {
+        if(tools.user_red_dot_data.sign_red_dot==1) {
+            this.modules.getComponent(home_modules).showRedDotQiandao(true)
+        } else {
+            this.modules.getComponent(home_modules).showRedDotQiandao(false)
+        }
+    }
+
+    private updateMailRedDotStatus() {
+        if(tools.user_red_dot_data.mail_unread_number>0) {
+            this.modules.getComponent(home_modules).showRedDotYoujian(true)
+        } else {
+            this.modules.getComponent(home_modules).showRedDotYoujian(false)
         }
-        
     }
 }
 

+ 1 - 1
assets/script/ui/mailbox/mailbox.ts

@@ -182,7 +182,7 @@ export class mailbox extends base_ui {
         } else {
             tools.user_red_dot_data.mail_unread_number -=1
         }
-        ClientEvent.dispatchEvent(config.UI_EVENT.UPDATE_MAIL_RED_DOT_STATUS)
+        ClientEvent.dispatchEvent(config.UI_EVENT.UPDATE_RED_DOT_STATUS,config.RED_DOT_TYPE.mail)
     }
 
     // 删除邮件 stype 0:普通删除 1:一键删除

+ 1 - 1
assets/script/ui/sign_view/sign_view.ts

@@ -132,7 +132,7 @@ export class sign_view extends base_ui {
         
         if(is_sign_all) {
             tools.user_red_dot_data.sign_red_dot = 0
-            ClientEvent.dispatchEvent(config.UI_EVENT.UPDATE_SIGN_RED_DOT_STATUS)
+            ClientEvent.dispatchEvent(config.UI_EVENT.UPDATE_RED_DOT_STATUS,config.RED_DOT_TYPE.sign)
         }
     }