npmchenwei111
Version:
test1111
90 lines (81 loc) • 2.32 kB
JavaScript
/**
* Created by ziyu on 2017/6/21.
*/
import React, { Component } from 'react'
import { Image, StyleSheet, Text, View } from 'react-native'
import { px2dp, sp } from '../../utils/Px2dp'
import R from '../../assets/R'
class BankItemView extends Component {
constructor (props) {
super(props)
this.state = {}
}
componentDidMount () {
}
render () {
return (
<View style={[{backgroundColor: '#fff', paddingHorizontal: px2dp(16)}, this.props.style]}>
<View style={styles.container}>
<View style={{flex: 1, justifyContent: 'center'}}>
{/* <Image style={styles.logoImg} source={require('../assets/imgs/sdzz_logo.png')}/> */}
<Image style={styles.logoImg} source={{uri: this.props.logoUrl}}/>
</View>
<View style={{flex: 4, justifyContent: 'center'}}>
<Text style={styles.title} numberOfLines={2} ellipsizeMode={'tail'}>{this.props.bankName}</Text>
</View>
<View style={{flex: 3, justifyContent: 'center'}}>
<Text style={styles.cardNoText} numberOfLines={2}
ellipsizeMode={'tail'}>{this.props.cardNoText}</Text>
</View>
<View style={{flex: 2, justifyContent: 'center', alignItems: 'flex-end'}}>
<Image
style={styles.badgeImg}
resizeMode={'stretch'}
source={R.img.ic_repay_bank_card}/>
</View>
</View>
<View style={styles.tip}>
<Text style={{color: '#a0a0a0'}}>{this.props.descText}</Text>
</View>
</View>
)
}
}
const styles = StyleSheet.create({
container: {
backgroundColor: '#fff',
height: px2dp(60),
flexDirection: 'row'
},
logoImg: {
width: px2dp(30),
height: px2dp(30)
},
badgeImg: {
width: px2dp(68),
height: px2dp(60),
resizeMode: Image.resizeMode.contain
},
title: {
fontSize: sp(16),
color: '#626262',
marginLeft: px2dp(10)
},
time: {
fontSize: sp(12),
color: '#a0a0a0',
marginLeft: px2dp(10)
},
cardNoText: {
fontSize: sp(16),
color: '#a0a0a0',
textAlign: 'right'
},
tip: {
paddingVertical: px2dp(10),
borderTopWidth: px2dp(1),
borderTopColor: '#e2e2e2',
borderStyle: 'solid'
}
})
export default BankItemView