Authored by 盖剑秋

Finish delivery info cell for order detail. reviewed by redding.

... ... @@ -15,6 +15,7 @@ import MultiPackageCell from './MultiPackageCell'
import YohoGiveCoinCell from './YohoGiveCoinCell'
import YohoReturnCoinCell from './YohoReturnCoinCell'
import Prompt from '../../../coupon/components/coupon/Prompt';
import DistributionInfoCell from './DistributionInfoCell'
import ReactNative, {
View,
... ... @@ -49,6 +50,9 @@ export default class Detail extends Component {
case 'orderHistory':
return (<OrderHistoryCell data={rowData}/>);
break;
case 'deliveryOffline':
return (<DistributionInfoCell/>);
break;
case 'express':
return (<ExpressCell data={rowData} onPressExpress={() => {
let {order_code, firstProductSKN, expressType} = this.props.resource;
... ... @@ -122,13 +126,19 @@ export default class Detail extends Component {
} else if (expressType == 0 && data) { //OrderDetailExpressTypeOnRecive
expressBlob = [accept_address, acceptTime];
}
let is_delivery_offline = 'N';
if (data) {
is_delivery_offline = data.get('let is_delivery_offline');
}
let showDeliveryOffline = is_delivery_offline && is_delivery_offline == 'Y';
let orderInfoBlob = {
orderCode: order_code,
orderStatus: data && data.get('status_str'),
orderTime: data && data.get('create_time'),
payWay: data && data.get('payment_name'),
expressExisted: expressBlob
expressExisted: expressBlob,
showDeliveryOffline,
}
let paymentInfoBlob = {
... ... @@ -184,6 +194,9 @@ export default class Detail extends Component {
'orderHistory': isPresaleOrder
? [orderHistoryBlob]
: [],
'deliveryOffline': showDeliveryOffline
?[1]
:[],
'express': expressBlob
? [expressBlob]
: [],
... ...
'use strict';
import React, {Component} from 'react';
import Immutable, {Map} from 'immutable';
import ReactNative, {
View,
Text,
Image,
ListView,
StyleSheet,
Dimensions,
TouchableOpacity,
InteractionManager,
Platform
} from 'react-native';
export default class DistributionInfoCell extends Component {
constructor(props) {
super(props);
}
render() {
return (
<View style={[styles.container, containerSeparator]}>
<View style={styles.leftPart}>
<Image style={{
width: 22,
height: 22
}} source={require('../../image/xxd_ic.png')}/>
</View>
<View style={[styles.rightPart, rightSeparator]}>
<View style={styles.topPart}>
<Text style={styles.codeText}>订单编号:{orderCode}</Text>
</View>
<Text style={styles.otherText}>配送方式:门店取货</Text>
</View>
</View>
);
}
}
let {width, height} = Dimensions.get('window');
let styles = StyleSheet.create({
container: {
width: width,
flexDirection: 'row',
backgroundColor: 'white',
borderColor: '#f0f0f0',
borderBottomWidth: 10
},
topPart: {
width: width - 45,
height: 20,
flexDirection: 'row',
alignItems: 'center',
marginTop: 13,
marginBottom: 2
},
codeText: {
fontSize: 14,
marginBottom: 0,
color: '#444444'
},
copyButton: {
marginLeft: 10,
width: 44,
height: 18,
borderColor: '#444444',
borderWidth: 1,
justifyContent: 'center',
alignItems: 'center'
},
leftPart: {
width: 45,
justifyContent: 'center',
alignItems: 'center'
},
rightPart: {
width: width - 45,
flexDirection: 'column',
borderColor: '#ededed',
paddingBottom: 10
},
otherText: {
fontSize: 12,
marginBottom: 3,
color: '#b0b0b0'
}
});
... ...
... ... @@ -22,9 +22,9 @@ export default class OrderInfoCell extends Component {
}
render() {
let {orderCode, orderStatus, orderTime, payWay, expressExisted} = this.props.data;
let containerSeparator = expressExisted? {borderBottomWidth:0}:{};
let rightSeparator = expressExisted?{borderBottomWidth:0.5}:{};
let {orderCode, orderStatus, orderTime, payWay, expressExisted, showDeliveryOffline} = this.props.data;
let containerSeparator = expressExisted || showDeliveryOffline ? {borderBottomWidth:0}:{};
let rightSeparator = expressExisted || showDeliveryOffline ?{borderBottomWidth:0.5}:{};
let timeInt = parseInt(orderTime) * 1000;
let date = new Date(timeInt);
let timeStr = date.getFullYear() + '.' + ((date.getMonth() + 1) > 9
... ...