...
|
...
|
@@ -6,108 +6,72 @@ import ReactNative, { |
|
|
Image,
|
|
|
StyleSheet,
|
|
|
Dimensions,
|
|
|
PixelRatio,
|
|
|
TouchableOpacity,
|
|
|
Alert,
|
|
|
} from 'react-native';
|
|
|
|
|
|
import Immutable, {Map} from 'immutable';
|
|
|
|
|
|
export default class RepayList extends React.Component {
|
|
|
export default class BankCardListCell extends React.Component {
|
|
|
constructor(props) {
|
|
|
super(props);
|
|
|
}
|
|
|
|
|
|
render() {
|
|
|
let{dataSource}=this.props;
|
|
|
dataSource = dataSource.toJS();
|
|
|
let checked = dataSource.isChecked;
|
|
|
let checkboxIcon = require('../../image/check_icon.png');
|
|
|
if (!checked) {
|
|
|
checkboxIcon = require('../../image/uncheck_icon.png');
|
|
|
}
|
|
|
return(
|
|
|
<View style={styles.container}>
|
|
|
<View style={styles.cellContainer}>
|
|
|
<View style={styles.cellLeftContainer}>
|
|
|
<TouchableOpacity onPress={() => {this.props.onPressRepaylistCellCheckbox &&this.props.onPressRepaylistCellCheckbox(dataSource)}} >
|
|
|
<Image style={styles.checkboxIcon} source={checkboxIcon}/>
|
|
|
</TouchableOpacity>
|
|
|
|
|
|
<View style={styles.priceContainer}>
|
|
|
<Text style={{marginLeft:5*DEVICE_WIDTH_RATIO}}>¥{dataSource.currAmt}</Text>
|
|
|
<Text numberOfLines={1}>【全{dataSource.stage}期】{dataSource.billInfo}</Text>
|
|
|
</View>
|
|
|
let{cardNo, cardBank} = this.props;
|
|
|
|
|
|
</View>
|
|
|
|
|
|
<TouchableOpacity onPress={() => {this.props.onPressRepaylistCellDetail &&this.props.onPressRepaylistCellDetail(dataSource)}} >
|
|
|
{dataSource.isOverdue?
|
|
|
<View style={styles.cellRightContainer}>
|
|
|
<Text style={{color:'#d0021b',fontSize:12*DEVICE_WIDTH_RATIO,marginRight:5*DEVICE_WIDTH_RATIO}}>逾期{dataSource.day}天</Text>
|
|
|
<TouchableOpacity style={styles.bankTip} onPress={() => Alert.alert('逾期服务费信息','如果您到期未还款:需要加收逾期利息费和延迟还款费\n逾期利息费:待还本金 *利息率*延迟还款天数,利息率=0.025%/天\n延迟还款费:逾期3天内还款免收延迟还款服务费,逾期4天,从第一天逾期开始算,500元之内,加收1元/天延迟还款服务费。每500元增加1元/天。',[
|
|
|
{text: '我知道了'},
|
|
|
])} >
|
|
|
<Image style={{width:12*DEVICE_WIDTH_RATIO,height:12*DEVICE_WIDTH_RATIO,marginRight:5*DEVICE_WIDTH_RATIO}} source={require("../../image/red_question_icon.png")}/>
|
|
|
</TouchableOpacity>
|
|
|
<Image style={{marginRight:5*DEVICE_WIDTH_RATIO}} source={require("../../image/category_b_arrow.png")}/>
|
|
|
</View>
|
|
|
:<View style={styles.cellRightContainer}>
|
|
|
<Text style={{color:'#b0b0b0',fontSize:12*DEVICE_WIDTH_RATIO,marginRight:5*DEVICE_WIDTH_RATIO}}>剩余{dataSource.day}天</Text>
|
|
|
<Image style={{marginRight:5*DEVICE_WIDTH_RATIO}} source={require("../../image/category_b_arrow.png")}/>
|
|
|
</View>
|
|
|
}
|
|
|
</TouchableOpacity>
|
|
|
let bankImg = this.getBankImage(cardBank);
|
|
|
|
|
|
return(
|
|
|
<TouchableOpacity activeOpacity={1} onPress={() => this.props.onPressCard && this.props.onPressCard()}>
|
|
|
<View style={styles.container} >
|
|
|
<Image style={styles.cardBg} source={bankImg} />
|
|
|
<Text style={styles.cardNo} numberOfLines={1}>
|
|
|
{cardNo}
|
|
|
</Text>
|
|
|
</View>
|
|
|
</TouchableOpacity>
|
|
|
);
|
|
|
}
|
|
|
|
|
|
<View style={{
|
|
|
width: width,
|
|
|
height: 0.5 * DEVICE_WIDTH_RATIO,
|
|
|
backgroundColor: '#e5e5e5',
|
|
|
}}/>
|
|
|
|
|
|
</View>
|
|
|
);
|
|
|
getBankImage(bank){
|
|
|
let bankImg;
|
|
|
switch(bank){
|
|
|
case "CITIC":
|
|
|
bankImg = require('../../image/bank/bank-CITIC.png');
|
|
|
break;
|
|
|
case "ICBC":
|
|
|
bankImg = require('../../image/bank/bank-ICBC.png');
|
|
|
break;
|
|
|
default:
|
|
|
bankImg = require('../../image/bank/bank-ICBC.png');
|
|
|
break;
|
|
|
}
|
|
|
return bankImg;
|
|
|
}
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let {width, height} = Dimensions.get('window');
|
|
|
const DEVICE_WIDTH_RATIO = width / 320;
|
|
|
|
|
|
let styles = StyleSheet.create({
|
|
|
container: {
|
|
|
flex: 1,
|
|
|
backgroundColor: 'white',
|
|
|
alignItems: 'center',
|
|
|
width: width,
|
|
|
height: 61 * DEVICE_WIDTH_RATIO,
|
|
|
},
|
|
|
cellContainer: {
|
|
|
width: width,
|
|
|
height: 60.5 * DEVICE_WIDTH_RATIO,
|
|
|
flexDirection: 'row',
|
|
|
justifyContent: 'space-between',
|
|
|
justifyContent: 'center',
|
|
|
},
|
|
|
checkboxIcon: {
|
|
|
width: 15 * DEVICE_WIDTH_RATIO,
|
|
|
height: 15 * DEVICE_WIDTH_RATIO,
|
|
|
marginLeft: 15 * DEVICE_WIDTH_RATIO,
|
|
|
},
|
|
|
cellLeftContainer: {
|
|
|
flexDirection: 'row',
|
|
|
width: 190 * DEVICE_WIDTH_RATIO,
|
|
|
alignItems: 'center',
|
|
|
cardBg:{
|
|
|
width: 290 * DEVICE_WIDTH_RATIO,
|
|
|
height: 100 * DEVICE_WIDTH_RATIO,
|
|
|
},
|
|
|
priceContainer: {
|
|
|
width: 160 * DEVICE_WIDTH_RATIO,
|
|
|
height: 40 * DEVICE_WIDTH_RATIO,
|
|
|
marginTop: 10 * DEVICE_WIDTH_RATIO,
|
|
|
},
|
|
|
cellRightContainer: {
|
|
|
marginRight: 15 * DEVICE_WIDTH_RATIO,
|
|
|
height: 60 * DEVICE_WIDTH_RATIO,
|
|
|
alignItems: 'center',
|
|
|
flexDirection: 'row',
|
|
|
|
|
|
cardNo:{
|
|
|
position: 'absolute',
|
|
|
top: 60,
|
|
|
left: 200,
|
|
|
|
|
|
}
|
|
|
}); |
...
|
...
|
|