...
|
...
|
@@ -8,68 +8,89 @@ import ReactNative, { |
|
|
Dimensions,
|
|
|
PixelRatio,
|
|
|
TouchableOpacity,
|
|
|
ListView,
|
|
|
} from 'react-native';
|
|
|
|
|
|
import Immutable, {Map} from 'immutable';
|
|
|
import Toast from '../../../common/components/Toast';
|
|
|
import MyOrderDetailPayListCell from './MyOrderDetailPayListCell';
|
|
|
|
|
|
|
|
|
export default class MyOrderDetail extends React.Component {
|
|
|
constructor(props) {
|
|
|
super(props);
|
|
|
this.dataSource = new ListView.DataSource({
|
|
|
rowHasChanged: (r1, r2) => !Immutable.is(r1, r2),
|
|
|
});
|
|
|
this.renderRow = this.renderRow.bind(this);
|
|
|
}
|
|
|
|
|
|
|
|
|
renderRow(rowData, sectionID, rowID, highlightRow) {
|
|
|
return (
|
|
|
<MyOrderDetailPayListCell
|
|
|
data={rowData}
|
|
|
onPressOrder={this.props.onPressOrder}
|
|
|
|
|
|
/>
|
|
|
);
|
|
|
}
|
|
|
|
|
|
render() {
|
|
|
|
|
|
let bankName = "农业银行";
|
|
|
let cardNo = "4561";
|
|
|
let userName = "**聪";
|
|
|
let mobile = "*****5865";
|
|
|
let isMaster = false;
|
|
|
let goodsName = "Adidas Originals KS full size";
|
|
|
let orderCode = "订单编号:165965646564 ";
|
|
|
let orderTime = "2015.12.13";
|
|
|
let orderMoney = "¥ 455";
|
|
|
let isOrderPaying = false;
|
|
|
let orderStateText = "还款中1/3";
|
|
|
|
|
|
let colorStyle = isOrderPaying ? {color: '#444444'} : {color: '#b0b0b0'};
|
|
|
|
|
|
let cardList = [{'a':'A'},{'a':'A'},{'a':'A'},{'a':'A'},{'a':'A'},{'a':'A'}];
|
|
|
|
|
|
|
|
|
let cardDesc = isMaster ? "主卡,用于支付验证和还款验证。" : "副卡,仅用于还款验证。";
|
|
|
let cardTip = isMaster ? "如果您更换银行预留手机号,请先新增其他还款银行卡,并将新增银行卡切换为主卡。然后解除绑定此卡,重新绑定即可。"
|
|
|
: "如果您更换银行预留手机号,请先将银行卡解除绑定,再次重新绑定即可。";
|
|
|
|
|
|
return (
|
|
|
<View style={styles.container}>
|
|
|
<View style={styles.cardDetailContainer}>
|
|
|
<Image style={styles.cardDetailImg} source={require("../../image/bank/b-ABC.png")}/>
|
|
|
<Text style={styles.cardDetailName}>{bankName}</Text>
|
|
|
<Text style={styles.cardDetailNo}>储蓄卡 | 尾号{cardNo}</Text>
|
|
|
</View>
|
|
|
<View style={styles.cardInfoContainer}>
|
|
|
<Text style={styles.cardInfoLabel}>持卡人</Text>
|
|
|
<Text style={styles.cardInfoData}>{userName}</Text>
|
|
|
<View style={styles.goodsInfoContainer}>
|
|
|
<Image style={styles.goodsImage} source={require("../../image/bank/bank-ABC.png")} />
|
|
|
<Text style={styles.goodsName} numberOfLines={1}>{goodsName}</Text>
|
|
|
<Text style={styles.orderCode} numberOfLines={1}>{orderCode}</Text>
|
|
|
<Text style={styles.orderTime} numberOfLines={1}>{orderTime}</Text>
|
|
|
</View>
|
|
|
<View style={styles.cardInfoLine}></View>
|
|
|
<View style={styles.cardInfoContainer}>
|
|
|
<Text style={styles.cardInfoLabel}>预留手机号</Text>
|
|
|
<Text style={styles.cardInfoData}>{mobile}</Text>
|
|
|
<View style={styles.splitLine}></View>
|
|
|
<View style={styles.installmentInfoContainer}>
|
|
|
<View style={styles.installmentInfoCell}>
|
|
|
<Text style={styles.installmentInfoCellText}>分期应还</Text>
|
|
|
<Text style={styles.installmentInfoCellText}>{"555"}</Text>
|
|
|
</View>
|
|
|
<View style={styles.installmentInfoCell}>
|
|
|
<Text style={styles.installmentInfoCellText}>分期服务费</Text>
|
|
|
<Text style={styles.installmentInfoCellText}>{"555"}</Text>
|
|
|
</View>
|
|
|
<View style={styles.installmentInfoCell}>
|
|
|
<Text style={styles.installmentInfoCellText}>总计应还</Text>
|
|
|
<Text style={styles.installmentInfoCellText}>{"555"}</Text>
|
|
|
</View>
|
|
|
</View>
|
|
|
<View style={styles.cardInfoLine}></View>
|
|
|
<View style={styles.cardInfoContainer}>
|
|
|
<Text style={styles.cardInfoLabel}>分期银行</Text>
|
|
|
<Text style={styles.cardInfoData}>{cardDesc}</Text>
|
|
|
</View>
|
|
|
<View style={styles.cardTipContainer}>
|
|
|
<Text style={styles.cardTip}>{cardTip}</Text>
|
|
|
{
|
|
|
isMaster ? null :
|
|
|
<View style={styles.buttonContainer}>
|
|
|
<TouchableOpacity activeOpacity={1} onPress={() => {
|
|
|
this.props.onPressReleaseCard && this.props.onPressReleaseCard();}}>
|
|
|
<Text style={styles.releaseButton}>解除绑定</Text>
|
|
|
</TouchableOpacity>
|
|
|
<TouchableOpacity activeOpacity={1} onPress={() => {
|
|
|
<View style={styles.splitLine}></View>
|
|
|
<View style={styles.splitBlank}></View>
|
|
|
<View style={styles.splitLine}></View>
|
|
|
<ListView
|
|
|
style={styles.payListContainer}
|
|
|
dataSource={this.dataSource.cloneWithRows(cardList)}
|
|
|
enableEmptySections={true}
|
|
|
renderRow={this.renderRow}
|
|
|
/>
|
|
|
<View style={styles.splitLine}></View>
|
|
|
<View style={styles.bottomContainer}>
|
|
|
<TouchableOpacity activeOpacity={1} onPress={() => {
|
|
|
this.props.onPressChangeCard && this.props.onPressChangeCard();}}>
|
|
|
<Text style={styles.changeButton}>切换为主卡</Text>
|
|
|
</TouchableOpacity>
|
|
|
</View>
|
|
|
}
|
|
|
<Text style={styles.changeButton}>立即还款</Text>
|
|
|
</TouchableOpacity>
|
|
|
</View>
|
|
|
|
|
|
<Toast text="解绑成功" isVisible={false} />
|
|
|
|
|
|
|
|
|
</View>
|
|
|
);
|
...
|
...
|
@@ -85,102 +106,85 @@ let styles = StyleSheet.create({ |
|
|
backgroundColor: "#ffffff",
|
|
|
},
|
|
|
|
|
|
cardDetailContainer:{
|
|
|
splitLine:{
|
|
|
width: width,
|
|
|
height: 60 * DEVICE_WIDTH_RATIO,
|
|
|
backgroundColor: "#f8555b",
|
|
|
height: 0.5 * DEVICE_WIDTH_RATIO,
|
|
|
backgroundColor: "#b4b4b4",
|
|
|
},
|
|
|
|
|
|
cardDetailImg:{
|
|
|
splitBlank:{
|
|
|
width: width,
|
|
|
height: 15 * DEVICE_WIDTH_RATIO,
|
|
|
backgroundColor: "#f0f0f0",
|
|
|
},
|
|
|
|
|
|
goodsInfoContainer:{
|
|
|
width: width,
|
|
|
height: 80 * DEVICE_WIDTH_RATIO,
|
|
|
},
|
|
|
|
|
|
goodsImage:{
|
|
|
position: 'absolute',
|
|
|
top: 10 * DEVICE_WIDTH_RATIO,
|
|
|
left: 15 * DEVICE_WIDTH_RATIO,
|
|
|
width: 40 * DEVICE_WIDTH_RATIO,
|
|
|
height: 40 * DEVICE_WIDTH_RATIO,
|
|
|
width: 45 * DEVICE_WIDTH_RATIO,
|
|
|
height: 60 * DEVICE_WIDTH_RATIO,
|
|
|
},
|
|
|
|
|
|
cardDetailName:{
|
|
|
goodsName:{
|
|
|
position: 'absolute',
|
|
|
top: 10 * DEVICE_WIDTH_RATIO,
|
|
|
left: 65 * DEVICE_WIDTH_RATIO,
|
|
|
width: 150 * DEVICE_WIDTH_RATIO,
|
|
|
height: 20 * DEVICE_WIDTH_RATIO,
|
|
|
fontSize: 15 * DEVICE_WIDTH_RATIO,
|
|
|
color: "white",
|
|
|
fontWeight: 'bold',
|
|
|
top: 15 * DEVICE_WIDTH_RATIO,
|
|
|
left: 70 * DEVICE_WIDTH_RATIO,
|
|
|
color: "#444444",
|
|
|
fontSize: 12 * DEVICE_WIDTH_RATIO,
|
|
|
},
|
|
|
|
|
|
cardDetailNo:{
|
|
|
orderCode:{
|
|
|
position: 'absolute',
|
|
|
top: 30 * DEVICE_WIDTH_RATIO,
|
|
|
left: 65 * DEVICE_WIDTH_RATIO,
|
|
|
width: 150 * DEVICE_WIDTH_RATIO,
|
|
|
height: 30 * DEVICE_WIDTH_RATIO,
|
|
|
fontSize: 13 * DEVICE_WIDTH_RATIO,
|
|
|
color: "white",
|
|
|
},
|
|
|
|
|
|
cardInfoContainer:{
|
|
|
width: width,
|
|
|
height: 44 * DEVICE_WIDTH_RATIO,
|
|
|
backgroundColor: "#ffffff",
|
|
|
flexDirection: 'row',
|
|
|
alignItems: 'center',
|
|
|
left: 70 * DEVICE_WIDTH_RATIO,
|
|
|
color: "#444444",
|
|
|
fontSize: 12 * DEVICE_WIDTH_RATIO,
|
|
|
},
|
|
|
|
|
|
cardInfoLabel:{
|
|
|
width: 125 * DEVICE_WIDTH_RATIO,
|
|
|
paddingLeft: 15 * DEVICE_WIDTH_RATIO,
|
|
|
fontSize: 14 * DEVICE_WIDTH_RATIO,
|
|
|
orderTime:{
|
|
|
position: 'absolute',
|
|
|
top: 50 * DEVICE_WIDTH_RATIO,
|
|
|
left: 70 * DEVICE_WIDTH_RATIO,
|
|
|
color: "#b0b0b0",
|
|
|
fontSize: 12 * DEVICE_WIDTH_RATIO,
|
|
|
},
|
|
|
|
|
|
cardInfoData:{
|
|
|
width: 150 * DEVICE_WIDTH_RATIO,
|
|
|
fontSize: 13 * DEVICE_WIDTH_RATIO,
|
|
|
},
|
|
|
|
|
|
cardInfoLine:{
|
|
|
width: width - 15 * DEVICE_WIDTH_RATIO,
|
|
|
height: 0.5 * DEVICE_WIDTH_RATIO,
|
|
|
marginLeft: 15 * DEVICE_WIDTH_RATIO,
|
|
|
backgroundColor: "#b4b4b4",
|
|
|
installmentInfoContainer:{
|
|
|
width: width,
|
|
|
height: 60 * DEVICE_WIDTH_RATIO,
|
|
|
flexDirection: 'row',
|
|
|
},
|
|
|
|
|
|
cardTipContainer:{
|
|
|
installmentInfoCell:{
|
|
|
flex: 1,
|
|
|
backgroundColor: "#f0f0f0",
|
|
|
justifyContent: 'center',
|
|
|
alignItems: 'center',
|
|
|
flexDirection: 'column',
|
|
|
},
|
|
|
|
|
|
cardTip: {
|
|
|
width: width,
|
|
|
paddingLeft: 15 * DEVICE_WIDTH_RATIO,
|
|
|
paddingRight: 10 * DEVICE_WIDTH_RATIO,
|
|
|
paddingTop: 10 * DEVICE_WIDTH_RATIO,
|
|
|
installmentInfoCellText:{
|
|
|
color: "#444444",
|
|
|
fontSize: 12 * DEVICE_WIDTH_RATIO,
|
|
|
color: "#b0b0b0",
|
|
|
},
|
|
|
|
|
|
buttonContainer:{
|
|
|
payListContainer:{
|
|
|
width: width,
|
|
|
height: 100,
|
|
|
flexDirection: 'row',
|
|
|
alignItems: 'center',
|
|
|
justifyContent: 'center',
|
|
|
height: 200 * DEVICE_WIDTH_RATIO,
|
|
|
},
|
|
|
|
|
|
releaseButton:{
|
|
|
width: 130 * DEVICE_WIDTH_RATIO,
|
|
|
height: 44 * DEVICE_WIDTH_RATIO,
|
|
|
fontSize:14 * DEVICE_WIDTH_RATIO,
|
|
|
paddingTop:12 * DEVICE_WIDTH_RATIO,
|
|
|
marginRight: 8 * DEVICE_WIDTH_RATIO,
|
|
|
color: '#000000',
|
|
|
textAlign: 'center',
|
|
|
borderColor:'#444444',
|
|
|
borderWidth:2,
|
|
|
borderRadius: 6,
|
|
|
bottomContainer:{
|
|
|
width: width,
|
|
|
height: 60 * DEVICE_WIDTH_RATIO,
|
|
|
},
|
|
|
|
|
|
|
|
|
changeButton:{
|
|
|
width: 130 * DEVICE_WIDTH_RATIO,
|
|
|
height: 44 * DEVICE_WIDTH_RATIO,
|
...
|
...
|
@@ -189,10 +193,10 @@ let styles = StyleSheet.create({ |
|
|
marginLeft: 8 * DEVICE_WIDTH_RATIO,
|
|
|
color: '#ffffff',
|
|
|
textAlign: 'center',
|
|
|
borderColor:'#444444',
|
|
|
borderColor:'#cc0009',
|
|
|
borderWidth:2,
|
|
|
borderRadius: 6,
|
|
|
backgroundColor:'#444444',
|
|
|
backgroundColor:'#cc0009',
|
|
|
},
|
|
|
|
|
|
|
...
|
...
|
|