|
@@ -65,40 +65,57 @@ const styles = StyleSheet.create({
|
|
|
export default class Header extends Component<Props> {
|
|
|
render() {
|
|
|
return (
|
|
|
- <TouchableOpacity activeOpacity={1} onPress={this.props.onPress}>
|
|
|
- <View
|
|
|
- style={styles.wrapper}
|
|
|
- >
|
|
|
+ <View
|
|
|
+ style={styles.wrapper}
|
|
|
+ >
|
|
|
+ <TouchableOpacity activeOpacity={1} onPress={this.props.onPress}>
|
|
|
<Image
|
|
|
source={this.props.uri ? {
|
|
|
uri: this.props.uri
|
|
|
} : require('../images/userInfo/default_photo.png')}
|
|
|
style={styles.avatar}
|
|
|
/>
|
|
|
- <View
|
|
|
- style={styles.leftBox}
|
|
|
- >
|
|
|
- <View style={styles.leftBottomRow}>
|
|
|
- <Text
|
|
|
- style={styles.userName}
|
|
|
- >
|
|
|
- {this.props.username}
|
|
|
- </Text>
|
|
|
+ </TouchableOpacity>
|
|
|
+ <View
|
|
|
+ style={styles.leftBox}
|
|
|
+ >
|
|
|
+ <View style={styles.leftBottomRow}>
|
|
|
+ <Text
|
|
|
+ style={styles.userName}
|
|
|
+ >
|
|
|
+ {this.props.isVisitor ? '新用户登录送7天VIP' : this.props.username}
|
|
|
+ </Text>
|
|
|
+ {
|
|
|
+ this.props.isVisitor ?
|
|
|
+ null
|
|
|
+ :
|
|
|
<Image
|
|
|
- source={require("../images/common/vip.png")}
|
|
|
+ source={this.props.isVip ? require("../images/common/vip.png") : require("../images/common/novip.png")}
|
|
|
style={styles.flowerIcon}
|
|
|
/>
|
|
|
- </View>
|
|
|
+ }
|
|
|
+ </View>
|
|
|
+ <TouchableOpacity activeOpacity={1} onPress={ () => this.click()}>
|
|
|
<Text
|
|
|
style={styles.flowerNumber}
|
|
|
>
|
|
|
- {this.props.isVip ? '' : '开通VIP'}
|
|
|
+ {this.props.isVisitor ? '立即登录' : this.props.isVip ? '' : '开通VIP'}
|
|
|
</Text>
|
|
|
- </View>
|
|
|
+ </TouchableOpacity>
|
|
|
</View>
|
|
|
- </TouchableOpacity>
|
|
|
+ </View>
|
|
|
);
|
|
|
}
|
|
|
+ click() {
|
|
|
+ // alert(this.props.isVisitor)
|
|
|
+ // this.props.nav('Loading')
|
|
|
+ if (this.props.isVisitor) {
|
|
|
+ this.props.nav('Login')
|
|
|
+ } else if (!this.props.isVip) {
|
|
|
+ this.props.nav('Buy')
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
}
|
|
|
/**
|
|
|
|