diff --git a/src/component/notification/notification.js b/src/component/notification/notification.js
new file mode 100644
index 0000000..81def5a
--- /dev/null
+++ b/src/component/notification/notification.js
@@ -0,0 +1,40 @@
+import React, {Component} from 'react';
+import {StyleSheet, Text, View} from 'react-native';
+import Ionicons from 'react-native-vector-icons/Ionicons';
+
+import Touchable from '../touchable';
+import Color from '../../style/color'
+
+
+export default class Notification extends Component {
+
+ render() {
+ return (
+ {}}>
+
+
+ {'XXX 回复了你|关注了你'}
+
+
+ );
+ }
+}
+
+const localStyle = StyleSheet.create({
+ container: {
+ padding: 20,
+ borderColor: Color.line,
+ borderBottomWidth: StyleSheet.hairlineWidth,
+ flexDirection: 'row'
+ },
+ icon: {
+ marginRight: 10,
+ marginTop: 1,
+ lineHeight: 20
+ },
+ text: {
+ flex: 1,
+ lineHeight: 20
+ }
+});
\ No newline at end of file
diff --git a/src/component/notification/notificationList.js b/src/component/notification/notificationList.js
new file mode 100644
index 0000000..b7d11f9
--- /dev/null
+++ b/src/component/notification/notificationList.js
@@ -0,0 +1,66 @@
+import React, {Component} from 'react';
+import {StyleSheet, Text, View, FlatList, InteractionManager} from 'react-native';
+
+import Api from '../../util/api';
+import Notification from './notification';
+
+
+export default class NotificationList extends Component {
+
+ constructor(props) {
+ super(props);
+
+ this.state = {
+ notifications: [],
+ refreshing: false
+ };
+ }
+
+ componentDidMount(){
+ InteractionManager.runAfterInteractions(() => {
+ this.refresh();
+ });
+ }
+
+ refresh() {
+ this.setState({refreshing: true});
+ Api.getMessagesHistory()
+ .then(notifications => {
+ console.log('notifications:', notifications);
+
+ this.setState({
+ notifications
+ });
+
+ }).done(() => {
+ this.setState({refreshing: false});
+ });
+ }
+
+ render() {
+ let hasData = this.state.notifications && this.state.notifications.length > 0;
+ return hasData ? (
+ {
+ return item.id ? item.id.toString() : index
+ }}
+
+ renderItem={({item}) => {
+ return (
+
+ );
+ }}
+
+ refreshing={this.state.refreshing}
+ onRefresh={this.refresh.bind(this)}
+
+ />
+ ) : null;
+ }
+}
+
+const localStyle = StyleSheet.create({
+
+});
\ No newline at end of file
diff --git a/src/page/NotificationHistoryPage.js b/src/page/NotificationHistoryPage.js
new file mode 100644
index 0000000..627c4bd
--- /dev/null
+++ b/src/page/NotificationHistoryPage.js
@@ -0,0 +1,41 @@
+import React, {Component} from 'react';
+import {Platform, StyleSheet, Text, View} from 'react-native';
+import {Navigation} from 'react-native-navigation';
+
+import Color from '../style/color';
+import {Icon} from '../style/icon';
+
+import NotificationList from '../component/notification/notificationList';
+
+
+export default class NotificationHistoryPage extends Component {
+
+ constructor(props) {
+ super(props);
+ Navigation.events().bindComponent(this);
+ }
+
+ static options(passProps) {
+ return {
+ topBar: {
+ title: {
+ text: '提醒历史'
+ }
+ }
+ };
+ }
+
+ render() {
+ return (
+
+
+
+ );
+ }
+}
+
+const localStyle = StyleSheet.create({
+ container: {
+ flex: 1
+ }
+});
diff --git a/src/page/NotificationPage.js b/src/page/NotificationPage.js
index d4dfac7..0b6897e 100644
--- a/src/page/NotificationPage.js
+++ b/src/page/NotificationPage.js
@@ -1,33 +1,62 @@
import React, {Component} from 'react';
import {Platform, StyleSheet, Text, View} from 'react-native';
+import {Button} from 'react-native-elements'
+import {Navigation} from 'react-native-navigation';
+
+import Color from '../style/color'
+import {Icon} from '../style/icon'
-export default class NotifyPage extends Component {
+export default class NotificationPage extends Component {
+
+ constructor(props) {
+ super(props);
+ Navigation.events().bindComponent(this);
+ }
+
+ static options(passProps) {
+ return {
+ topBar: {
+ title: {
+ text: '提醒'
+ },
+ rightButtons: [{
+ id: 'history',
+ icon: Icon.navButtonTime,
+
+ color: '#aaa' // android
+ }]
+ }
+ };
+ }
+
+ navigationButtonPressed({buttonId}) {
+ Navigation.push(this.props.componentId, {
+ component: {
+ name: 'NotificationHistory'
+ }
+ });
+ }
render() {
return (
-
- Notify Page !
-
+
+ 没有内容
+
);
}
}
-const styles = StyleSheet.create({
- container: {
- flex: 1,
- justifyContent: 'center',
- alignItems: 'center',
- backgroundColor: '#F5FCFF',
- },
- welcome: {
- fontSize: 20,
- textAlign: 'center',
- margin: 10,
- },
- instructions: {
- textAlign: 'center',
- color: '#333333',
- marginBottom: 5,
- },
+const localStyle = StyleSheet.create({
+ container: {
+ alignItems:'center',
+ justifyContent: 'center',
+ height: '100%'
+ },
+ text: {
+ paddingBottom: 15,
+ color: Color.text
+ }
});
diff --git a/src/page/_list.js b/src/page/_list.js
index 3172c7a..40162b7 100644
--- a/src/page/_list.js
+++ b/src/page/_list.js
@@ -4,6 +4,7 @@ Follow: require("./FollowPage.js").default,
FollowUser: require("./FollowUserPage.js").default,
Home: require("./HomePage.js").default,
NotebookDetail: require("./NotebookDetailPage.js").default,
+NotificationHistory: require("./NotificationHistoryPage.js").default,
Notification: require("./NotificationPage.js").default,
User: require("./UserPage.js").default,
Write: require("./WritePage.js").default
diff --git a/src/util/api.js b/src/util/api.js
index b636a22..2f2afd4 100644
--- a/src/util/api.js
+++ b/src/util/api.js
@@ -92,13 +92,18 @@ async function getNotebookDiaries(id, page, page_size) {
}
async function getSelfInfoByStore() {
- return await TokenManager.getUserInfo();
+ return await TokenManager.getUserInfo();
}
async function getUserTodayDiaries(userId) {
- return call('GET', '/users/' + userId + '/diaries/')
+ return call('GET', '/users/' + userId + '/diaries/');
}
+async function getMessagesHistory() {
+ return call('GET', '/tip/history');
+}
+
+
async function call(method, api, body, _timeout = 10000) {
let token = await TokenManager.getUserToken();
@@ -197,5 +202,7 @@ export default {
getSelfNotebooks,
getRelationUsers,
- getRelationReverseUsers
+ getRelationReverseUsers,
+
+ getMessagesHistory
}
\ No newline at end of file