|
@ -8,6 +8,7 @@ import { |
|
|
Image, |
|
|
Image, |
|
|
Animated, |
|
|
Animated, |
|
|
Dimensions, |
|
|
Dimensions, |
|
|
|
|
|
Pressable, |
|
|
} from 'react-native'; |
|
|
} from 'react-native'; |
|
|
import YooForumTopic from '../component/YooForumTopic'; |
|
|
import YooForumTopic from '../component/YooForumTopic'; |
|
|
import YooReply from './YooReply'; |
|
|
import YooReply from './YooReply'; |
|
@ -43,6 +44,10 @@ const styles = StyleSheet.create({ |
|
|
indicator: { |
|
|
indicator: { |
|
|
marginTop: 64, |
|
|
marginTop: 64, |
|
|
}, |
|
|
}, |
|
|
|
|
|
showMoreText: { |
|
|
|
|
|
fontSize: 18, |
|
|
|
|
|
margin: 8, |
|
|
|
|
|
}, |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
function ForumTopic(props) { |
|
|
function ForumTopic(props) { |
|
@ -56,6 +61,20 @@ function ForumTopic(props) { |
|
|
)); |
|
|
)); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function ShowMore(props) { |
|
|
|
|
|
return ( |
|
|
|
|
|
<Pressable |
|
|
|
|
|
style={{width: screenWidth, alignItems: 'center'}} |
|
|
|
|
|
onPress={() => props.getTopicList()}> |
|
|
|
|
|
{props.gettingTopicList ? ( |
|
|
|
|
|
<Text style={styles.showMoreText}>加载中</Text> |
|
|
|
|
|
) : ( |
|
|
|
|
|
<Text style={styles.showMoreText}>加载更多</Text> |
|
|
|
|
|
)} |
|
|
|
|
|
</Pressable> |
|
|
|
|
|
); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
export default class YooForumUI extends Component { |
|
|
export default class YooForumUI extends Component { |
|
|
constructor(props) { |
|
|
constructor(props) { |
|
|
super(props); |
|
|
super(props); |
|
@ -145,11 +164,17 @@ export default class YooForumUI extends Component { |
|
|
this.setState({currentPosition: event.nativeEvent.contentOffset.y}) |
|
|
this.setState({currentPosition: event.nativeEvent.contentOffset.y}) |
|
|
}> |
|
|
}> |
|
|
{this.props.hint === '' ? ( |
|
|
{this.props.hint === '' ? ( |
|
|
|
|
|
<View> |
|
|
<ForumTopic |
|
|
<ForumTopic |
|
|
topics={this.props.topics} |
|
|
topics={this.props.topics} |
|
|
showDetail={this.showDetail} |
|
|
showDetail={this.showDetail} |
|
|
hideDetail={this.hideDetail} |
|
|
hideDetail={this.hideDetail} |
|
|
/> |
|
|
/> |
|
|
|
|
|
<ShowMore |
|
|
|
|
|
getTopicList={this.props.getTopicList} |
|
|
|
|
|
gettingTopicList={this.props.gettingTopicList} |
|
|
|
|
|
/> |
|
|
|
|
|
</View> |
|
|
) : ( |
|
|
) : ( |
|
|
<View style={styles.hintContainer}> |
|
|
<View style={styles.hintContainer}> |
|
|
<Image |
|
|
<Image |
|
|