From 2235f5d95f860b2d46897c1ff1e8d8c02bcd8ff4 Mon Sep 17 00:00:00 2001 From: wushenghua Date: Tue, 23 Feb 2016 16:54:27 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96listview?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Collect.js | 4 +--- MyListView.js | 10 ++++------ MyListViewDemo.js | 9 +++------ lib/MainNavigator.js | 1 - 4 files changed, 8 insertions(+), 16 deletions(-) diff --git a/Collect.js b/Collect.js index 7b5d54f..62ccece 100644 --- a/Collect.js +++ b/Collect.js @@ -119,8 +119,6 @@ getInitialState: function() { ); }, pushInfo:function(index){ - console.log(this.state.dataSource.getRowData(0,index)) - this.props.navigator.push({ title: 'New Page', component: @@ -129,7 +127,7 @@ getInitialState: function() { renderLoadingView:function(){ if (!this.state.isLoadingFail) { return ( - this.fetchData()} style={styles.container} > + this.fetchData} style={styles.container} > {'点击刷新'} diff --git a/MyListView.js b/MyListView.js index 141b5ca..9d3f925 100644 --- a/MyListView.js +++ b/MyListView.js @@ -60,8 +60,6 @@ export default class MyListView extends Component{ myfetchData(){ this.setState({isLoading:true,isLoadingFail:false}); this.props.fetchData().then((responseData)=>{ - console.log('接受到数据'); - console.log(responseData); this.setState({ isLoading: false, isLoadingFail: false, @@ -104,13 +102,13 @@ export default class MyListView extends Component{ pushInfo(index){ this.props.navigator.push({ title: 'New Page', - component: - }).bind(this); + component: + }); } renderLoadingView(){ if (this.state.isLoadingFail) { return ( - this.myfetchData.bind(this)} style={styles.container} > + this.myfetchData()} style={styles.container} > {'点击刷新'} @@ -141,7 +139,7 @@ export default class MyListView extends Component{ return ( - this.pushInfo.bind(this)} style={styles.container} > + {this.pushInfo(rowID)}} style={styles.container} > diff --git a/MyListViewDemo.js b/MyListViewDemo.js index 09003e4..6d38267 100644 --- a/MyListViewDemo.js +++ b/MyListViewDemo.js @@ -39,10 +39,7 @@ export default class MyListViewDemo extends Component{ 随机 - ), - event: function() { - this.fetchData(); - }.bind(this) + ) } }) } @@ -59,7 +56,7 @@ export default class MyListViewDemo extends Component{ fetch(url) .then((response) => response.json()) .catch((error) => { - reject(err); + reject(error); }) .then((responseData) => { if(responseData){ @@ -82,7 +79,7 @@ export default class MyListViewDemo extends Component{ ); } diff --git a/lib/MainNavigator.js b/lib/MainNavigator.js index 94e594c..f092125 100644 --- a/lib/MainNavigator.js +++ b/lib/MainNavigator.js @@ -128,7 +128,6 @@ class TabBarNavigator extends Component { }; } setNavItems(config) { - console.log('setting nav items. currentTabIndex: ' + this.currentTabIndex); if (this.currentRoute.isRoot) { this.rootNavigatorItems[this.state.currentTabIndex] = config; this.forceUpdate();