OrderPage.js
2.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
'use strict';
import React, {Component} from 'react';
import ReactNative, {
View,
Text,
Image,
StyleSheet,
Dimensions,
InteractionManager,
Platform,
} from 'react-native';
import {Map, Record} from 'immutable';
import OrderList from './OrderList';
import AntiFraudTip from '../detail/AntiFraudTip';
import ScrollableTabView,{DefaultTabBar} from 'react-native-scrollable-tab-view';
export default class OrderPage extends Component {
constructor(props) {
super(props);
}
render(){
let list = this.props.resource;
let initialPage = list.get('defaultPageIndex');
let showAntiFraud = this.props.showAntiFraud;
let types = [];
types.push({type: 'all',name: '全部'});
types.push({type: 'onPay',name: '待付款'});
types.push({type: 'onDelivery',name: '待发货'});
types.push({type: 'onReceive',name: '待收货'});
return(
<View style={styles.container}>
{showAntiFraud ? <AntiFraudTip onPressAntiFraudTip={this.props.onPressAntiFraudTip}/> : null}
<ScrollableTabView
initialPage={initialPage}
renderTabBar={() => <DefaultTabBar
style={{height:38, borderWidth: 0.5, borderBottomColor: '#ededed', backgroundColor: 'white'}}
textStyle={{paddingTop:10, fontFamily: 'STHeitiSC-Light', fontSize: 14, fontWeight: 'normal'}}
underlineHeight={0}
activeTextColor={'black'}
inactiveTextColor={'#b0b0b0'} />
}
onChangeTab={(obj) => {
}}
>
{types.map((item, i) => {
let type = item.type;
let name = item.name;
return (
<OrderList
tabLabel={name}
key={i}
dataSource={list.get(type)}
type={type}
onRefresh={this.props.onRefresh}
onLoadMore={this.props.onLoadMore}
orderAction={this.props.orderAction}
onGoDetail={this.props.onGoDetail}
onPressDelayNotice={this.props.showDelayDeliveryNotice}
onPressEmptyItem={this.props.onPressEmptyItem}
/>
);
})}
</ScrollableTabView>
</View>
);
}
}
let {width, height} = Dimensions.get('window');
let styles = StyleSheet.create({
container: {
flex: 1,
flexDirection: 'column',
backgroundColor: '#ededed'
},
});