Commit fc172df7 authored by Wahyu Adjie Prasetyo's avatar Wahyu Adjie Prasetyo

add list order

parent 3150c4e7
...@@ -4,6 +4,7 @@ import { Card } from 'react-native-shadow-cards' ...@@ -4,6 +4,7 @@ import { Card } from 'react-native-shadow-cards'
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import Axios from 'axios'; import Axios from 'axios';
import session from '../function/session'; import session from '../function/session';
import { Divider } from 'react-native-elements';
class OrderHistory extends React.Component { class OrderHistory extends React.Component {
...@@ -42,7 +43,7 @@ class OrderHistory extends React.Component { ...@@ -42,7 +43,7 @@ class OrderHistory extends React.Component {
} }
Axios.post('https://excelsocrm.ravintoladev.com/crm/v2/transaction/list', params).then(res => { Axios.post('https://excelsocrm.ravintoladev.com/crm/v2/transaction/list', params).then(res => {
let data = res.data.data let data = res.data.data
// console.log(data) console.log("ini data : " + JSON.stringify(data))
this.setState({ this.setState({
order_list: data, order_list: data,
indicator: false, indicator: false,
...@@ -63,17 +64,25 @@ class OrderHistory extends React.Component { ...@@ -63,17 +64,25 @@ class OrderHistory extends React.Component {
return ( return (
<View style={styles.container}> <View style={styles.container}>
<ScrollView style={styles.body}> <ScrollView style={styles.body}>
{this.state.indicator == true ? (<ActivityIndicator style={{ justifyContent: "center" }} size="large" color="#c9af6d" />) : {this.state.indicator == true ? (<ActivityIndicator style={{ justifyContent: "center" }} size="large" color="#c9af6d" />) :
this.state.order_list.map((item, key) => ( this.state.order_list.map((item, key) => (
<TouchableOpacity key={key} onPress={() => this.props.navigation.navigate('Order Detail', { idTrans: item.id })}> <TouchableOpacity key={key} onPress={() => this.props.navigation.navigate('Order Detail', { idTrans: item.id })}>
<View key={key}> <View style={{ marginTop: 10 }} key={key}>
<Card style={{ padding: 10, margin: 10, alignContent: 'center' }}> <View style={{ flex: 2, height: 150, margin: 10, borderRadius: 5, borderWidth: 1, flexDirection:'row' }}>
<Text>OUTLET : {item.outlet}</Text> <View style={{ justifyContent: 'center', margin: 10 }}>
<Text>TGL TRANSAKSI : {item.trans_date}</Text> <Text style={{ fontFamily: 'Gotham-Black', color: 'grey', fontSize: 20,margin:2 }}>{item.outlet}</Text>
<Text>TOTAL : {item.trans_total}</Text> <Text style={{ fontFamily: 'Gotham-Light', color: 'grey', fontSize: 20,margin:2 }}>{item.trans_date}</Text>
<Text>STATUS : {item.trans_status_display}</Text> <Text style={{ fontFamily: 'Gotham-Black', color: '#c9af6d', fontSize: 20,margin:2 }}>{item.trans_status_display}</Text>
</Card> <TouchableOpacity onPress={() => this.handleLoggin()}>
<View style={{ height: 40, borderRadius: 10, backgroundColor: '#CFB368',justifyContent:'center'}}>
<Text style={{ fontFamily: 'Gotham-Black', color: 'white', fontSize: 20, textAlign: 'center', margin: 15 }}>Lihat Detail Pemesanan</Text>
</View>
</TouchableOpacity>
</View>
<View style={{ justifyContent: 'center', marginTop: 5 }}>
</View>
</View>
</View> </View>
</TouchableOpacity> </TouchableOpacity>
)) ))
......
...@@ -11,7 +11,7 @@ export default class TopUpInfo extends React.Component { ...@@ -11,7 +11,7 @@ export default class TopUpInfo extends React.Component {
super(props); super(props);
this.state = { this.state = {
topup_info: [], topup_info: [],
statusbar_height: 50 statusbar_height: 40
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment