Authored by 张文文

内容消息空页面

... ... @@ -10,7 +10,6 @@ import LoadMoreIndicator from '../../../common/components/LoadMoreIndicator';
import ContentMessageTabView from "./ContentMessageTabView";
import ContentMessageCell from "./ContentMessageCell";
import ContentEmptyView from './ContentEmptyView'
import Prompt from '../../../common/components/Prompt';
export default class ContentMessageView extends Component {
... ... @@ -39,7 +38,7 @@ export default class ContentMessageView extends Component {
_renderHeader() {
let showStatus = this.props.contentTipFlag==='0' ? true : false;
let tabStatus = this.props.tabButtons.length===0 ? false : true;
let tabStatus = this.props.commentList.length===0 ? false : true;
function onNotifyPress() {
NativeModules.YH_CommonHelper.jumpToUpdateNotificationStatus();
... ... @@ -74,25 +73,28 @@ export default class ContentMessageView extends Component {
)
}
_renderFooter(){
_renderFooter() {
let emptyViewShow = this.props.commentList.length===0 ? true : false;
return (
<View style={[{height: 50}, {backgroundColor: 'white'}, {justifyContent:'center'}]}>
</View>
<View>
{ emptyViewShow && this.props.isFetching === false ?
<View style={styles.emptyView}>
<Image
style={styles.iconStyle}
source={require('../../images/message_empty_ic.png')}
/>
<Text style={styles.textStyle}>暂无更新的消息</Text>
</View>
:
<View style={[{height: 50}, {backgroundColor: 'white'}, {justifyContent:'center'}]}/> }
</View>
)
}
render() {
let {commentList, isPullToRefresh, shouldShowEmpty, tipMessage} = this.props;
if (shouldShowEmpty) {
return (
<View style={styles.container}>
<ContentEmptyView
listId={4}
/>
</View>
);
}
let {commentList, isPullToRefresh, tipMessage} = this.props;
return (
<View style={styles.container}>
... ... @@ -165,6 +167,7 @@ export default class ContentMessageView extends Component {
let {width} = Dimensions.get('window');
const ROW_COLUMN = 3
let scale = (width/375.0);
let styles = StyleSheet.create({
container: {
... ... @@ -244,4 +247,23 @@ let styles = StyleSheet.create({
height: 10
},
emptyView: {
flex: 1,
flexDirection: 'column',
justifyContent: 'center',
alignItems: 'center',
},
iconStyle: {
marginTop: Math.ceil(82*scale),
width: Math.ceil(96*scale),
height: Math.ceil(70*scale),
backgroundColor: 'transparent',
},
textStyle: {
marginTop: Math.ceil(28*scale),
color: '#444444',
backgroundColor: 'transparent',
fontSize: 15,
},
})
... ...
... ... @@ -24,7 +24,7 @@ function mapStateToProps(state) {
tabButtons: state.content.contentType.get('list').toJS(),
commentList: state.content.commentList.get('list').toJS(),
isPullToRefresh: state.content.commentList.get('isPullToRefresh'),
shouldShowEmpty: state.content.commentList.get('shouldShowEmpty'),
isFetching: state.content.commentList.get('isFetching'),
contentTipFlag: state.content.contentTipFlag,
tipMessage: state.content.tipMessage,
communityHost: state.app.communityHost,
... ... @@ -172,7 +172,7 @@ class ContentMessageContainer extends Component {
tabButtons,
commentList,
isPullToRefresh,
shouldShowEmpty
isFetching
} = this.props
return (
... ... @@ -185,8 +185,8 @@ class ContentMessageContainer extends Component {
tabButtons={tabButtons}
commentList={commentList}
isPullToRefresh={isPullToRefresh}
isFetching={isFetching}
tipMessage={tipMessage}
shouldShowEmpty={shouldShowEmpty}
onRefresh={this._onRefresh}
onEndReached={this._onEndReached}
onHiddenTipMessage={this._onHiddenTipMessage}
... ...