Merge branch 'local' into develop
Showing
5 changed files
with
35 additions
and
35 deletions
@@ -31,7 +31,7 @@ export default class SlicedImage extends React.Component { | @@ -31,7 +31,7 @@ export default class SlicedImage extends React.Component { | ||
31 | .replace('{height}', height); | 31 | .replace('{height}', height); |
32 | } | 32 | } |
33 | 33 | ||
34 | - __DEV__ && console.log(newSrc); | 34 | + // __DEV__ && console.log(newSrc); |
35 | 35 | ||
36 | return newSrc; | 36 | return newSrc; |
37 | } | 37 | } |
@@ -37,21 +37,18 @@ export default class LikeList extends React.Component { | @@ -37,21 +37,18 @@ export default class LikeList extends React.Component { | ||
37 | } | 37 | } |
38 | 38 | ||
39 | _renderRow(rowData, sectionID, rowID, highlightRow) { | 39 | _renderRow(rowData, sectionID, rowID, highlightRow) { |
40 | - let {postId, user} = rowData.toJS(); | 40 | + let data = rowData.toJS(); |
41 | return ( | 41 | return ( |
42 | <TouchableOpacity | 42 | <TouchableOpacity |
43 | activeOpacity={1} | 43 | activeOpacity={1} |
44 | - onPress={() => { | ||
45 | - this.props.onPressPost && this.props.onPressPost(postId); | ||
46 | - }} | ||
47 | style={styles.row} | 44 | style={styles.row} |
48 | > | 45 | > |
49 | <UserBrief | 46 | <UserBrief |
50 | containerStyle={styles.userBrief} | 47 | containerStyle={styles.userBrief} |
51 | - avatar={user.avatar} | ||
52 | - name={user.nickName} | 48 | + avatar={data.avatar} |
49 | + name={data.nickName} | ||
53 | onPressAvatar={() => { | 50 | onPressAvatar={() => { |
54 | - this.props.onPressAvatar && this.props.onPressAvatar(user.uid); | 51 | + this.props.onPressAvatar && this.props.onPressAvatar(data.uid); |
55 | }} | 52 | }} |
56 | /> | 53 | /> |
57 | </TouchableOpacity> | 54 | </TouchableOpacity> |
@@ -67,23 +67,42 @@ export default class SPLikeCell extends React.Component { | @@ -67,23 +67,42 @@ export default class SPLikeCell extends React.Component { | ||
67 | <View style={styles.rightLikeContainer}> | 67 | <View style={styles.rightLikeContainer}> |
68 | <Text style={styles.browseText}>{browse + '人看过'}</Text> | 68 | <Text style={styles.browseText}>{browse + '人看过'}</Text> |
69 | </View> | 69 | </View> |
70 | + <View style={styles.topLine}/> | ||
71 | + <View style={styles.bottomLine}/> | ||
70 | </View> | 72 | </View> |
71 | </TouchableOpacity> | 73 | </TouchableOpacity> |
72 | ); | 74 | ); |
73 | } | 75 | } |
74 | } | 76 | } |
75 | 77 | ||
78 | +let {width, height} = Dimensions.get('window'); | ||
79 | +let lineWidth = width - 30; | ||
80 | + | ||
76 | let styles = StyleSheet.create({ | 81 | let styles = StyleSheet.create({ |
77 | container: { | 82 | container: { |
78 | backgroundColor: 'white', | 83 | backgroundColor: 'white', |
79 | height: 50, | 84 | height: 50, |
80 | - borderColor: '#a0a0a0', | ||
81 | - borderTopWidth: 0.5, | ||
82 | - borderBottomWidth: 0.5, | ||
83 | marginLeft: 15, | 85 | marginLeft: 15, |
84 | marginRight: 15, | 86 | marginRight: 15, |
85 | flexDirection: 'row', | 87 | flexDirection: 'row', |
86 | justifyContent: 'space-between', | 88 | justifyContent: 'space-between', |
89 | + flex: 1, | ||
90 | + }, | ||
91 | + topLine: { | ||
92 | + position: 'absolute', | ||
93 | + left: 0, | ||
94 | + top: 0, | ||
95 | + width: lineWidth, | ||
96 | + height: 0.5, | ||
97 | + backgroundColor: '#a0a0a0', | ||
98 | + }, | ||
99 | + bottomLine: { | ||
100 | + position: 'absolute', | ||
101 | + left: 0, | ||
102 | + bottom: 0, | ||
103 | + width: lineWidth, | ||
104 | + height: 0.5, | ||
105 | + backgroundColor: '#a0a0a0', | ||
87 | }, | 106 | }, |
88 | leftLikeContainer: { | 107 | leftLikeContainer: { |
89 | flex: 1, | 108 | flex: 1, |
@@ -49,7 +49,6 @@ class LikeMessageContainer extends React.Component { | @@ -49,7 +49,6 @@ class LikeMessageContainer extends React.Component { | ||
49 | constructor(props) { | 49 | constructor(props) { |
50 | super(props); | 50 | super(props); |
51 | 51 | ||
52 | - this._onPressPost = this._onPressPost.bind(this); | ||
53 | this._onPressAvatar = this._onPressAvatar.bind(this); | 52 | this._onPressAvatar = this._onPressAvatar.bind(this); |
54 | this._onEndReached = this._onEndReached.bind(this); | 53 | this._onEndReached = this._onEndReached.bind(this); |
55 | 54 | ||
@@ -68,10 +67,6 @@ class LikeMessageContainer extends React.Component { | @@ -68,10 +67,6 @@ class LikeMessageContainer extends React.Component { | ||
68 | this.props.actions.likeListClean(this.sid); | 67 | this.props.actions.likeListClean(this.sid); |
69 | } | 68 | } |
70 | 69 | ||
71 | - _onPressPost(id) { | ||
72 | - // this.props.actions.goToPost(id); | ||
73 | - } | ||
74 | - | ||
75 | _onPressAvatar(uid) { | 70 | _onPressAvatar(uid) { |
76 | this.props.actions.goToUserOrMe(uid); | 71 | this.props.actions.goToUserOrMe(uid); |
77 | } | 72 | } |
@@ -95,7 +90,6 @@ class LikeMessageContainer extends React.Component { | @@ -95,7 +90,6 @@ class LikeMessageContainer extends React.Component { | ||
95 | endReached={endReached} | 90 | endReached={endReached} |
96 | isLoadingMore={isFetching} | 91 | isLoadingMore={isFetching} |
97 | onEndReached={this._onEndReached} | 92 | onEndReached={this._onEndReached} |
98 | - onPressPost={this._onPressPost} | ||
99 | onPressAvatar={this._onPressAvatar} | 93 | onPressAvatar={this._onPressAvatar} |
100 | /> | 94 | /> |
101 | </View> | 95 | </View> |
@@ -75,18 +75,14 @@ function parseLikeList(json) { | @@ -75,18 +75,14 @@ function parseLikeList(json) { | ||
75 | total = total ? total : 0; | 75 | total = total ? total : 0; |
76 | let likes = []; | 76 | let likes = []; |
77 | list && list.map((item, i) => { | 77 | list && list.map((item, i) => { |
78 | - | ||
79 | - let postId = item.postsId ? item.postsId : 0; | ||
80 | - | ||
81 | - let user = {}; | ||
82 | - let {userInfo} = item; | ||
83 | - if (userInfo) { | ||
84 | - let nickName = userInfo.nickName ? userInfo.nickName : ''; | ||
85 | - let avatar = userInfo.headIcon ? userInfo.headIcon : ''; | ||
86 | - let uid = userInfo.uid ? userInfo.uid : 0; | ||
87 | - let sign = userInfo.signature ? userInfo.signature : ''; | ||
88 | - let backgroundImage = userInfo.bgPic ? userInfo.bgPic : ''; | ||
89 | - user = { | 78 | + let like = {}; |
79 | + if (item) { | ||
80 | + let nickName = item.nickName ? item.nickName : ''; | ||
81 | + let avatar = item.headIcon ? item.headIcon : ''; | ||
82 | + let uid = item.uid ? item.uid : 0; | ||
83 | + let sign = item.signature ? item.signature : ''; | ||
84 | + let backgroundImage = item.bgPic ? item.bgPic : ''; | ||
85 | + like = { | ||
90 | nickName, | 86 | nickName, |
91 | avatar, | 87 | avatar, |
92 | uid, | 88 | uid, |
@@ -94,12 +90,6 @@ function parseLikeList(json) { | @@ -94,12 +90,6 @@ function parseLikeList(json) { | ||
94 | backgroundImage, | 90 | backgroundImage, |
95 | }; | 91 | }; |
96 | } | 92 | } |
97 | - | ||
98 | - let like = { | ||
99 | - postId, | ||
100 | - user, | ||
101 | - }; | ||
102 | - | ||
103 | likes.push(like); | 93 | likes.push(like); |
104 | }); | 94 | }); |
105 | 95 |
-
Please register or login to post a comment