diff --git a/src/component/notification/notification.js b/src/component/notification/notification.js index 3fcf748..4b4f028 100644 --- a/src/component/notification/notification.js +++ b/src/component/notification/notification.js @@ -63,7 +63,7 @@ export default class Notification extends Component { } renderLike(msg) { - const body = `${msg.content.user.name} 给了你一个创可贴`; + const body = `${msg.content.user.name} 给了你一个OK绷`; return ( this.props.onLikePress(msg)}> @@ -99,8 +99,8 @@ const localStyle = StyleSheet.create({ lineHeight: 20 }, icon2: { - width: 14, - height: 14, + width: 15, + height: 15, marginRight: 10, marginTop: 4, }, diff --git a/src/component/notification/notificationList.js b/src/component/notification/notificationList.js index 340e6f8..340e4c8 100644 --- a/src/component/notification/notificationList.js +++ b/src/component/notification/notificationList.js @@ -33,9 +33,10 @@ export default class NotificationList extends Component { (async () => { try { - let notifications = await this.getMessages() + let notifications = await this.getMessages(); this.notificationsData = notifications; this.setNotifications(notifications); + this.props.onRefreshed && this.props.onRefreshed(notifications.length); } catch (e) { this.setState({error: true}); } diff --git a/src/page/NotificationPage.js b/src/page/NotificationPage.js index bc9b85f..768749c 100644 --- a/src/page/NotificationPage.js +++ b/src/page/NotificationPage.js @@ -152,9 +152,21 @@ export default class NotificationPage extends Component { _onRefresh() { + console.log(this.props.componentId); this.restartTipTimer().done(); } + _onRefreshed(msgCount) { + if(msgCount > 99) { + msgCount = 99; + } + Navigation.mergeOptions(this.props.componentId, { + bottomTab: { + badge: msgCount > 0 ? msgCount.toString() : null, + } + }); + } + refresh() { if(this.list) { this.list.refresh(false); @@ -172,6 +184,7 @@ export default class NotificationPage extends Component { {this.list = r}} isHistory={false} onRefresh={this._onRefresh.bind(this)} + onRefreshed={this._onRefreshed.bind(this)} isSetRead={true} {...this.props}/>