Commit 5efd6b8b authored by Trisno's avatar Trisno

trans detail

parent 97df25c0
...@@ -3,6 +3,7 @@ import { View, Text, TextInput, StyleSheet, ScrollView, Alert, TouchableOpacity, ...@@ -3,6 +3,7 @@ import { View, Text, TextInput, StyleSheet, ScrollView, Alert, TouchableOpacity,
import { Card } from 'react-native-shadow-cards' 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 moment from 'moment'
class TransactionDetail extends React.Component { class TransactionDetail extends React.Component {
constructor(props) { constructor(props) {
...@@ -20,7 +21,8 @@ class TransactionDetail extends React.Component { ...@@ -20,7 +21,8 @@ class TransactionDetail extends React.Component {
trans_time: '', trans_time: '',
trans_total: '', trans_total: '',
point_reduce: '', point_reduce: '',
transaction_detail: [] transaction_detail: [],
detail_trans: ''
} }
} }
...@@ -47,9 +49,11 @@ class TransactionDetail extends React.Component { ...@@ -47,9 +49,11 @@ class TransactionDetail extends React.Component {
trans_time: data.trans_time, trans_time: data.trans_time,
trans_total: data.trans_total, trans_total: data.trans_total,
point_reduce: data.point_reduce, point_reduce: data.point_reduce,
transaction_detail: data.transaction_detail transaction_detail: data.transaction_detail,
detail_trans: data
}) })
// console.log(this.state.history_list) console.log(this.state.detail_trans)
// console.log(this.props.route.params.idTrans)
}) })
} }
...@@ -57,7 +61,9 @@ class TransactionDetail extends React.Component { ...@@ -57,7 +61,9 @@ class TransactionDetail extends React.Component {
return ( return (
<View style={styles.container}> <View style={styles.container}>
<View style={styles.header}> <View style={styles.header}>
<Text style={{ textAlign: 'center', margin: 20, fontSize: 25, alignSelf: 'center' }}>Transaction Detail</Text> <Text style={{ fontSize: 16, fontFamily: 'Gotham-Light', textAlign: 'center' }}>{this.state.detail_trans.id}</Text>
<Text style={{ fontSize: 12, fontFamily: 'Gotham-Light', textAlign: 'center' }}>{moment(this.state.detail_trans.trans_time).format('DD MMMM YYYY HH:mm:ss')}</Text>
<Text style={{ fontSize: 12, fontFamily: 'Gotham-Light', textAlign: 'center' }}>{this.state.detail_trans.trans_status_display}</Text>
</View> </View>
<View style={styles.body}> <View style={styles.body}>
<Card style={{ padding: 10, margin: 10, alignContent: 'center' }}> <Card style={{ padding: 10, margin: 10, alignContent: 'center' }}>
...@@ -100,15 +106,13 @@ const styles = StyleSheet.create({ ...@@ -100,15 +106,13 @@ const styles = StyleSheet.create({
backgroundColor: 'white', backgroundColor: 'white',
}, },
header: { header: {
justifyContent: 'center',
flex: 0.5, flex: 0.2,
borderBottomWidth:1
}, },
body: { body: {
flex: 3, flex: 0.8,
margin: 5,
}, },
list_detail_order: { list_detail_order: {
flex: 1, flex: 1,
......
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