Authored by 盖剑秋

Finish order detial UI. reiviewed by Boss Hai.

... ... @@ -11,6 +11,11 @@ import ExpressCell from './ExpressCell'
import ProductListCell from './ProductListCell'
import InvoiceCell from './InvoiceCell'
import OrderHistoryCell from './OrderHistoryCell'
import MultiPackageCell from './MultiPackageCell'
import YohoGiveCoinCell from './YohoGiveCoinCell'
import YohoReturnCoinCell from './YohoReturnCoinCell'
import Prompt from '../../../coupon/components/coupon/Prompt';
import ReactNative, {
View,
... ... @@ -40,13 +45,24 @@ export default class Detail extends Component {
return (<AddressCell channel={this.props.channel} data={rowData}/>);
break;
case 'orderInfo':
return (<OrderInfoCell data={rowData}/>);
return (<OrderInfoCell data={rowData} onPressCopy={this.props.onPressCopy}/>);
break;
case 'orderHistory':
return (<OrderHistoryCell data={rowData}/>);
break;
case 'express':
return (<ExpressCell data={rowData}/>);
return (<ExpressCell data={rowData} onPressExpress={() => {
let {order_code, firstProductSKN, expressType} = this.props.resource;
let param = {
orderCode: order_code,
productSKN: firstProductSKN,
expressType: expressType,
}
this.onPressExpress&&this.onPressExpress(param);
}}/>);
break;
case 'multiPackage':
return (<MultiPackageCell data={rowData}/>);
break;
case 'productList':
return (<ProductListCell data={rowData}/>);
... ... @@ -54,6 +70,12 @@ export default class Detail extends Component {
case 'paymentInfo':
return (<PaymentInfoCell data={rowData}/>);
break;
case 'yoho_give_coin':
return (<YohoGiveCoinCell data={rowData}/>);
break;
case 'return_yoho_coin_num':
return (<YohoReturnCoinCell data={rowData}/>);
break;
case 'invoice':
return (<InvoiceCell data={rowData}/>);
break;
... ... @@ -99,9 +121,18 @@ export default class Detail extends Component {
let isVirtualOrder = false;
let isPresaleOrder = false;
let isMultiPackage = false;
let yoho_give_coin = 0;
let packageTitle = '';
let return_yoho_coin_num = 0;
if (data) {
isVirtualOrder = data.get('attribute') == '3';
isPresaleOrder = data.get('attribute') == '9';
isMultiPackage = data.get('is_multi_package') == 'Y';
packageTitle = data.get('package_title');
yoho_give_coin = data.get('yoho_give_coin');
return_yoho_coin_num = data.get('return_yoho_coin_num');
}
let orderHistoryBlob = null;
... ... @@ -138,12 +169,21 @@ export default class Detail extends Component {
'express': expressBlob
? [expressBlob]
: [],
'multiPackage': isMultiPackage && packageTitle.length
?[packageTitle]
:[],
'productList': data
? [productListBlob]
: [],
'paymentInfo': data
? [paymentInfoBlob]
: [],
'yoho_give_coin': yoho_give_coin
? [yoho_give_coin]
: [],
'return_yoho_coin_num': return_yoho_coin_num
?[return_yoho_coin_num]
:[],
'invoice': invoiceBlob
? [invoiceBlob]
: [],
... ...
... ... @@ -23,7 +23,11 @@ export default class ExpressCell extends Component {
render() {
return (
<TouchableOpacity style={styles.container}>
<TouchableOpacity style={styles.container} onPress={
() => {
this.props.onPressExpress && this.props.onPressExpress();
}
}>
<View style={styles.leftPart}>
<Image style={{
width: 22,
... ...
'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 MultiPackageCell extends Component {
constructor(props) {
super(props);
}
render() {
return (
<TouchableOpacity style={styles.container}>
<View style={styles.leftPart}>
<Text style={styles.codeText}>{this.props.data}</Text>
</View>
<Image style={{
width: 15,
height: 15
}} source={require('../../image/shared_next_icon.png')}/>
</TouchableOpacity>
);
}
}
let {width, height} = Dimensions.get('window');
let styles = StyleSheet.create({
container: {
width: width,
flexDirection: 'row',
backgroundColor: 'white',
borderColor: '#ededed',
alignItems: 'center',
borderBottomWidth: 0.5
},
codeText: {
fontSize: 14,
marginBottom: 0,
color: '#444444',
marginLeft: 15,
},
leftPart: {
height: 44,
width: width - 30,
flexDirection: 'row',
alignItems: 'center',
},
});
... ...
... ... @@ -49,7 +49,11 @@ export default class OrderInfoCell extends Component {
<View style={[styles.rightPart, rightSeparator]}>
<View style={styles.topPart}>
<Text style={styles.codeText}>订单编号:{orderCode}</Text>
<TouchableOpacity style={styles.copyButton}>
<TouchableOpacity style={styles.copyButton} onPress={
() => {
this.props.onPressCopy&&this.props.onPressCopy(orderCode)
}
}>
<Text style={{
fontSize: 12,
color: '#444444'
... ...
'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 YohoGiveCoinCell extends Component {
constructor(props) {
super(props);
}
render() {
return (
<View style={styles.container}>
<View style={styles.leftPart}>
<Image style={{
width: 15,
height: 15,
marginLeft: 15,
}} source={require('../../image/orderdetail_yohocoin.png')}/>
<Text style={styles.codeText}>共返有货币: {this.props.data}</Text>
</View>
</View>
);
}
}
let {width, height} = Dimensions.get('window');
let styles = StyleSheet.create({
container: {
width: width,
flexDirection: 'row',
backgroundColor: 'white',
borderColor: '#f0f0f0',
alignItems: 'center',
borderBottomWidth: 10
},
codeText: {
fontSize: 14,
marginBottom: 0,
color: '#444444',
marginLeft: 15,
},
leftPart: {
height: 44,
width: width - 30,
flexDirection: 'row',
alignItems: 'center',
borderColor: '#ededed',
borderBottomWidth: 0.5,
borderTopWidth: 0.5,
},
});
... ...
'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 YohoReturnCoinCell extends Component {
constructor(props) {
super(props);
}
render() {
return (
<TouchableOpacity style={styles.container}>
<View style={styles.leftPart}>
<Text style={styles.codeText}>退还/赔付有货币 {this.props.data}</Text>
</View>
<Image style={{
width: 15,
height: 15
}} source={require('../../image/shared_next_icon.png')}/>
</TouchableOpacity>
);
}
}
let {width, height} = Dimensions.get('window');
let styles = StyleSheet.create({
container: {
width: width,
flexDirection: 'row',
backgroundColor: 'white',
borderColor: '#f0f0f0',
alignItems: 'center',
borderBottomWidth: 10
},
codeText: {
fontSize: 14,
marginBottom: 0,
color: '#444444',
marginLeft: 15,
},
leftPart: {
height: 44,
width: width - 30,
flexDirection: 'row',
alignItems: 'center',
borderColor: '#ededed',
borderBottomWidth: 0.5,
borderTopWidth: 0.5,
},
});
... ...
... ... @@ -48,6 +48,8 @@ class DetailContainer extends Component {
super(props);
this.onPressFooterAction = this.onPressFooterAction.bind(this);
this.refreshDetail = this.refreshDetail.bind(this);
this.onPressCopy = this.onPressCopy.bind(this);
this.onPressExpress = this.onPressExpress.bind(this);
this.subscription = NativeAppEventEmitter.addListener(
'YHNotificationChangeOnLinePayToCodPay',
(reminder) => {
... ... @@ -69,7 +71,15 @@ class DetailContainer extends Component {
}
onPressFooterAction(buttonType) {
ReactNative.NativeModules.YH_OrderHelper.rnAction();
}
onPressCopy(orderCode) {
ReactNative.NativeModules.YH_OrderHelper.copyCode(orderCode);
}
onPressExpress(param) {
ReactNative.NativeModules.YH_OrderHelper.onPressExpress(param);
}
render() {
... ... @@ -80,6 +90,8 @@ class DetailContainer extends Component {
channel={app.channel}
onPressFooterAction={this.onPressFooterAction}
refreshDetail={this.refreshDetail}
onPressCopy={this.onPressCopy}
onPressExpress={this.onPressExpress}
/>
);
}
... ...