Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
C
clone_excelso
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Prasetya Saputra
clone_excelso
Commits
fad49a78
Commit
fad49a78
authored
May 19, 2020
by
Trisno
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update trans history detail
parent
4e58e227
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
372 additions
and
40 deletions
+372
-40
OrderDetail.js
view/OrderDetail.js
+194
-36
TransactionDetail.js
view/TransactionDetail.js
+178
-4
No files found.
view/OrderDetail.js
View file @
fad49a78
import
React
from
'react'
;
import
React
from
'react'
;
import
{
View
,
Text
,
TextInput
,
StyleSheet
,
ScrollView
,
Alert
,
TouchableOpacity
,
BackHandler
}
from
'react-native'
;
import
{
View
,
Text
,
TextInput
,
StyleSheet
,
ScrollView
,
Alert
,
TouchableOpacity
,
BackHandler
}
from
'react-native'
;
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
session
from
'../function/session'
;
import
session
from
'../function/session'
;
import
moment
from
'moment'
import
{
FontAwesome
}
from
'@expo/vector-icons'
;
class
OrderDetail
extends
React
.
Component
{
class
OrderDetail
extends
React
.
Component
{
...
@@ -11,11 +13,13 @@ class OrderDetail extends React.Component {
...
@@ -11,11 +13,13 @@ class OrderDetail extends React.Component {
super
(
props
)
super
(
props
)
this
.
handleBackButtonClick
=
this
.
handleBackButtonClick
.
bind
(
this
)
this
.
handleBackButtonClick
=
this
.
handleBackButtonClick
.
bind
(
this
)
this
.
state
=
{
this
.
state
=
{
trans_type_display
:
''
,
trans_type_display
:
''
,
outlet
:
''
,
outlet
:
''
,
outlet_code
:
''
,
outlet_code
:
''
,
trans_status_display
:
''
,
trans_status_display
:
''
,
transaction_detail
:[],
transaction_detail
:
[],
numberId
:
''
,
detail_trans
:
''
,
}
}
...
@@ -35,7 +39,7 @@ class OrderDetail extends React.Component {
...
@@ -35,7 +39,7 @@ class OrderDetail extends React.Component {
handleBackButtonClick
()
{
handleBackButtonClick
()
{
this
.
props
.
navigation
.
navigate
(
'Home'
,
{
screen
:
'ORDER'
});
this
.
props
.
navigation
.
navigate
(
'Home'
,
{
screen
:
'ORDER'
});
return
true
;
return
true
;
}
}
...
@@ -44,7 +48,7 @@ class OrderDetail extends React.Component {
...
@@ -44,7 +48,7 @@ class OrderDetail extends React.Component {
session_id
:
this
.
props
.
session_id
,
session_id
:
this
.
props
.
session_id
,
transaction_id
:
this
.
props
.
trans_id
transaction_id
:
this
.
props
.
trans_id
}
}
console
.
log
(
"PARAMETER : "
+
JSON
.
stringify
(
params
))
//
console.log("PARAMETER : " + JSON.stringify(params))
Axios
.
post
(
'https://excelsocrm.ravintoladev.com/crm/v2/transaction/detail'
,
params
).
then
(
res
=>
{
Axios
.
post
(
'https://excelsocrm.ravintoladev.com/crm/v2/transaction/detail'
,
params
).
then
(
res
=>
{
let
data
=
res
.
data
let
data
=
res
.
data
// console.log("INI OUTLET "+ data.outlet)
// console.log("INI OUTLET "+ data.outlet)
...
@@ -55,7 +59,9 @@ class OrderDetail extends React.Component {
...
@@ -55,7 +59,9 @@ class OrderDetail extends React.Component {
outlet
:
data
.
outlet
,
outlet
:
data
.
outlet
,
outlet_code
:
data
.
outlet_code
,
outlet_code
:
data
.
outlet_code
,
trans_status_display
:
data
.
trans_status_display
,
trans_status_display
:
data
.
trans_status_display
,
transaction_detail
:
data
.
transaction_detail
transaction_detail
:
data
.
transaction_detail
,
detail_trans
:
data
,
numberId
:
data
.
id
.
substring
(
0
,
5
).
toUpperCase
()
})
})
}).
catch
(
error
=>
{
}).
catch
(
error
=>
{
...
@@ -72,11 +78,161 @@ class OrderDetail extends React.Component {
...
@@ -72,11 +78,161 @@ class OrderDetail extends React.Component {
}
}
render
()
{
render
()
{
// console.log(this.state.order_list)
// console.log(this.state.detail_trans)
// console.log(this.state.detail_trans.used_reward)
return
(
return
(
<
View
style
=
{
styles
.
container
}
>
<
View
style
=
{
styles
.
container
}
>
<
View
style
=
{
styles
.
header
}
>
<
Text
style
=
{{
fontSize
:
16
,
fontFamily
:
'Gotham-Light'
,
textAlign
:
'center'
}}
>
#
{
this
.
state
.
numberId
}
<
/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
>
<
ScrollView
style
=
{
styles
.
body
}
>
<
ScrollView
style
=
{
styles
.
body
}
>
<
View
>
<
View
style
=
{{
flex
:
1
,
flexDirection
:
'row'
,
borderBottomWidth
:
1
,
margin
:
10
,
paddingBottom
:
30
,
padding
:
10
}}
>
<
View
style
=
{{
flex
:
0.1
,
justifyContent
:
'center'
}}
>
<
FontAwesome
name
=
"map-marker"
size
=
{
24
}
color
=
"red"
/>
<
/View
>
{
this
.
state
.
detail_trans
.
trans_type_display
==
'Pick Up'
?
(
<
View
style
=
{{
flex
:
0.6
,
justifyContent
:
'center'
}}
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
}}
>
{
this
.
state
.
outlet
}
<
/Text
>
<
/View
>
)
:
(
<
View
style
=
{{
flex
:
0.6
,
justifyContent
:
'center'
}}
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
}}
>
{
this
.
state
.
recipient_address
}
<
/Text
>
<
/View
>
)
}
{
this
.
state
.
detail_trans
.
trans_type_display
==
'Pick Up'
?
(
<
View
style
=
{{
flex
:
0.3
,
justifyContent
:
'center'
}}
>
<
Text
style
=
{{
textAlign
:
'right'
,
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
}}
>
PICKUP
<
/Text
>
<
/View
>
)
:
(
<
View
style
=
{{
flex
:
0.3
,
justifyContent
:
'center'
}}
>
<
Text
style
=
{{
textAlign
:
'right'
,
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
}}
>
DELIVERY
<
/Text
>
<
/View
>
)
}
<
/View
>
<
View
style
=
{{
margin
:
10
,
paddingLeft
:
10
}}
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
}}
>
Pesanan
<
/Text
>
<
/View
>
{
this
.
state
.
transaction_detail
.
map
((
item
,
index
)
=>
{
// total = total + item.quantity * item.price
return
(
<
View
style
=
{{
margin
:
10
}}
key
=
{
index
}
>
<
View
style
=
{{
flex
:
1
,
margin
:
10
,
flexDirection
:
'row'
,
justifyContent
:
'space-around'
}}
>
<
View
style
=
{{
flex
:
0.3
,
alignItems
:
'center'
}}
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
}}
>
{
item
.
item_quantity
}
<
/Text
>
<
/View
>
<
View
style
=
{{
flex
:
0.1
,
alignItems
:
'flex-start'
}}
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
}}
>
x
<
/Text
>
<
/View
>
<
View
style
=
{{
flex
:
0.3
,
alignItems
:
'baseline'
}}
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
}}
>
{
item
.
item_name
}
<
/Text
>
<
/View
>
<
View
style
=
{{
flex
:
0.3
,
alignItems
:
'flex-end'
}}
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
}}
>
{
item
.
item_quantity
*
item
.
item_price
}
<
/Text
>
<
/View
>
<
/View
>
<
/View
>
)
})
}
{
/* {
this.state.detail_trans.used_reward.length < 0 ? (
null
) : (
<>
<View style={{ borderTopWidth: 1, margin: 10, padding: 10 }}>
<Text style={{ fontSize: 12, fontFamily: 'Gotham-Light' }}>Voucher</Text>
</View>
<View style={{ flexDirection: 'row', justifyContent: 'space-between', margin: 10, marginTop: -10 }}>
<View style={{ margin: 10, paddingLeft: 10 }}>
<Text style={{ fontSize: 12, fontFamily: 'Gotham-Light' }}>{this.props.voucher.reward.title}</Text>
</View>
<TouchableOpacity onPress={() => this.props.navigation.navigate('Reward Detail', { rewardId: this.props.voucher.id })}>
<View style={{ margin: 10, paddingRight: 5 }}>
<Text style={{ fontSize: 12, fontFamily: 'Gotham-Light', color: '#CFB368' }}>View Detail</Text>
</View>
</TouchableOpacity>
</View>
</>
)
} */
}
<
View
style
=
{{
borderTopWidth
:
1
,
margin
:
10
,
paddingLeft
:
10
,
padding
:
20
,
paddingBottom
:
-
10
}}
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
}}
>
Payment
<
/Text
>
<
/View
>
<
View
style
=
{{
flexDirection
:
'row'
,
justifyContent
:
'space-between'
,
margin
:
10
,
marginTop
:
-
10
}}
>
<
View
style
=
{{
margin
:
10
,
paddingLeft
:
10
}}
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
}}
>
Balance
Used
<
/Text
>
<
/View
>
<
View
style
=
{{
margin
:
10
,
paddingRight
:
5
}}
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
}}
>
{
this
.
state
.
detail_trans
.
trans_paid
}
<
/Text
>
<
/View
>
<
/View
>
<
View
style
=
{{
flexDirection
:
'row'
,
justifyContent
:
'space-between'
,
margin
:
10
,
marginTop
:
-
10
}}
>
<
View
style
=
{{
margin
:
10
,
paddingLeft
:
10
}}
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
}}
>
Point
Used
<
/Text
>
<
/View
>
<
View
style
=
{{
margin
:
10
,
paddingRight
:
5
}}
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
}}
>
{
this
.
state
.
detail_trans
.
point_booked
}
<
/Text
>
<
/View
>
<
/View
>
<
View
style
=
{{
borderTopWidth
:
1
,
margin
:
10
,
paddingLeft
:
10
,
padding
:
20
,
paddingBottom
:
-
10
,
flexDirection
:
'row'
,
justifyContent
:
'space-between'
,
flex
:
1
,
flexDirection
:
'row'
}}
>
<
View
style
=
{{
flex
:
0.6
}}
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
}}
>
Harga
<
/Text
>
<
/View
>
<
View
style
=
{{
flex
:
0.4
,
marginRight
:
-
5
}}
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
,
textAlign
:
'right'
}}
>
{
this
.
state
.
detail_trans
.
trans_subtotal
}
<
/Text
>
<
/View
>
<
/View
>
{
this
.
state
.
detail_trans
.
trans_discount
==
''
?
(
null
)
:
(
<
View
style
=
{{
margin
:
10
,
marginTop
:
-
10
,
paddingLeft
:
10
,
padding
:
20
,
paddingBottom
:
-
10
,
flexDirection
:
'row'
,
justifyContent
:
'space-between'
,
flex
:
1
,
flexDirection
:
'row'
}}
>
<
View
style
=
{{
flex
:
0.6
}}
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
}}
>
Voucher
<
/Text
>
<
/View
>
<
View
style
=
{{
flex
:
0.4
,
marginRight
:
-
5
}}
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
,
textAlign
:
'right'
}}
>-
{
this
.
state
.
detail_trans
.
trans_discount
}
<
/Text
>
<
/View
>
<
/View
>
)
}
{
/* {
this.props.type_pickup == true ? (
null
) : (
<View style={{ margin: 10, marginTop: -10, paddingLeft: 10, padding: 20, paddingBottom: -10, flexDirection: 'row', justifyContent: 'space-between', flex: 1, flexDirection: 'row' }}>
<View style={{ flex: 0.6 }}>
<Text style={{ fontSize: 12, fontFamily: 'Gotham-Light' }}>Ongkos Kirim</Text>
</View>
<View style={{ flex: 0.4, marginRight: -5 }}>
<Text style={{ fontSize: 12, fontFamily: 'Gotham-Light', textAlign: 'right' }}>{this.props.grabamount}</Text>
</View>
</View>
)
} */
}
<
View
style
=
{{
margin
:
10
,
marginTop
:
-
10
,
paddingLeft
:
10
,
padding
:
20
,
paddingBottom
:
-
10
,
flexDirection
:
'row'
,
justifyContent
:
'space-between'
,
flex
:
1
,
flexDirection
:
'row'
}}
>
<
View
style
=
{{
flex
:
0.6
}}
>
<
Text
style
=
{{
fontSize
:
20
,
fontFamily
:
'Gotham-Black'
,
color
:
'#CFB368'
}}
>
Total
<
/Text
>
<
/View
>
<
View
style
=
{{
flex
:
0.4
,
marginRight
:
-
5
}}
>
<
Text
style
=
{{
fontSize
:
20
,
fontFamily
:
'Gotham-Black'
,
textAlign
:
'right'
,
color
:
'#CFB368'
}}
>
{
this
.
state
.
detail_trans
.
trans_total
}
<
/Text
>
<
/View
>
<
/View
>
{
/* <View>
<Card style={{ padding: 10, margin: 10, alignContent: 'center' }}>
<Card style={{ padding: 10, margin: 10, alignContent: 'center' }}>
<Text>OUTLET : {this.state.outlet}</Text>
<Text>OUTLET : {this.state.outlet}</Text>
<Text>OUTLET CODE : {this.state.outlet_code}</Text>
<Text>OUTLET CODE : {this.state.outlet_code}</Text>
...
@@ -84,14 +240,14 @@ class OrderDetail extends React.Component {
...
@@ -84,14 +240,14 @@ class OrderDetail extends React.Component {
</Card>
</Card>
<Card style={{ padding: 10, margin: 10, alignContent: 'center' }}>
<Card style={{ padding: 10, margin: 10, alignContent: 'center' }}>
{
{
this
.
state
.
transaction_detail
.
map
((
item
,
index
)
=>
{
this.state.transaction_detail.map((item, index) =>
{
return
(
return
(
<View key={index}>
<View key={index}>
<Text>NAMA ITEM : {item.item_name}</Text>
<Text>NAMA ITEM : {item.item_name}</Text>
<Text>QTY : {item.item_quantity}</Text>
<Text>QTY : {item.item_quantity}</Text>
<Text>PRICE : {item.item_price}</Text>
<Text>PRICE : {item.item_price}</Text>
<Text>DISCOUNT : {item.item_discount}</Text>
<Text>DISCOUNT : {item.item_discount}</Text>
<
View
style
=
{{
borderWidth
:
1
,
margin
:
10
}}
><
/View
>
<View style={{
borderWidth: 1, margin: 10
}}></View>
<Text>TOTAL : {item.item_subtotal}</Text>
<Text>TOTAL : {item.item_subtotal}</Text>
</View>
</View>
)
)
...
@@ -101,7 +257,7 @@ class OrderDetail extends React.Component {
...
@@ -101,7 +257,7 @@ class OrderDetail extends React.Component {
<Card style={{ padding: 10, margin: 10, alignContent: 'center' }}>
<Card style={{ padding: 10, margin: 10, alignContent: 'center' }}>
<Text>{}</Text>
<Text>{}</Text>
</Card>
</Card>
<
/View
>
</View> */
}
<
/ScrollView
>
<
/ScrollView
>
<
/View
>
<
/View
>
)
)
...
@@ -114,12 +270,14 @@ const styles = StyleSheet.create({
...
@@ -114,12 +270,14 @@ const styles = StyleSheet.create({
backgroundColor
:
'white'
,
backgroundColor
:
'white'
,
},
},
header
:
{
header
:
{
justifyContent
:
'center'
,
flex
:
0.2
,
flex
:
0.2
,
borderBottomWidth
:
1
,
margin
:
10
},
},
body
:
{
body
:
{
flex
:
3
,
flex
:
0.8
,
margin
:
5
,
margin
:
5
,
},
},
list_detail_order
:
{
list_detail_order
:
{
...
@@ -133,7 +291,7 @@ const mapStateToProps = (state) => {
...
@@ -133,7 +291,7 @@ const mapStateToProps = (state) => {
return
{
return
{
session_id
:
state
.
session_id
,
session_id
:
state
.
session_id
,
trans_id
:
state
.
trans_id
trans_id
:
state
.
trans_id
}
}
}
}
...
...
view/TransactionDetail.js
View file @
fad49a78
...
@@ -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
moment
from
'moment'
import
moment
from
'moment'
import
{
FontAwesome
}
from
'@expo/vector-icons'
;
class
TransactionDetail
extends
React
.
Component
{
class
TransactionDetail
extends
React
.
Component
{
constructor
(
props
)
{
constructor
(
props
)
{
...
@@ -52,7 +53,7 @@ class TransactionDetail extends React.Component {
...
@@ -52,7 +53,7 @@ class TransactionDetail extends React.Component {
point_reduce
:
data
.
point_reduce
,
point_reduce
:
data
.
point_reduce
,
transaction_detail
:
data
.
transaction_detail
,
transaction_detail
:
data
.
transaction_detail
,
detail_trans
:
data
,
detail_trans
:
data
,
numberId
:
data
.
id
.
substring
(
0
,
5
)
numberId
:
data
.
id
.
substring
(
0
,
5
)
.
toUpperCase
()
})
})
console
.
log
(
this
.
state
.
detail_trans
)
console
.
log
(
this
.
state
.
detail_trans
)
// console.log(this.props.route.params.idTrans)
// console.log(this.props.route.params.idTrans)
...
@@ -63,11 +64,184 @@ class TransactionDetail extends React.Component {
...
@@ -63,11 +64,184 @@ 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
=
{{
fontSize
:
16
,
fontFamily
:
'Gotham-Light'
,
textAlign
:
'center'
}}
>
{
this
.
state
.
numberId
}
<
/Text
>
<
Text
style
=
{{
fontSize
:
16
,
fontFamily
:
'Gotham-Light'
,
textAlign
:
'center'
}}
>
#
{
this
.
state
.
numberId
}
<
/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'
}}
>
{
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
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
,
textAlign
:
'center'
}}
>
{
this
.
state
.
detail_trans
.
trans_status_display
}
<
/Text
>
<
/View
>
<
/View
>
<
View
style
=
{
styles
.
body
}
>
<
ScrollView
style
=
{
styles
.
body
}
>
<
View
style
=
{{
flex
:
1
,
flexDirection
:
'row'
,
borderBottomWidth
:
1
,
margin
:
10
,
paddingBottom
:
30
,
padding
:
10
}}
>
<
View
style
=
{{
flex
:
0.1
,
justifyContent
:
'center'
}}
>
<
FontAwesome
name
=
"map-marker"
size
=
{
24
}
color
=
"red"
/>
<
/View
>
{
this
.
state
.
detail_trans
.
trans_type_display
==
'Pick Up'
?
(
<
View
style
=
{{
flex
:
0.6
,
justifyContent
:
'center'
}}
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
}}
>
{
this
.
state
.
outlet
}
<
/Text
>
<
/View
>
)
:
(
<
View
style
=
{{
flex
:
0.6
,
justifyContent
:
'center'
}}
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
}}
>
{
this
.
state
.
recipient_address
}
<
/Text
>
<
/View
>
)
}
{
this
.
state
.
detail_trans
.
trans_type_display
==
'Pick Up'
?
(
<
View
style
=
{{
flex
:
0.3
,
justifyContent
:
'center'
}}
>
<
Text
style
=
{{
textAlign
:
'right'
,
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
}}
>
PICKUP
<
/Text
>
<
/View
>
)
:
(
<
View
style
=
{{
flex
:
0.3
,
justifyContent
:
'center'
}}
>
<
Text
style
=
{{
textAlign
:
'right'
,
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
}}
>
DELIVERY
<
/Text
>
<
/View
>
)
}
<
/View
>
<
View
style
=
{{
margin
:
10
,
paddingLeft
:
10
}}
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
}}
>
Pesanan
<
/Text
>
<
/View
>
{
this
.
state
.
transaction_detail
.
map
((
item
,
index
)
=>
{
// total = total + item.quantity * item.price
return
(
<
View
style
=
{{
margin
:
10
}}
key
=
{
index
}
>
<
View
style
=
{{
flex
:
1
,
margin
:
10
,
flexDirection
:
'row'
,
justifyContent
:
'space-around'
}}
>
<
View
style
=
{{
flex
:
0.3
,
alignItems
:
'center'
}}
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
}}
>
{
item
.
item_quantity
}
<
/Text
>
<
/View
>
<
View
style
=
{{
flex
:
0.1
,
alignItems
:
'flex-start'
}}
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
}}
>
x
<
/Text
>
<
/View
>
<
View
style
=
{{
flex
:
0.3
,
alignItems
:
'baseline'
}}
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
}}
>
{
item
.
item_name
}
<
/Text
>
<
/View
>
<
View
style
=
{{
flex
:
0.3
,
alignItems
:
'flex-end'
}}
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
}}
>
{
item
.
item_quantity
*
item
.
item_price
}
<
/Text
>
<
/View
>
<
/View
>
<
/View
>
)
})
}
{
/* {
this.state.detail_trans.used_reward.length < 0 ? (
null
) : (
<>
<View style={{ borderTopWidth: 1, margin: 10, padding: 10 }}>
<Text style={{ fontSize: 12, fontFamily: 'Gotham-Light' }}>Voucher</Text>
</View>
<View style={{ flexDirection: 'row', justifyContent: 'space-between', margin: 10, marginTop: -10 }}>
<View style={{ margin: 10, paddingLeft: 10 }}>
<Text style={{ fontSize: 12, fontFamily: 'Gotham-Light' }}>{this.props.voucher.reward.title}</Text>
</View>
<TouchableOpacity onPress={() => this.props.navigation.navigate('Reward Detail', { rewardId: this.props.voucher.id })}>
<View style={{ margin: 10, paddingRight: 5 }}>
<Text style={{ fontSize: 12, fontFamily: 'Gotham-Light', color: '#CFB368' }}>View Detail</Text>
</View>
</TouchableOpacity>
</View>
</>
)
} */
}
<
View
style
=
{{
borderTopWidth
:
1
,
margin
:
10
,
paddingLeft
:
10
,
padding
:
20
,
paddingBottom
:
-
10
}}
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
}}
>
Payment
<
/Text
>
<
/View
>
<
View
style
=
{{
flexDirection
:
'row'
,
justifyContent
:
'space-between'
,
margin
:
10
,
marginTop
:
-
10
}}
>
<
View
style
=
{{
margin
:
10
,
paddingLeft
:
10
}}
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
}}
>
Balance
Used
<
/Text
>
<
/View
>
<
View
style
=
{{
margin
:
10
,
paddingRight
:
5
}}
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
}}
>
{
this
.
state
.
detail_trans
.
trans_paid
}
<
/Text
>
<
/View
>
<
/View
>
<
View
style
=
{{
flexDirection
:
'row'
,
justifyContent
:
'space-between'
,
margin
:
10
,
marginTop
:
-
10
}}
>
<
View
style
=
{{
margin
:
10
,
paddingLeft
:
10
}}
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
}}
>
Point
Used
<
/Text
>
<
/View
>
<
View
style
=
{{
margin
:
10
,
paddingRight
:
5
}}
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
}}
>
{
this
.
state
.
detail_trans
.
point_booked
}
<
/Text
>
<
/View
>
<
/View
>
<
View
style
=
{{
borderTopWidth
:
1
,
margin
:
10
,
paddingLeft
:
10
,
padding
:
20
,
paddingBottom
:
-
10
,
flexDirection
:
'row'
,
justifyContent
:
'space-between'
,
flex
:
1
,
flexDirection
:
'row'
}}
>
<
View
style
=
{{
flex
:
0.6
}}
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
}}
>
Harga
<
/Text
>
<
/View
>
<
View
style
=
{{
flex
:
0.4
,
marginRight
:
-
5
}}
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
,
textAlign
:
'right'
}}
>
{
this
.
state
.
detail_trans
.
trans_subtotal
}
<
/Text
>
<
/View
>
<
/View
>
{
this
.
state
.
detail_trans
.
trans_discount
==
''
?
(
null
)
:
(
<
View
style
=
{{
margin
:
10
,
marginTop
:
-
10
,
paddingLeft
:
10
,
padding
:
20
,
paddingBottom
:
-
10
,
flexDirection
:
'row'
,
justifyContent
:
'space-between'
,
flex
:
1
,
flexDirection
:
'row'
}}
>
<
View
style
=
{{
flex
:
0.6
}}
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
}}
>
Voucher
<
/Text
>
<
/View
>
<
View
style
=
{{
flex
:
0.4
,
marginRight
:
-
5
}}
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
,
textAlign
:
'right'
}}
>-
{
this
.
state
.
detail_trans
.
trans_discount
}
<
/Text
>
<
/View
>
<
/View
>
)
}
{
/* {
this.props.type_pickup == true ? (
null
) : (
<View style={{ margin: 10, marginTop: -10, paddingLeft: 10, padding: 20, paddingBottom: -10, flexDirection: 'row', justifyContent: 'space-between', flex: 1, flexDirection: 'row' }}>
<View style={{ flex: 0.6 }}>
<Text style={{ fontSize: 12, fontFamily: 'Gotham-Light' }}>Ongkos Kirim</Text>
</View>
<View style={{ flex: 0.4, marginRight: -5 }}>
<Text style={{ fontSize: 12, fontFamily: 'Gotham-Light', textAlign: 'right' }}>{this.props.grabamount}</Text>
</View>
</View>
)
} */
}
<
View
style
=
{{
margin
:
10
,
marginTop
:
-
10
,
paddingLeft
:
10
,
padding
:
20
,
paddingBottom
:
-
10
,
flexDirection
:
'row'
,
justifyContent
:
'space-between'
,
flex
:
1
,
flexDirection
:
'row'
}}
>
<
View
style
=
{{
flex
:
0.6
}}
>
<
Text
style
=
{{
fontSize
:
20
,
fontFamily
:
'Gotham-Black'
,
color
:
'#CFB368'
}}
>
Total
<
/Text
>
<
/View
>
<
View
style
=
{{
flex
:
0.4
,
marginRight
:
-
5
}}
>
<
Text
style
=
{{
fontSize
:
20
,
fontFamily
:
'Gotham-Black'
,
textAlign
:
'right'
,
color
:
'#CFB368'
}}
>
{
this
.
state
.
detail_trans
.
trans_total
}
<
/Text
>
<
/View
>
<
/View
>
{
/* <View>
<Card style={{ padding: 10, margin: 10, alignContent: 'center' }}>
<Text>OUTLET : {this.state.outlet}</Text>
<Text>OUTLET CODE : {this.state.outlet_code}</Text>
<Text>OUTLET : {this.state.trans_status_display}</Text>
</Card>
<Card style={{ padding: 10, margin: 10, alignContent: 'center' }}>
{
this.state.transaction_detail.map((item, index) => {
return (
<View key={index}>
<Text>NAMA ITEM : {item.item_name}</Text>
<Text>QTY : {item.item_quantity}</Text>
<Text>PRICE : {item.item_price}</Text>
<Text>DISCOUNT : {item.item_discount}</Text>
<View style={{ borderWidth: 1, margin: 10 }}></View>
<Text>TOTAL : {item.item_subtotal}</Text>
</View>
)
})
}
</Card>
<Card style={{ padding: 10, margin: 10, alignContent: 'center' }}>
<Text>{}</Text>
</Card>
</View> */
}
<
/ScrollView
>
{
/* <View style={styles.body}>
<Card style={{ padding: 10, margin: 10, alignContent: 'center' }}>
<Card style={{ padding: 10, margin: 10, alignContent: 'center' }}>
<Text> Jenis Transaksi : {this.state.trans_type_display}</Text>
<Text> Jenis Transaksi : {this.state.trans_type_display}</Text>
<Text> Tanggal : {this.state.trans_date}</Text>
<Text> Tanggal : {this.state.trans_date}</Text>
...
@@ -96,7 +270,7 @@ class TransactionDetail extends React.Component {
...
@@ -96,7 +270,7 @@ class TransactionDetail extends React.Component {
</Card>
</Card>
<
/View
>
</View>
*/
}
<
/View
>
<
/View
>
)
)
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment