...
|
...
|
@@ -14,7 +14,8 @@ import ReactNative, { |
|
|
import Immutable, {Map} from 'immutable';
|
|
|
import Toast from '../../../common/components/Toast';
|
|
|
import MyOrderDetailPayListCell from './MyOrderDetailPayListCell';
|
|
|
|
|
|
import YH_Image from '../../../common/components/YH_Image';
|
|
|
import SlicedImage from '../../../common/components/SlicedImage';
|
|
|
|
|
|
export default class MyOrderDetail extends React.Component {
|
|
|
constructor(props) {
|
...
|
...
|
@@ -27,35 +28,53 @@ export default class MyOrderDetail extends React.Component { |
|
|
|
|
|
|
|
|
renderRow(rowData, sectionID, rowID, highlightRow) {
|
|
|
|
|
|
return (
|
|
|
<MyOrderDetailPayListCell
|
|
|
data={rowData}
|
|
|
onPressOrder={this.props.onPressOrder}
|
|
|
|
|
|
/>
|
|
|
);
|
|
|
}
|
|
|
|
|
|
render() {
|
|
|
|
|
|
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 orderInfo = this.props.orderInfo;
|
|
|
|
|
|
if(!orderInfo)
|
|
|
return null;
|
|
|
|
|
|
//订单商品
|
|
|
let orderGoods = orderInfo.get("order_goods") ? orderInfo.get("order_goods").get(0) : null;
|
|
|
let productName = orderGoods ? orderGoods.get("product_name") : "";
|
|
|
let goodsImage = orderGoods ? orderGoods.get("goods_image") : "";
|
|
|
goodsImage = goodsImage ? SlicedImage.getSlicedUrl(goodsImage, 45, 60, 2) : "";
|
|
|
|
|
|
let orderCode = orderInfo.get("order_code") ? ("订单编号:" + orderInfo.get("order_code")) : "";
|
|
|
let orderTime = orderInfo.get("create_time");
|
|
|
let orderAmount = orderInfo.get("amount");
|
|
|
let avgAmount = orderInfo.get("avg_principal_amt");
|
|
|
let avgFeeAmount = orderInfo.get("avg_fee_amt");
|
|
|
let totalAmount = orderInfo.get("total_amt");
|
|
|
//退款金额
|
|
|
let refundNum = orderInfo.get("refund_num");
|
|
|
|
|
|
//分期列表
|
|
|
let package_list = orderInfo.get("package_list") ? orderInfo.get("package_list").toArray() : [];
|
|
|
|
|
|
let checked = this.props.isChecked;
|
|
|
let checkboxIcon = require('../../image/uncheck_icon.png');
|
|
|
if (!checked) {
|
|
|
checkboxIcon = require('../../image/check_icon.png');
|
|
|
}
|
|
|
|
|
|
return (
|
|
|
<View style={styles.container}>
|
|
|
{
|
|
|
refundNum ? <Text style={styles.refundMsg} numberOfLines={1}>{"该订单已退款" + refundNum + "元"}</Text> : null
|
|
|
}
|
|
|
<View style={styles.goodsInfoContainer}>
|
|
|
<Image style={styles.goodsImage} source={require("../../image/bank/bank-ABC.png")} />
|
|
|
<Text style={styles.goodsName} numberOfLines={1}>{goodsName}</Text>
|
|
|
<YH_Image style={styles.goodsImage} url={goodsImage}/>
|
|
|
<Text style={styles.productName} numberOfLines={1}>{productName}</Text>
|
|
|
<Text style={styles.orderCode} numberOfLines={1}>{orderCode}</Text>
|
|
|
<Text style={styles.orderTime} numberOfLines={1}>{orderTime}</Text>
|
|
|
</View>
|
...
|
...
|
@@ -63,15 +82,15 @@ export default class MyOrderDetail extends React.Component { |
|
|
<View style={styles.installmentInfoContainer}>
|
|
|
<View style={styles.installmentInfoCell}>
|
|
|
<Text style={styles.installmentInfoCellText}>分期应还</Text>
|
|
|
<Text style={styles.installmentInfoCellText}>{"555"}</Text>
|
|
|
<Text style={styles.installmentInfoCellText}>{avgAmount}</Text>
|
|
|
</View>
|
|
|
<View style={styles.installmentInfoCell}>
|
|
|
<Text style={styles.installmentInfoCellText}>分期服务费</Text>
|
|
|
<Text style={styles.installmentInfoCellText}>{"555"}</Text>
|
|
|
<Text style={styles.installmentInfoCellText}>{avgFeeAmount}</Text>
|
|
|
</View>
|
|
|
<View style={styles.installmentInfoCell}>
|
|
|
<Text style={styles.installmentInfoCellText}>总计应还</Text>
|
|
|
<Text style={styles.installmentInfoCellText}>{"555"}</Text>
|
|
|
<Text style={styles.installmentInfoCellText}>{totalAmount}</Text>
|
|
|
</View>
|
|
|
</View>
|
|
|
<View style={styles.splitLine}></View>
|
...
|
...
|
@@ -79,15 +98,24 @@ export default class MyOrderDetail extends React.Component { |
|
|
<View style={styles.splitLine}></View>
|
|
|
<ListView
|
|
|
style={styles.payListContainer}
|
|
|
dataSource={this.dataSource.cloneWithRows(cardList)}
|
|
|
dataSource={this.dataSource.cloneWithRows(package_list)}
|
|
|
enableEmptySections={true}
|
|
|
renderRow={this.renderRow}
|
|
|
/>
|
|
|
<View style={styles.splitLine}></View>
|
|
|
<View style={styles.bottomContainer}>
|
|
|
<TouchableOpacity activeOpacity={1} onPress={() => {
|
|
|
<View style={styles.checkboxContainer}>
|
|
|
<Image style={styles.checkboxIcon} source={checkboxIcon}/>
|
|
|
</View>
|
|
|
<View style={styles.payMoneyContainer}>
|
|
|
<Text style={styles.payTitle} numberOfLines={1}>待支付</Text>
|
|
|
<Text style={styles.payAmount} numberOfLines={1}>{"¥ 555"}</Text>
|
|
|
</View>
|
|
|
<Text style={styles.payDesc} numberOfLines={1}>{"含服务费¥5.00"}</Text>
|
|
|
|
|
|
<TouchableOpacity style={styles.payButtonContainer} activeOpacity={1} onPress={() => {
|
|
|
this.props.onPressChangeCard && this.props.onPressChangeCard();}}>
|
|
|
<Text style={styles.changeButton}>立即还款</Text>
|
|
|
<Text style={styles.payButton}>立即还款</Text>
|
|
|
</TouchableOpacity>
|
|
|
</View>
|
|
|
|
...
|
...
|
@@ -118,6 +146,16 @@ let styles = StyleSheet.create({ |
|
|
backgroundColor: "#f0f0f0",
|
|
|
},
|
|
|
|
|
|
refundMsg:{
|
|
|
width: width,
|
|
|
height: 35 * DEVICE_WIDTH_RATIO,
|
|
|
backgroundColor: "#707070",
|
|
|
color: "#ffffff",
|
|
|
fontSize: 14 * DEVICE_WIDTH_RATIO,
|
|
|
paddingTop: 8 * DEVICE_WIDTH_RATIO,
|
|
|
paddingLeft: 15 * DEVICE_WIDTH_RATIO,
|
|
|
},
|
|
|
|
|
|
goodsInfoContainer:{
|
|
|
width: width,
|
|
|
height: 80 * DEVICE_WIDTH_RATIO,
|
...
|
...
|
@@ -131,7 +169,7 @@ let styles = StyleSheet.create({ |
|
|
height: 60 * DEVICE_WIDTH_RATIO,
|
|
|
},
|
|
|
|
|
|
goodsName:{
|
|
|
productName:{
|
|
|
position: 'absolute',
|
|
|
top: 15 * DEVICE_WIDTH_RATIO,
|
|
|
left: 70 * DEVICE_WIDTH_RATIO,
|
...
|
...
|
@@ -184,19 +222,65 @@ let styles = StyleSheet.create({ |
|
|
height: 60 * DEVICE_WIDTH_RATIO,
|
|
|
},
|
|
|
|
|
|
checkboxContainer:{
|
|
|
position: 'absolute',
|
|
|
top: 0,
|
|
|
left: 0,
|
|
|
width: 50 * DEVICE_WIDTH_RATIO,
|
|
|
height: 60 * DEVICE_WIDTH_RATIO,
|
|
|
justifyContent: 'center',
|
|
|
alignItems: 'center',
|
|
|
},
|
|
|
|
|
|
checkboxIcon:{
|
|
|
width: 20 * DEVICE_WIDTH_RATIO,
|
|
|
height: 20 * DEVICE_WIDTH_RATIO,
|
|
|
},
|
|
|
|
|
|
payMoneyContainer:{
|
|
|
position: 'absolute',
|
|
|
top: 15 * DEVICE_WIDTH_RATIO,
|
|
|
left: 50 * DEVICE_WIDTH_RATIO,
|
|
|
flexDirection: 'row',
|
|
|
},
|
|
|
|
|
|
payTitle:{
|
|
|
color: "#444444",
|
|
|
fontSize: 14 * DEVICE_WIDTH_RATIO,
|
|
|
},
|
|
|
|
|
|
payAmount:{
|
|
|
color: "#ff0000",
|
|
|
fontSize: 14 * DEVICE_WIDTH_RATIO,
|
|
|
},
|
|
|
|
|
|
payDesc:{
|
|
|
position: 'absolute',
|
|
|
top: 35 * DEVICE_WIDTH_RATIO,
|
|
|
left: 50 * DEVICE_WIDTH_RATIO,
|
|
|
color: "#b0b0b0",
|
|
|
fontSize: 12 * DEVICE_WIDTH_RATIO,
|
|
|
},
|
|
|
|
|
|
payButtonContainer:{
|
|
|
position: 'absolute',
|
|
|
top: 10 * DEVICE_WIDTH_RATIO,
|
|
|
right: 15 * DEVICE_WIDTH_RATIO,
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
changeButton:{
|
|
|
width: 130 * DEVICE_WIDTH_RATIO,
|
|
|
height: 44 * DEVICE_WIDTH_RATIO,
|
|
|
payButton:{
|
|
|
width: 110 * DEVICE_WIDTH_RATIO,
|
|
|
height: 40 * DEVICE_WIDTH_RATIO,
|
|
|
fontSize:14 * DEVICE_WIDTH_RATIO,
|
|
|
paddingTop:12 * DEVICE_WIDTH_RATIO,
|
|
|
marginLeft: 8 * DEVICE_WIDTH_RATIO,
|
|
|
color: '#ffffff',
|
|
|
textAlign: 'center',
|
|
|
borderColor:'#cc0009',
|
|
|
borderWidth:2,
|
|
|
borderRadius: 6,
|
|
|
backgroundColor:'#cc0009',
|
|
|
paddingTop: 10 * DEVICE_WIDTH_RATIO,
|
|
|
},
|
|
|
|
|
|
|
...
|
...
|
|