Authored by 于良

消息中心主页面 review by days

... ... @@ -32,20 +32,29 @@ export default class Message extends Component {
}
_renderRow(rowData: object, sectionID: number, rowID: number) {
return null;
return (
<TouchableOpacity
onPress={() => {
console.log(rowID)
}}
>
<View style={styles.rowContainer}>
<Text>{rowData.get('title')}</Text>
<Text>{rowData.get('detail')}</Text>
</View>
</TouchableOpacity>
);
}
render() {
let dataSource = [];
let dataSource = this.props.data.dataSource.toArray();
return (
<View style={styles.container}>
<ListView
ref={(c) => {
this.listView = c;
}}
contentContainerStyle={styles.contentContainer}
dataSource={this.dataSource.cloneWithRows(dataSource)}
renderRow={this._renderRow}
... ... @@ -66,4 +75,7 @@ let styles = StyleSheet.create({
contentContainer: {
},
rowContainer: {
},
});
... ...
... ... @@ -48,7 +48,6 @@ class MessageContainer extends Component {
super(props);
this._onRefresh = this._onRefresh.bind(this);
this._onEndReached = this._onEndReached.bind(this);
}
... ... @@ -65,10 +64,6 @@ class MessageContainer extends Component {
}
_onEndReached() {
}
render() {
let {message} = this.props;
return (
... ... @@ -76,7 +71,6 @@ class MessageContainer extends Component {
<Message
data={message}
onRefresh={this._onRefresh}
onEndReached={this._onEndReached}
/>
</View>
);
... ...
'use strict';
import {Record, List, Map} from 'immutable';
import Immutable, {Record, List, Map} from 'immutable';
let InitialState = Record({
let dataSource = Immutable.fromJS([
{
id: 'member',
title: '会员信息',
detail: '会员等级变更提醒、会员生日福利',
},
{
id: 'asset',
title: '我的资产',
detail: '新注册用户提示新人专享优惠券信息',
},
{
id: 'customer',
title: '客户服务',
detail: '没有收到任何关于你的消息',
},
{
id: 'other',
title: '其他',
detail: '没有收到任何系统给消息',
},
]);
let InitialState = Record({
dataSource,
newMessage: new (Record({
isFetching: false,
error: null,
data: List(),
})),
});
export default InitialState;
... ...