Authored by 孙凯

当所有亲求都结速的时候才刷新页面 review by hongmo

@@ -150,11 +150,11 @@ export default class Detail extends Component { @@ -150,11 +150,11 @@ export default class Detail extends Component {
150 detailOtherArticle: [otherArticle], 150 detailOtherArticle: [otherArticle],
151 }; 151 };
152 152
153 - let isFetching = content.isFetching; 153 + let isFetching = content.isFetching || article.isFetching || author.isFetching;
154 154
155 return ( 155 return (
156 <View style={styles.container}> 156 <View style={styles.container}>
157 - <ListView 157 + {!isFetching?<ListView
158 ref={(ref)=>this.listView=ref} 158 ref={(ref)=>this.listView=ref}
159 contentContainerStyle={styles.contentContainer} 159 contentContainerStyle={styles.contentContainer}
160 enableEmptySections={true} 160 enableEmptySections={true}
@@ -162,7 +162,7 @@ export default class Detail extends Component { @@ -162,7 +162,7 @@ export default class Detail extends Component {
162 dataSource={this.dataSource.cloneWithRowsAndSections(dataSource)} 162 dataSource={this.dataSource.cloneWithRowsAndSections(dataSource)}
163 renderRow={this.renderRow} 163 renderRow={this.renderRow}
164 renderHeader={this.renderHeader} 164 renderHeader={this.renderHeader}
165 - /> 165 + />:null}
166 <LoadingIndicator 166 <LoadingIndicator
167 isVisible={isFetching} 167 isVisible={isFetching}
168 /> 168 />
@@ -48,19 +48,20 @@ export default class Header extends React.Component { @@ -48,19 +48,20 @@ export default class Header extends React.Component {
48 48
49 let author_data = author.get('data'); 49 let author_data = author.get('data');
50 let article_data = article.get('data'); 50 let article_data = article.get('data');
  51 + let hasData = true;
51 if (!author_data || !article_data) { 52 if (!author_data || !article_data) {
52 - return null; 53 + hasData = false;
53 } 54 }
54 55
55 - let author_desc = author_data.get('author_desc');  
56 - let author_avatar = author_data.get('avatar');  
57 - let author_name = author_data.get('name');  
58 - let author_url = author_data.get('url'); 56 + let author_desc = hasData?author_data.get('author_desc'):'';
  57 + let author_avatar = hasData?author_data.get('avatar'):'';
  58 + let author_name = hasData?author_data.get('name'):'';
  59 + let author_url = hasData?author_data.get('url'):'';
59 let num = this.getStrSize(author_desc); 60 let num = this.getStrSize(author_desc);
60 61
61 - let article_title = article_data.get('article_title');  
62 - let pageViews = article_data.get('pageViews');  
63 - let publishTime = article_data.get('publishTime'); 62 + let article_title = hasData?article_data.get('article_title'):'';
  63 + let pageViews = hasData?article_data.get('pageViews'):'99999';
  64 + let publishTime = hasData?article_data.get('publishTime'):'12月12日 12:00';
64 return( 65 return(
65 <View style={styles.contentContainer}> 66 <View style={styles.contentContainer}>
66 <TouchableOpacity activeOpacity={0.5} onPress={() => { 67 <TouchableOpacity activeOpacity={0.5} onPress={() => {