...
|
...
|
@@ -7,11 +7,13 @@ import { Immutable } from 'immutable'; |
|
|
const DEVICE_WIDTH_RATIO = Dimensions.get('window').width / 375;
|
|
|
const { width } = Dimensions.get('window');
|
|
|
|
|
|
|
|
|
export default class InvitedFriends extends Component {
|
|
|
|
|
|
constructor(props) {
|
|
|
super(props);
|
|
|
this._renderRow = this._renderRow.bind(this);
|
|
|
this._renderFooter = this._renderFooter.bind(this);
|
|
|
this.dataSource = new ListView.DataSource({
|
|
|
rowHasChanged: (r1, r2) => !Immutable.is(r1, r2),
|
|
|
});
|
...
|
...
|
@@ -23,7 +25,7 @@ export default class InvitedFriends extends Component { |
|
|
<View style={styles.rowView}>
|
|
|
|
|
|
<View style={styles.rowItemStyle}>
|
|
|
<Text style={styles.nameStyle}>{rowData.get("name")}</Text>
|
|
|
<Text style={styles.rowTextStyle}>{rowData.get("name")}</Text>
|
|
|
</View>
|
|
|
|
|
|
<View style={styles.rowItemStyle}>
|
...
|
...
|
@@ -39,10 +41,20 @@ export default class InvitedFriends extends Component { |
|
|
</View>
|
|
|
|
|
|
</View>
|
|
|
|
|
|
<View style={styles.lineView}/>
|
|
|
</View>
|
|
|
);
|
|
|
}
|
|
|
|
|
|
_renderFooter(){
|
|
|
return (
|
|
|
<View style={[{height: 50}, {backgroundColor: 'white'}, {justifyContent:'center'}]}>
|
|
|
<Text style={{textAlign: 'center', fontFamily: 'PingFang-SC-Regular', fontSize: 12, color: '#B0B0B0',}}>暂无更多数据</Text>
|
|
|
</View>
|
|
|
)
|
|
|
}
|
|
|
|
|
|
render() {
|
|
|
|
|
|
let {
|
...
|
...
|
@@ -79,22 +91,26 @@ export default class InvitedFriends extends Component { |
|
|
|
|
|
</View>
|
|
|
|
|
|
<View style={styles.lineView}/>
|
|
|
|
|
|
<ListView
|
|
|
ref={(c) => {
|
|
|
this.listView = c;
|
|
|
}}
|
|
|
contentContainerStyle={styles.contentContainer}
|
|
|
enableEmptySections={true}
|
|
|
dataSource={this.dataSource.cloneWithRows(invitersList)}
|
|
|
renderRow={this._renderRow}
|
|
|
onEndReached={() => {
|
|
|
if (invitersList.size !== 0) {
|
|
|
this.props.onEndReached && this.props.onEndReached();
|
|
|
}
|
|
|
}}/>
|
|
|
ref={(c) => {
|
|
|
this.listView = c;
|
|
|
}}
|
|
|
contentContainerStyle={styles.contentContainer}
|
|
|
enableEmptySections={true}
|
|
|
dataSource={this.dataSource.cloneWithRows(invitersList)}
|
|
|
renderRow={this._renderRow}
|
|
|
renderFooter={this._renderFooter}
|
|
|
|
|
|
onEndReached={() => {
|
|
|
if (invitersList.size !== 0) {
|
|
|
this.props.onEndReached && this.props.onEndReached();
|
|
|
}
|
|
|
}}/>
|
|
|
|
|
|
<TouchableOpacity activeOpacity={1} style={styles.touchableStyle} onPress={() => {
|
|
|
//有货有赚调原生
|
|
|
this.props.shareForInvite && this.props.shareForInvite();
|
|
|
}}>
|
|
|
<Text style={styles.buttonStyle}>邀请好友加入有货有赚</Text>
|
|
|
</TouchableOpacity>
|
...
|
...
|
@@ -116,7 +132,7 @@ const styles = StyleSheet.create({ |
|
|
},
|
|
|
topImageView: {
|
|
|
width: width,
|
|
|
height: 120 * DEVICE_WIDTH_RATIO,
|
|
|
height: 118 * DEVICE_WIDTH_RATIO,
|
|
|
},
|
|
|
middleView: {
|
|
|
height: 50 * DEVICE_WIDTH_RATIO,
|
...
|
...
|
@@ -129,12 +145,12 @@ const styles = StyleSheet.create({ |
|
|
paddingVertical: 18,
|
|
|
},
|
|
|
textsStyle: {
|
|
|
fontFamily: 'PingFang-SC-Regular',
|
|
|
fontFamily: 'PingFang-SC-Medium',
|
|
|
fontSize: 12,
|
|
|
color: 'black',
|
|
|
color: '#444444',
|
|
|
},
|
|
|
rowView: {
|
|
|
height: 44 * DEVICE_WIDTH_RATIO,
|
|
|
height: 50 * DEVICE_WIDTH_RATIO,
|
|
|
flexDirection: 'row',
|
|
|
alignItems: 'center',
|
|
|
},
|
...
|
...
|
@@ -145,13 +161,8 @@ const styles = StyleSheet.create({ |
|
|
},
|
|
|
rowTextStyle: {
|
|
|
fontFamily: 'PingFang-SC-Regular',
|
|
|
fontSize: 10,
|
|
|
color: '#323232',
|
|
|
},
|
|
|
nameStyle: {
|
|
|
fontFamily: 'PingFang-SC-Regular',
|
|
|
fontSize: 10,
|
|
|
color: 'black',
|
|
|
fontSize: 11,
|
|
|
color: '#444444',
|
|
|
},
|
|
|
buttonStyle: {
|
|
|
fontFamily: 'PingFang-SC-Regular',
|
...
|
...
|
@@ -169,6 +180,10 @@ const styles = StyleSheet.create({ |
|
|
backgroundColor: '#D0021B',
|
|
|
justifyContent: 'center'
|
|
|
},
|
|
|
lineView: {
|
|
|
height: 0.5,
|
|
|
backgroundColor: '#e0e0e0'
|
|
|
},
|
|
|
spaceView: {
|
|
|
height: 10 * DEVICE_WIDTH_RATIO,
|
|
|
backgroundColor: '#F0F0F0'
|
...
|
...
|
|