Authored by 于良

个人中心 bug fix review by 盖剑秋

... ... @@ -282,7 +282,7 @@ export default class Home extends React.Component {
if (endReached) {
return <LoadMoreIndicator
isVisible={true}
text={'没有更多啦'}
text={'暂无更多'}
/>
} else {
return <LoadMoreIndicator
... ...
... ... @@ -75,7 +75,7 @@ export default class LikeList extends React.Component {
if (endReached) {
return <LoadMoreIndicator
isVisible={true}
text={'没有更多啦'}
text={'暂无更多'}
/>
} else {
return <LoadMoreIndicator
... ...
... ... @@ -66,7 +66,7 @@ export default class LikeMessage extends React.Component {
if (endReached) {
return <LoadMoreIndicator
isVisible={true}
text={'没有更多啦'}
text={'暂无更多'}
/>
} else {
return <LoadMoreIndicator
... ...
... ... @@ -4,9 +4,7 @@ import React from 'react';
import ReactNative from 'react-native';
import ImmutablePropTypes from 'react-immutable-proptypes';
import SectionItem from '../home/SectionItem';
// import Thumbs from './Thumbs';
// import SectionItem from './SectionItem';
// import NumberButton from './NumberButton';
const {
View,
Text,
... ... @@ -47,14 +45,17 @@ export default class ReplyCell extends React.Component {
render() {
let data = this.props.data.toJS();
let {user, title, timeago, post, subTitle} = data;
let {user, title, timeago, post, subTitle, contentType} = data;
let postId = post.id;
let subTitleStyle = contentType == 1 ? null : {marginBottom: 15};
return (
<TouchableOpacity
activeOpacity={0.8}
activeOpacity={contentType == 1 ? 0.8 : 1}
onPress={() => {
this.props.onPressPost && this.props.onPressPost(postId);
if (contentType == 1) {
this.props.onPressPost && this.props.onPressPost(postId);
}
}}
>
<View style={styles.container}>
... ... @@ -66,13 +67,13 @@ export default class ReplyCell extends React.Component {
</View>
<View style={styles.middleContainer}>
<View style={[styles.middleContainer, subTitleStyle]}>
<Text style={styles.content}
numberOfLines={2}
>{subTitle}</Text>
</View>
<View style={styles.bottomContainer}>
{contentType == 1 ? <View style={styles.bottomContainer}>
<Image
defaultSource={require('../../images/message/duihuakuang.png')}
style={styles.bubble}
... ... @@ -93,7 +94,7 @@ export default class ReplyCell extends React.Component {
/>
</View>
</View>
</View> : null}
</View>
... ... @@ -107,22 +108,13 @@ export default class ReplyCell extends React.Component {
let styles = StyleSheet.create({
container: {
// flex:1,
// backgroundColor:'green',
flexDirection:'column',
// justifyContent:'center',
// alignItems:'center',
// height: 60,
// backgroundColor: 'yellow',
},
topContainer: {
// width: 60,
height: 60,
flexDirection: 'row',
padding: 15,
// justifyContent: 'center',
// backgroundColor:'yellow',
},
topRight: {
... ... @@ -132,22 +124,17 @@ let styles = StyleSheet.create({
},
name: {
// marginTop: 13,
fontFamily: 'Helvetica Light',
fontSize: 15,
// backgroundColor:'red',
},
timeago: {
fontFamily: 'Helvetica Light',
fontSize: 10,
// marginLeft:15,
color: '#b0b0b0',
// backgroundColor:'red',
},
middleContainer: {
// flex: 1,
backgroundColor:'white',
},
... ... @@ -156,50 +143,35 @@ let styles = StyleSheet.create({
marginRight: 15,
fontFamily: 'Helvetica Light',
fontSize: 14,
// backgroundColor:'red',
// height: 60,
},
bottomContainer: {
// flex:1,
// backgroundColor:'yellow',
height: 90,
// margin: 15,
marginLeft: 15,
marginRight: 15,
marginTop:0,
// marginBottom:15,
// padding: 15,
marginTop: 0,
},
bubble: {
// flex:1,
backgroundColor:'white',
flexDirection:'row',
// justifyContent: 'center',
alignItems:'center',
height:40,
padding:10,
height: 40,
padding: 10,
},
reply: {
// flex:1,
backgroundColor: 'transparent',
fontFamily: 'Helvetica Light',
fontSize: 12,
color: '#8b8b8b',
marginTop:8,
marginTop: 8,
},
section: {
flexDirection: 'row',
justifyContent: 'space-between',
marginTop: 15,
// backgroundColor:'red',
// marginBottom: 15,
},
... ...
... ... @@ -73,11 +73,9 @@ export default class SystemMessage extends React.Component {
);
}
_renderSeparator(sectionID,rowID) {
console.log('=====> ' + 'separator' + rowID) ;
_renderSeparator(sectionID, rowID) {
return (
<View key={'separator' + rowID} style={styles.separator}/>
<View key={'separator' + rowID} style={styles.separator}/>
);
}
... ... @@ -105,7 +103,7 @@ export default class SystemMessage extends React.Component {
if (endReached) {
return <LoadMoreIndicator
isVisible={true}
text={'没有更多啦'}
text={'暂无更多'}
/>
} else {
return <LoadMoreIndicator
... ...
... ... @@ -317,7 +317,7 @@ export default class Section extends React.Component {
if (endReached) {
return <LoadMoreIndicator
isVisible={true}
text={'没有更多啦'}
text={'暂无更多'}
/>
} else {
return <LoadMoreIndicator
... ...
... ... @@ -144,7 +144,7 @@ export default class SubjectPost extends Component {
if (this.props.endReached) {
return <LoadMoreIndicator
isVisible={true}
text={'没有更多啦'}
text={'暂无更多'}
/>
} else {
return <LoadMoreIndicator
... ...
... ... @@ -26,7 +26,8 @@ export default class ReplyCell extends React.Component {
backgroundImage: React.PropTypes.string,
}),
createTime: React.PropTypes.string.isRequired,
createTime: React.PropTypes.number,
timeago: React.PropTypes.string,
replyToUser: ImmutablePropTypes.contains({
avatar: React.PropTypes.string,
... ... @@ -45,9 +46,9 @@ export default class ReplyCell extends React.Component {
}),
postInfo: ImmutablePropTypes.contains({
type:React.PropTypes.string.isRequired,
title:React.PropTypes.string,
postId:React.PropTypes.string,
type: React.PropTypes.string,
title: React.PropTypes.string,
postId: React.PropTypes.number,
}),
}),
... ... @@ -61,6 +62,7 @@ export default class ReplyCell extends React.Component {
constructor(props) {
super(props);
this._renderReplyContent = this._renderReplyContent.bind(this);
this._renderPostInfo = this._renderPostInfo.bind(this);
... ... @@ -107,6 +109,7 @@ export default class ReplyCell extends React.Component {
replyToUser,
replyContent,
createTime,
timeago,
postInfo,
} = data;
... ... @@ -116,7 +119,7 @@ export default class ReplyCell extends React.Component {
<UserBrief
avatar={self.avatar}
name={self.name}
timeago={createTime.toString()}
timeago={timeago}
onPressAvatar={() => {
this.props.onPressAvatar && this.props.onPressAvatar();
}}
... ... @@ -147,7 +150,6 @@ export default class ReplyCell extends React.Component {
<TouchableOpacity
style={styles.row}
activeOpacity={0.8}
onPress={() => {
this.props.onPressPost && this.props.onPressPost(postInfo.postId);
}}
... ...
... ... @@ -36,9 +36,6 @@ export default class ReplyList extends React.Component {
<ReplyCell
key={sectionID + rowID}
data={rowData}
// onPressPost={(url) => {
// this.props.onPressPost && this.props.onPressPost(url);
// }}
onPressAvatar={() => {
// this.props.onPressAvatar && this.props.onPressAvatar();
}}
... ... @@ -47,9 +44,6 @@ export default class ReplyList extends React.Component {
// this.props.onPressReply && this.props.onPressReply;
}}
onPressPost={this.props.onPressPost}
// onPressLike={(url) => {
// this.props.onPressLike && this.props.onPressLike(url);
// }}
/>
);
}
... ...
... ... @@ -112,7 +112,8 @@ export default class User extends React.Component {
backgroundImage: React.PropTypes.string,
}),
createTime: React.PropTypes.string.isRequired,
createTime: React.PropTypes.number,
timeago: React.PropTypes.string,
replyToUser: ImmutablePropTypes.contains({
avatar: React.PropTypes.string,
... ... @@ -131,9 +132,9 @@ export default class User extends React.Component {
}),
postInfo: ImmutablePropTypes.contains({
type:React.PropTypes.string.isRequired,
title:React.PropTypes.string,
postId:React.PropTypes.string,
type: React.PropTypes.string,
title: React.PropTypes.string,
postId: React.PropTypes.number,
}),
}),
... ... @@ -246,6 +247,7 @@ export default class User extends React.Component {
data={rowData.get('reply')}
onPressAvatar={this.props.onPressAvatar}
onPressReply={this.props.onPressReply}
onPressPost={this.props.onPressPost}
onContentSizeChange={(width, height) => {}}
/>
... ...
... ... @@ -170,7 +170,7 @@ export default class UserThatNotMe extends React.Component {
if (endReached) {
return <LoadMoreIndicator
isVisible={true}
text={'没有更多啦'}
text={'暂无更多'}
/>
} else {
return <LoadMoreIndicator
... ...
... ... @@ -5,7 +5,6 @@ import {Actions} from 'react-native-router-flux';
import MessageService from '../../services/MessageService';
import timeago from '../../utils/timeago';
import {number10KFormater} from '../../utils/numberFormater';
import moment from 'moment';
const {
... ... @@ -311,11 +310,15 @@ function parseMessageList(json) {
let createTime = item.createTime;
let timeagoStr = timeago(createTime);
let subTitle = '';
let contentType = 0;
let user = {};
let post = {};
let {content} = item;
let {subTitle} = content;
if (content) {
subTitle = content.subTitle ? content.subTitle : '';
contentType = content.type ? content.type : 0;
let {userInfo, postInfo} = content;
if (userInfo) {
let nickName = userInfo.nickName ? userInfo.nickName : '';
... ... @@ -356,6 +359,7 @@ function parseMessageList(json) {
user,
post,
subTitle,
contentType,
};
messages.push(message);
... ...
... ... @@ -723,14 +723,23 @@ function parseReply(json) {
desc,
}
let createTime = moment(item.createTime, 'x').format('MM.DD.YYYY');
let post = {
authorUid: postInfo && postInfo.authorUid ? postInfo.authorUid : 0,
postId: postInfo && postInfo.postId ? postInfo.postId : 0,
title: postInfo && postInfo.title ? postInfo.title : '',
type: postInfo && postInfo.type ? postInfo.type : '',
}
let createTime = item.createTime;
let timeagoStr = timeago(createTime);
let data = {
self,
replyToUser,
replyContent,
createTime,
postInfo,
timeago: timeagoStr,
postInfo: post,
}
replies.push(data);
... ...