|
@@ -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)
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
}
|
|
|
|