/** * @param: uri String, username String,flowerNumber String, onPressCallback function * */ import React, { Component } from "react"; import { StyleSheet, Text, View, Image, TouchableOpacity, } from "react-native"; import Dimensions from '../utils/dimensions' /** 因没有图,所以Image先用颜色代替,有图可替换 */ type Props = {}; const styles = StyleSheet.create({ wrapper: { width: Dimensions.width, height: 72, flex: 1, alignItems: "center", // backgroundColor: 'red', justifyContent: "center", flexDirection: "row" }, avatar: { width: 44, height: 44, borderRadius: 50, marginLeft: 11, marginRight: 11 }, leftBox:{ flex: 1, flexDirection: "column" }, userName:{ fontSize: 18, fontWeight: "bold", textAlign: "left", textAlignVertical: "bottom", color: "#3f3f3f" }, leftBottomRow: { flexDirection: "row", alignItems: "center" }, flowerIcon:{ marginLeft: 10, alignItems: "center", justifyContent: "center", width: 27, height: 14 }, flowerNumber:{ textAlignVertical: "center", marginLeft: 3 } }) export default class Header extends Component { render() { return ( {this.props.isVisitor ? '新用户登录送7天VIP' : this.props.username} { this.props.isVisitor ? null : } this.click()}> {this.props.isVisitor ? '立即登录' : this.props.isVip ? '' : '开通VIP'} ); } 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') } } } /** 使用方法
this.toNextPage("MainActivity")} /> */