Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
N
new_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
new_excelso
Commits
a3d9dec7
Commit
a3d9dec7
authored
May 20, 2020
by
Wahyu Adjie Prasetyo
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
ssh://repo.cs.co.id:2222/wahyu/bahanoprek
parents
94174c65
6755d13a
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
255 additions
and
261 deletions
+255
-261
Auth.js
view/Auth.js
+55
-28
ItemShopingCart.js
view/ItemShopingCart.js
+37
-33
MenuConfirmation.js
view/MenuConfirmation.js
+49
-120
RewardSelect.js
view/RewardSelect.js
+26
-20
RewardsList.js
view/RewardsList.js
+30
-24
ShoppingCart.js
view/ShoppingCart.js
+58
-36
No files found.
view/Auth.js
View file @
a3d9dec7
...
...
@@ -259,18 +259,18 @@ class Auth extends React.Component {
},
title
:
'CHANGE PASSWORD'
}}
/
>
<
Stack
.
Screen
name
=
"Card Activation"
component
=
{
CardActivation
}
options
=
{{
headerStyle
:
{
backgroundColor
:
'#CFB368'
},
headerTitleContainerStyle
:
{
alignContent
:
'center'
},
headerTitleAlign
:
'center'
,
headerTintColor
:
'#fff'
,
headerTitleStyle
:
{
alignSelf
:
'center'
,
fontFamily
:
'Gotham-Black'
,
fontSize
:
18
,
color
:
'white'
,
textAlign
:
'center'
},
title
:
'ACTIVATE CARD'
}}
/
>
headerStyle
:
{
backgroundColor
:
'#CFB368'
},
headerTitleContainerStyle
:
{
alignContent
:
'center'
},
headerTitleAlign
:
'center'
,
headerTintColor
:
'#fff'
,
headerTitleStyle
:
{
alignSelf
:
'center'
,
fontFamily
:
'Gotham-Black'
,
fontSize
:
18
,
color
:
'white'
,
textAlign
:
'center'
},
title
:
'ACTIVATE CARD'
}}
/
>
<
Stack
.
Screen
name
=
"Renewal"
component
=
{
Renewal
}
options
=
{{
headerStyle
:
{
backgroundColor
:
'#CFB368'
},
headerTitleContainerStyle
:
{
alignContent
:
'center'
},
...
...
@@ -326,16 +326,18 @@ class Auth extends React.Component {
},
title
:
'Tambah Alamat'
}}
/
>
<
Stack
.
Screen
name
=
"Menu Detail"
component
=
{
MenuDetail
}
options
=
{({
route
})
=>
({
headerStyle
:
{
backgroundColor
:
'#CFB368'
},
headerTitleContainerStyle
:
{
alignContent
:
'center'
},
headerTitleAlign
:
'center'
,
headerTintColor
:
'#fff'
,
headerTitleStyle
:
{
alignSelf
:
'center'
,
fontFamily
:
'Gotham-Black'
,
color
:
'white'
,
textAlign
:
'center'
},
title
:
route
.
params
.
nameMenu
})}
options
=
{({
route
})
=>
({
headerStyle
:
{
backgroundColor
:
'#CFB368'
},
headerTitleContainerStyle
:
{
alignContent
:
'center'
},
headerTitleAlign
:
'center'
,
headerTintColor
:
'#fff'
,
headerTitleStyle
:
{
alignSelf
:
'center'
,
fontFamily
:
'Gotham-Black'
,
color
:
'white'
,
textAlign
:
'center'
},
title
:
route
.
params
.
nameMenu
})}
/
>
<
Stack
.
Screen
name
=
"Pickup Name"
component
=
{
PickupName
}
options
=
{{
headerStyle
:
{
backgroundColor
:
'#CFB368'
},
...
...
@@ -352,7 +354,20 @@ class Auth extends React.Component {
<
Stack
.
Screen
name
=
"Outlet Detail"
component
=
{
OutletDetail
}
/
>
<
Stack
.
Screen
name
=
"Menu Select"
component
=
{
MenuSelection
}
options
=
{{
headerShown
:
false
}}
/
>
<
Stack
.
Screen
name
=
"Card Info"
component
=
{
CardInfo
}
/
>
<
Stack
.
Screen
name
=
"Shopping Cart"
component
=
{
ShoppingCart
}
/
>
<
Stack
.
Screen
name
=
"Shopping Cart"
component
=
{
ShoppingCart
}
options
=
{{
headerStyle
:
{
backgroundColor
:
'#CFB368'
},
headerTitleContainerStyle
:
{
alignContent
:
'center'
},
headerTitleAlign
:
'center'
,
headerTintColor
:
'#fff'
,
headerTitleStyle
:
{
alignSelf
:
'center'
,
fontFamily
:
'Gotham-Black'
,
fontSize
:
18
,
color
:
'white'
,
textAlign
:
'center'
},
title
:
'Shopping Cart'
}}
/
>
<
Stack
.
Screen
name
=
"Order History"
component
=
{
OrderHistory
}
/
>
<
Stack
.
Screen
name
=
"Reward History"
component
=
{
RewardHistory
}
options
=
{{
...
...
@@ -457,6 +472,22 @@ class Auth extends React.Component {
title
:
'TRANSACTION HISTORY'
}}
/
>
<
Stack
.
Screen
name
=
"Transaction Detail"
component
=
{
TransactionDetail
}
options
=
{{
headerStyle
:
{
backgroundColor
:
"#CFB368"
},
headerBackTitleStyle
:
{
color
:
'white'
},
headerTintColor
:
'#fff'
,
headerTitleAlign
:
'center'
,
headerTitleStyle
:
{
fontFamily
:
'Gotham-Black'
,
color
:
'white'
,
fontSize
:
18
,
},
title
:
'TRANSACTION DETAIL'
}}
/
>
{
/* <Stack.Screen name="Email Confirmation" component={EmailConfirmation} /> */
}
<
Stack
.
Screen
name
=
"News Detail"
component
=
{
NewsDetail
}
options
=
{{
headerShown
:
false
}}
/
>
<
Stack
.
Screen
name
=
"Confirm Your Order"
component
=
{
MenuConfirmation
}
options
=
{{
headerStyle
:
{
backgroundColor
:
"#CFB368"
},
headerBackTitleStyle
:
{
color
:
'white'
},
...
...
@@ -467,12 +498,8 @@ class Auth extends React.Component {
color
:
'white'
,
fontSize
:
18
,
},
title
:
'
TRANSACTION DETAIL
'
title
:
'
Confirm Your Order
'
}}
/
>
{
/* <Stack.Screen name="Email Confirmation" component={EmailConfirmation} /> */
}
<
Stack
.
Screen
name
=
"News Detail"
component
=
{
NewsDetail
}
options
=
{{
headerShown
:
false
}}
/
>
<
Stack
.
Screen
name
=
"Confirm Your Order"
component
=
{
MenuConfirmation
}
/
>
<
Stack
.
Screen
name
=
"Date Time"
component
=
{
DateTime
}
/
>
<
Stack
.
Screen
name
=
"New Register"
component
=
{
NewRegister
}
options
=
{{
...
...
view/ItemShopingCart.js
View file @
a3d9dec7
...
...
@@ -2,6 +2,7 @@ import React from 'react';
import
{
View
,
Text
,
StyleSheet
,
ScrollView
,
TouchableOpacity
,
Image
,
TextInput
}
from
'react-native'
;
import
{
connect
}
from
'react-redux'
;
import
ActionType
from
'../redux/globalActionType'
;
import
NumberFormat
from
'react-number-format'
;
class
ItemShoping
extends
React
.
Component
{
...
...
@@ -21,40 +22,42 @@ class ItemShoping extends React.Component {
note
:
'jangan garing'
,
image
:
item
.
image
,
price
:
parseInt
(
item
.
price
),
}
this
.
props
.
changeQuantity
({
item
:
order_item
,
quantity
:
quantity
})
}
this
.
props
.
changeQuantity
({
item
:
order_item
,
quantity
:
quantity
})
}
render
()
{
const
{
item
}
=
this
.
props
// console.log(this.props)
return
(
<
View
style
=
{{
flex
:
1
,
margin
:
10
}}
key
=
{
item
.
id
}
>
{
/* <Text style={{ fontSize: 20, color: '#c9af6d' }}>{item.name}</Text> */
}
<
View
style
=
{{
flexDirection
:
'row'
}}
>
<
View
>
<
Image
source
=
{{
uri
:
item
.
image
}}
style
=
{{
height
:
100
,
width
:
100
,
borderRadius
:
5
,
top
:
5
}}
><
/Image
>
<
/View
>
<
View
>
<
Text
style
=
{{
fontSize
:
20
,
margin
:
5
,
marginRight
:
10
,
fontFamily
:
'Gotham-Black'
}}
>
{
item
.
name
}
<
/Text
>
<
Text
style
=
{{
fontSize
:
15
,
margin
:
5
,
marginRight
:
10
,
fontFamily
:
'Gotham-Light'
}}
>
Rp
.
{
item
.
price
}
<
/Text
>
<
View
style
=
{{
flexDirection
:
'row'
,
flex
:
1
}}
>
<
View
style
=
{
styles
.
shadowEdit
}
><
/View
>
<
View
style
=
{
styles
.
shadowAdd
}
>
<
TouchableOpacity
onPress
=
{()
=>
this
.
props
.
handleMin
()}
>
<
Text
style
=
{{
fontSize
:
20
,
margin
:
2
,
color
:
'#CFB368'
}}
>
-
<
/Text
>
<
/TouchableOpacity
>
<
TextInput
style
=
{{
height
:
25
,
padding
:
2
,
textAlign
:
'center'
,
margin
:
2
}}
keyboardType
=
{
'numeric'
}
onChangeText
=
{(
quantity
)
=>
this
.
handleChangeQuantity
(
item
,
quantity
)}
>
{
item
.
quantity
}
<
/TextInput
>
<
TouchableOpacity
onPress
=
{()
=>
this
.
props
.
handleAdd
()}
>
<
Text
style
=
{{
fontSize
:
20
,
margin
:
2
,
color
:
'#CFB368'
}}
>
+
<
/Text
>
<
/TouchableOpacity
>
<
/View
>
{
/* <Text style={{ fontSize: 20, color: '#c9af6d' }}>{item.name}</Text> */
}
<
View
style
=
{{
flexDirection
:
'row'
}}
>
<
View
>
<
Image
source
=
{{
uri
:
item
.
image
}}
style
=
{{
height
:
100
,
width
:
100
,
borderRadius
:
5
,
top
:
5
}}
><
/Image
>
<
/View
>
<
View
>
<
Text
style
=
{{
fontSize
:
15
,
margin
:
5
,
marginRight
:
10
,
fontFamily
:
'Gotham-Black'
,
color
:
'grey'
}}
>
{
item
.
name
}
<
/Text
>
<
NumberFormat
decimalScale
=
{
0
}
value
=
{
item
.
price
}
renderText
=
{
value
=>
<
Text
style
=
{{
fontSize
:
12
,
margin
:
5
,
marginRight
:
10
,
fontFamily
:
'Gotham-Light'
,
color
:
'grey'
}}
>
Rp
.
{
value
}
<
/Text>} displayType={'text'} thousandSeparator={true} prefix={''} /
>
<
View
style
=
{{
flexDirection
:
'row'
,
flex
:
1
}}
>
<
View
style
=
{
styles
.
shadowEdit
}
>
<
Image
source
=
{(
require
(
'../assets/icon/icon-pencil.png'
))}
style
=
{{
height
:
25
,
width
:
25
,
marginLeft
:
5
}}
><
/Image
>
<
/View
>
<
View
style
=
{
styles
.
shadowAdd
}
>
<
TouchableOpacity
onPress
=
{()
=>
this
.
props
.
handleMin
()}
>
<
Text
style
=
{{
fontSize
:
20
,
margin
:
2
,
color
:
'#CFB368'
}}
>
-
<
/Text
>
<
/TouchableOpacity
>
<
TextInput
style
=
{{
height
:
25
,
padding
:
2
,
textAlign
:
'center'
,
margin
:
2
}}
keyboardType
=
{
'numeric'
}
onChangeText
=
{(
quantity
)
=>
this
.
handleChangeQuantity
(
item
,
quantity
)}
>
{
item
.
quantity
}
<
/TextInput
>
<
TouchableOpacity
onPress
=
{()
=>
this
.
props
.
handleAdd
()}
>
<
Text
style
=
{{
fontSize
:
20
,
margin
:
2
,
color
:
'#CFB368'
}}
>
+
<
/Text
>
<
/TouchableOpacity
>
<
/View
>
<
/View
>
<
/View
>
<
/View
>
<
/View
>
)
}
...
...
@@ -76,6 +79,7 @@ const styles = StyleSheet.create({
marginLeft
:
5
,
marginRight
:
5
,
marginTop
:
10
,
alignItems
:
'center'
},
shadowAdd
:
{
height
:
30
,
...
...
@@ -125,14 +129,14 @@ const mapStateToProps = (state) => {
const
mapDispatchToProps
=
(
dispacth
)
=>
{
return
{
changeQuantity
:
(
params
)
=>
dispacth
({
type
:
ActionType
.
CHANGE_QUANTITY
,
data
:
{
item
:
params
.
item
,
new_quantity
:
params
.
quantity
}
}),
changeQuantity
:
(
params
)
=>
dispacth
({
type
:
ActionType
.
CHANGE_QUANTITY
,
data
:
{
item
:
params
.
item
,
new_quantity
:
params
.
quantity
}
}),
}
}
}
export
default
connect
(
mapStateToProps
,
mapDispatchToProps
)(
ItemShoping
)
view/MenuConfirmation.js
View file @
a3d9dec7
...
...
@@ -6,6 +6,7 @@ import ActionType from '../redux/globalActionType';
import
Spinner
from
'react-native-loading-spinner-overlay'
;
import
session
from
'../function/session'
;
import
moment
from
'moment'
import
NumberFormat
from
'react-number-format'
;
import
{
FontAwesome
}
from
'@expo/vector-icons'
;
class
MenuConfirmation
extends
React
.
Component
{
constructor
(
props
)
{
...
...
@@ -212,21 +213,21 @@ class MenuConfirmation extends React.Component {
textContent
=
{
'Sedang Proses...'
}
textStyle
=
{
styles
.
spinnerTextStyle
}
/
>
<
View
style
=
{{
margin
:
10
,
padding
:
20
,
borderBottomWidth
:
1
}}
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
,
textAlign
:
'center'
}}
>
{
moment
().
utcOffset
(
'+07:00'
).
format
(
'DD MMMM YYYY HH:mm:ss'
)}
<
/Text
>
<
View
style
=
{{
margin
:
10
,
padding
:
20
,
borderBottomWidth
:
1
,
borderColor
:
'grey'
}}
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
,
textAlign
:
'center'
,
color
:
'grey'
}}
>
{
moment
().
utcOffset
(
'+07:00'
).
format
(
'DD MMMM YYYY HH:mm:ss'
)}
<
/Text
>
<
/View
>
<
View
style
=
{{
flex
:
1
,
flexDirection
:
'row'
,
borderBottomWidth
:
1
,
margin
:
10
,
paddingBottom
:
30
,
padding
:
10
}}
>
<
View
style
=
{{
flex
:
1
,
flexDirection
:
'row'
,
borderBottomWidth
:
1
,
borderColor
:
'grey'
,
margin
:
10
,
paddingBottom
:
30
,
padding
:
10
}}
>
<
View
style
=
{{
flex
:
0.1
,
justifyContent
:
'center'
}}
>
<
FontAwesome
name
=
"map-marker"
size
=
{
24
}
color
=
"red"
/>
<
/View
>
{
this
.
props
.
type_pickup
==
true
?
(
<
View
style
=
{{
flex
:
0.6
,
justifyContent
:
'center'
}}
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
}}
>
{
this
.
props
.
name_outlet
}
<
/Text
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
,
color
:
'grey'
}}
>
{
this
.
props
.
name_outlet
}
<
/Text
>
<
/View
>
)
:
(
<
View
style
=
{{
flex
:
0.6
,
justifyContent
:
'center'
}}
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
}}
>
{
this
.
props
.
address
}
<
/Text
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
,
color
:
'grey'
}}
>
{
this
.
props
.
address
}
<
/Text
>
<
/View
>
)
...
...
@@ -234,18 +235,18 @@ class MenuConfirmation extends React.Component {
{
this
.
props
.
type_pickup
==
true
?
(
<
View
style
=
{{
flex
:
0.3
,
justifyContent
:
'center'
}}
>
<
Text
style
=
{{
textAlign
:
'right'
,
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
}}
>
PICKUP
<
/Text
>
<
Text
style
=
{{
textAlign
:
'right'
,
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
,
color
:
'grey'
}}
>
PICKUP
<
/Text
>
<
/View
>
)
:
(
<
View
style
=
{{
flex
:
0.3
,
justifyContent
:
'center'
}}
>
<
Text
style
=
{{
textAlign
:
'right'
,
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
}}
>
DELIVERY
<
/Text
>
<
Text
style
=
{{
textAlign
:
'right'
,
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
,
color
:
'grey'
}}
>
DELIVERY
<
/Text
>
<
/View
>
)
}
<
/View
>
<
View
style
=
{{
marginHorizontal
:
10
,
paddingLeft
:
10
}}
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
}}
>
Pesanan
<
/Text
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
,
color
:
'grey'
}}
>
Pesanan
<
/Text
>
<
/View
>
{
this
.
props
.
order_item
.
map
((
item
,
index
)
=>
{
...
...
@@ -253,20 +254,21 @@ class MenuConfirmation extends React.Component {
return
(
<
View
style
=
{{
margin
:
0
}}
key
=
{
index
}
>
<
View
style
=
{{
flex
:
1
,
margin
:
10
,
flexDirection
:
'row'
,
justifyContent
:
'space-around'
}}
>
<
View
style
=
{{
flex
:
0.3
,
alignItems
:
'center'
}}
>
<
Image
source
=
{{
uri
:
item
.
image
}}
style
=
{{
height
:
50
,
width
:
50
,
borderRadius
:
5
}}
><
/Image
>
<
View
style
=
{{
flex
:
0.3
,
alignItems
:
'center'
}}
>
<
Image
source
=
{{
uri
:
item
.
image
}}
style
=
{{
height
:
50
,
width
:
50
,
borderRadius
:
5
}}
><
/Image
>
<
/View
>
<
View
style
=
{{
flex
:
0.1
,
alignItems
:
'center'
,
justifyContent
:
'center'
,
}}
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
}}
>
{
item
.
quantity
}
<
/Text
>
<
View
style
=
{{
flex
:
0.1
,
alignItems
:
'center'
,
justifyContent
:
'center'
,
}}
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
,
color
:
'grey'
}}
>
{
item
.
quantity
}
<
/Text
>
<
/View
>
<
View
style
=
{{
flex
:
0.1
,
alignItems
:
'flex-start'
,
justifyContent
:
'center'
,
}}
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
}}
>
x
<
/Text
>
<
View
style
=
{{
flex
:
0.1
,
alignItems
:
'flex-start'
,
justifyContent
:
'center'
,
}}
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
,
color
:
'grey'
}}
>
x
<
/Text
>
<
/View
>
<
View
style
=
{{
flex
:
0.3
,
alignItems
:
'baseline'
,
justifyContent
:
'center'
,
}}
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
}}
>
{
item
.
name
}
<
/Text
>
<
View
style
=
{{
flex
:
0.3
,
alignItems
:
'baseline'
,
justifyContent
:
'center'
,
}}
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
,
color
:
'grey'
}}
>
{
item
.
name
}
<
/Text
>
<
/View
>
<
View
style
=
{{
flex
:
0.3
,
alignItems
:
'flex-end'
,
justifyContent
:
'center'
,
}}
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
}}
>
{
item
.
quantity
*
item
.
price
}
<
/Text
>
<
View
style
=
{{
flex
:
0.3
,
alignItems
:
'flex-end'
,
justifyContent
:
'center'
,
}}
>
{
/* <Text style={{ fontSize: 12, fontFamily: 'Gotham-Light' }}>{item.quantity * item.price} </Text> */
}
<
NumberFormat
decimalScale
=
{
0
}
value
=
{
item
.
quantity
*
item
.
price
}
renderText
=
{
value
=>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
,
color
:
'grey'
}}
>
Rp
.
{
value
}
<
/Text>} displayType={'text'} thousandSeparator={true} prefix={''} /
>
<
/View
>
<
/View
>
<
/View
>
...
...
@@ -278,13 +280,13 @@ class MenuConfirmation extends React.Component {
null
)
:
(
<>
<
View
style
=
{{
borderTopWidth
:
1
,
margin
:
10
,
padding
:
10
}}
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
}}
>
Voucher
<
/Text
>
<
View
style
=
{{
borderTopWidth
:
1
,
borderColor
:
'grey'
,
margin
:
10
,
padding
:
10
}}
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
,
color
:
'grey'
}}
>
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
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
,
color
:
'grey'
}}
>
{
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
}}
>
...
...
@@ -295,31 +297,32 @@ class MenuConfirmation extends React.Component {
<
/
>
)
}
<
View
style
=
{{
borderTopWidth
:
1
,
marginHorizontal
:
10
,
paddingLeft
:
10
,
padding
:
10
}}
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
}}
>
Payment
<
/Text
>
<
View
style
=
{{
borderTopWidth
:
1
,
borderColor
:
'grey'
,
marginHorizontal
:
10
,
paddingLeft
:
10
,
padding
:
10
}}
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
,
color
:
'grey'
}}
>
Payment
<
/Text
>
<
/View
>
<
View
style
=
{{
flex
:
1
,
flexDirection
:
'row'
,
justifyContent
:
'space-between'
,
marginTop
:
-
10
}}
>
<
View
style
=
{{
flex
:
0.5
,
margin
:
10
,
paddingLeft
:
20
}}
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
}}
>
Balance
Used
<
/Text
>
<
View
style
=
{{
flex
:
1
,
flexDirection
:
'row'
,
justifyContent
:
'space-between'
,
marginTop
:
-
10
}}
>
<
View
style
=
{{
flex
:
0.5
,
margin
:
10
,
paddingLeft
:
20
}}
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
,
color
:
'grey'
}}
>
Balance
Used
<
/Text
>
<
/View
>
<
View
style
=
{{
flex
:
0.5
,
margin
:
10
,
alignItems
:
'flex-end'
,
paddingRight
:
5
}}
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
}}
>
{
this
.
props
.
route
.
params
.
balanceUsed
}
<
/Text
>
<
View
style
=
{{
flex
:
0.5
,
margin
:
10
,
alignItems
:
'flex-end'
,
paddingRight
:
5
}}
>
<
NumberFormat
decimalScale
=
{
0
}
value
=
{
this
.
props
.
route
.
params
.
balanceUsed
}
renderText
=
{
value
=>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
,
color
:
'grey'
}}
>
Rp
.
{
value
}
<
/Text>} displayType={'text'} thousandSeparator={true} prefix={''} /
>
<
/View
>
<
/View
>
<
View
style
=
{{
flex
:
1
,
flexDirection
:
'row'
,
justifyContent
:
'space-between'
,
marginTop
:
-
10
}}
>
<
View
style
=
{{
flex
:
0.5
,
margin
:
10
,
paddingLeft
:
20
}}
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
}}
>
Point
Used
<
/Text
>
<
View
style
=
{{
flex
:
1
,
flexDirection
:
'row'
,
justifyContent
:
'space-between'
,
marginTop
:
-
10
}}
>
<
View
style
=
{{
flex
:
0.5
,
margin
:
10
,
paddingLeft
:
20
}}
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
,
color
:
'grey'
}}
>
Point
Used
<
/Text
>
<
/View
>
<
View
style
=
{{
flex
:
0.5
,
margin
:
10
,
alignItems
:
'flex-end'
,
paddingRight
:
5
}}
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
}}
>
{
this
.
props
.
route
.
params
.
pointused
}
<
/Text
>
<
View
style
=
{{
flex
:
0.5
,
margin
:
10
,
alignItems
:
'flex-end'
,
paddingRight
:
5
}}
>
<
NumberFormat
decimalScale
=
{
0
}
value
=
{
this
.
props
.
route
.
params
.
pointused
}
renderText
=
{
value
=>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
,
color
:
'grey'
}}
>
Rp
.
{
value
}
<
/Text>} displayType={'text'} thousandSeparator={true} prefix={''} /
>
<
/View
>
<
/View
>
<
View
style
=
{{
borderTopWidth
:
1
,
margin
:
10
,
paddingLeft
:
10
,
padding
:
10
,
paddingBottom
:
-
10
,
flexDirection
:
'row'
,
justifyContent
:
'space-between'
,
flex
:
1
}}
>
<
View
style
=
{{
borderTopWidth
:
1
,
borderColor
:
'grey'
,
margin
:
10
,
paddingLeft
:
10
,
padding
:
10
,
paddingBottom
:
-
10
,
flexDirection
:
'row'
,
justifyContent
:
'space-between'
,
flex
:
1
}}
>
<
View
style
=
{{
flex
:
0.6
}}
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
}}
>
Harga
<
/Text
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
,
color
:
'grey'
}}
>
Harga
<
/Text
>
<
/View
>
<
View
style
=
{{
flex
:
0.4
,
marginRight
:
-
5
}}
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
,
textAlign
:
'right'
}}
>
{
total
}
<
/Text
>
{
/* <Text style={{ fontSize: 12, fontFamily: 'Gotham-Light', color:'grey', textAlign: 'right' }}>{total}</Text> */
}
<
NumberFormat
decimalScale
=
{
0
}
value
=
{
total
}
renderText
=
{
value
=>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
,
color
:
'grey'
,
textAlign
:
'right'
}}
>
Rp
.
{
value
}
<
/Text>} displayType={'text'} thousandSeparator={true} prefix={''} /
>
<
/View
>
<
/View
>
{
...
...
@@ -328,10 +331,10 @@ class MenuConfirmation extends React.Component {
)
:
(
<
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
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
,
color
:
'grey'
}}
>
Voucher
<
/Text
>
<
/View
>
<
View
style
=
{{
flex
:
0.4
,
marginRight
:
-
5
}}
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
,
textAlign
:
'right'
}}
>-
{
this
.
props
.
voucher
.
reward
.
value
}
<
/Text
>
<
NumberFormat
decimalScale
=
{
0
}
value
=
{
this
.
props
.
voucher
.
reward
.
value
}
renderText
=
{
value
=>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
,
color
:
'grey'
,
textAlign
:
'right'
}}
>-
Rp
.
{
value
}
<
/Text>} displayType={'text'} thousandSeparator={true} prefix={''} /
>
<
/View
>
<
/View
>
)
...
...
@@ -342,107 +345,33 @@ class MenuConfirmation extends React.Component {
)
:
(
<
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
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
,
color
:
'grey'
}}
>
Ongkos
Kirim
<
/Text
>
<
/View
>
<
View
style
=
{{
flex
:
0.4
,
marginRight
:
-
5
}}
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
,
textAlign
:
'right'
}}
>
{
this
.
props
.
grabamount
}
<
/Text
>
<
NumberFormat
decimalScale
=
{
0
}
value
=
{
this
.
props
.
grabamount
}
renderText
=
{
value
=>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
,
color
:
'grey'
,
textAlign
:
'right'
}}
>
Rp
.
{
value
}
<
/Text>} displayType={'text'} thousandSeparator={true} prefix={''} /
>
<
/View
>
<
/View
>
)
}
<
View
style
=
{{
marginHorizontal
:
7
,
paddingHorizontal
:
10
,
flexDirection
:
'row'
,
justifyContent
:
'space-between'
,
flex
:
1
}}
>
<
View
style
=
{{
marginHorizontal
:
7
,
paddingHorizontal
:
10
,
flexDirection
:
'row'
,
justifyContent
:
'space-between'
,
flex
:
1
}}
>
<
View
style
=
{{
flex
:
0.6
}}
>
<
Text
style
=
{{
fontSize
:
20
,
fontFamily
:
'Gotham-Black'
,
color
:
'#CFB368'
}}
>
Total
<
/Text
>
<
/View
>
{
this
.
props
.
value_voucher
==
''
?
(
<
View
style
=
{{
flex
:
0.4
,
marginRight
:
-
5
,
}}
>
<
Text
style
=
{{
fontSize
:
20
,
fontFamily
:
'Gotham-Black'
,
textAlign
:
'right'
,
color
:
'#CFB368'
}}
>
{
this
.
props
.
order_total
+
this
.
props
.
grabamount
}
<
/Text
>
<
View
style
=
{{
flex
:
0.4
,
marginRight
:
-
5
,
}}
>
{
/* <Text style={{ fontSize: 20, fontFamily: 'Gotham-Black', textAlign: 'right', color: '#CFB368' }}>{this.props.order_total + this.props.grabamount}</Text> */
}
<
NumberFormat
decimalScale
=
{
0
}
value
=
{
this
.
props
.
order_total
+
this
.
props
.
grabamount
}
renderText
=
{
value
=>
<
Text
style
=
{{
fontSize
:
20
,
fontFamily
:
'Gotham-Black'
,
textAlign
:
'right'
,
color
:
'#CFB368'
}}
>
Rp
.
{
value
}
<
/Text>} displayType={'text'} thousandSeparator={true} prefix={''} /
>
<
/View
>
)
:
(
<
View
style
=
{{
flex
:
0.4
,
marginRight
:
-
5
,
}}
>
<
Text
style
=
{{
fontSize
:
20
,
fontFamily
:
'Gotham-Black'
,
textAlign
:
'right'
,
color
:
'#CFB368'
}}
>
{
Math
.
max
(
0
,
this
.
props
.
order_total
-
this
.
props
.
voucher
.
reward
.
value
+
this
.
props
.
grabamount
)}
<
/Text
>
{
/* <Text style={{ fontSize: 20, fontFamily: 'Gotham-Black', textAlign: 'right', color: '#CFB368' }}>{Math.max(0, this.props.order_total - this.props.voucher.reward.value + this.props.grabamount)}</Text> */
}
<
NumberFormat
decimalScale
=
{
0
}
value
=
{
Math
.
max
(
0
,
this
.
props
.
order_total
-
this
.
props
.
voucher
.
reward
.
value
+
this
.
props
.
grabamount
)}
renderText
=
{
value
=>
<
Text
style
=
{{
fontSize
:
20
,
fontFamily
:
'Gotham-Black'
,
textAlign
:
'right'
,
color
:
'#CFB368'
}}
>
Rp
.
{
value
}
<
/Text>} displayType={'text'} thousandSeparator={true} prefix={''} /
>
<
/View
>
)
}
<
/View
>
{
/* <View style={{ flexDirection: 'row', margin: 10, justifyContent: 'space-between' }}>
<View style={{ margin: 10 }}>
<Text>Voucher Discount</Text>
</View>
<View style={{ margin: 10 }}>
{
this.props.value_voucher == '' ? (
<Text>0</Text>
) : (
<Text>{this.props.voucher.reward.value}</Text>
)
}
</View>
</View>
<View style={{ flexDirection: 'row', margin: 10, justifyContent: 'space-between' }}>
{this.props.type_pickup == true ? (
null
) : (
<View>
<View style={{ margin: 10 }}>
<Text>Delivery Charge</Text>
</View>
<View style={{ margin: 10 }}>
<Text>{this.props.grabamount}</Text>
</View>
</View>
)}
</View>
<View style={{ flexDirection: 'row', margin: 10, justifyContent: 'space-between', borderTopWidth: 1 }}>
<View style={{ margin: 10 }}>
<Text>Total</Text>
</View>
{this.props.type_pickup == true ? (
<View style={{ margin: 10 }}>
{
this.props.value_voucher == '' ? (
<Text>{this.props.order_total}</Text>
) : (
<Text>{Math.max(0, this.props.order_total - this.props.voucher.reward.value)}</Text>
)
}
</View>
) : (
<View style={{ margin: 10 }}>
{
this.props.value_voucher == '' ? (
<Text>{this.props.order_total + this.props.grabamount + this.state.diskon}</Text>
) : (
<Text>{Math.max(this.props.order_total + this.props.grabamount - this.props.voucher.reward.value)}</Text>
)
}
</View>
)}
</View>
{this.props.type_pickup == true ? (
null
) : (
<View style={{ flexDirection: 'row', margin: 10, justifyContent: 'space-between' }}>
<View style={{ margin: 10 }}>
<Text>Delivery to</Text>
</View>
<View style={{ margin: 10 }}>
<Text>{this.props.address}</Text>
</View>
</View>
)} */
}
{
/* <View style={{ margin: 10 }}>
<Button title='order' onPress={() => this.setOrder(this.props.type_pickup)} />
</View> */
}
<
TouchableOpacity
onPress
=
{()
=>
this
.
setOrder
(
this
.
props
.
type_pickup
)}
>
<
View
style
=
{
styles
.
button
}
>
<
Text
style
=
{{
color
:
'white'
,
fontSize
:
22
,
fontFamily
:
'Gotham-Black'
}}
>
Proses
Pesanan
<
/Text
>
...
...
view/RewardSelect.js
View file @
a3d9dec7
...
...
@@ -89,30 +89,36 @@ class RewardSelect extends React.Component {
</View> */
}
<
ScrollView
style
=
{
styles
.
body
}
>
{
this
.
state
.
rewardsList
.
map
((
item
,
key
)
=>
(
<
TouchableOpacity
key
=
{
key
}
onPress
=
{()
=>
this
.
handleSelect
(
item
)}
>
<
View
style
=
{{
alignItems
:
'center'
}}
>
<
Card
style
=
{{
padding
:
5
,
margin
:
10
}}
>
<
View
>
<
Image
source
=
{{
uri
:
item
.
reward
.
title_image
}}
resizeMethod
=
"resize"
resizeMode
=
'cover'
style
=
{{
height
:
100
,
width
:
'100%'
}}
/
>
<
/View
>
<
View
style
=
{{
flexDirection
:
'row'
,
justifyContent
:
'space-between'
,
padding
:
10
}}
>
this
.
state
.
rewardsList
.
length
?
(
this
.
state
.
rewardsList
.
map
((
item
,
key
)
=>
(
<
TouchableOpacity
key
=
{
key
}
onPress
=
{()
=>
this
.
handleSelect
(
item
)}
>
<
View
style
=
{{
alignItems
:
'center'
}}
>
<
Card
style
=
{{
padding
:
5
,
margin
:
10
}}
>
<
View
>
<
Text
style
=
{{
textAlign
:
'left'
,
fontSize
:
12
,
fontFamily
:
'Gotham-Black'
}}
>
{
item
.
reward
.
title
}
<
/Text
>
<
Text
style
=
{{
textAlign
:
'left'
,
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
}}
>
{
item
.
reward
.
subtitle
}
<
/Text
>
<
Image
source
=
{{
uri
:
item
.
reward
.
title_image
}}
resizeMethod
=
"resize"
resizeMode
=
'cover'
style
=
{{
height
:
100
,
width
:
'100%'
}}
/
>
<
/View
>
<
View
>
<
Text
style
=
{{
textAlign
:
'right'
,
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
}}
>
Expired
<
/Text
>
<
Text
style
=
{{
textAlign
:
'right'
,
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
}}
>
{
item
.
expire_time
}
<
/Text
>
<
View
style
=
{{
flexDirection
:
'row'
,
justifyContent
:
'space-between'
,
padding
:
10
}}
>
<
View
>
<
Text
style
=
{{
textAlign
:
'left'
,
fontSize
:
12
,
fontFamily
:
'Gotham-Black'
}}
>
{
item
.
reward
.
title
}
<
/Text
>
<
Text
style
=
{{
textAlign
:
'left'
,
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
}}
>
{
item
.
reward
.
subtitle
}
<
/Text
>
<
/View
>
<
View
>
<
Text
style
=
{{
textAlign
:
'right'
,
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
}}
>
Expired
<
/Text
>
<
Text
style
=
{{
textAlign
:
'right'
,
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
}}
>
{
item
.
expire_time
}
<
/Text
>
<
/View
>
<
/View
>
<
/View
>
<
/Card
>
<
/Card
>
<
/View
>
<
/TouchableOpacity
>
))
)
:
(
<
View
style
=
{{
justifyContent
:
'center'
,
alignItems
:
'center'
,
height
:
100
}}
>
<
Text
style
=
{{
textAlign
:
'left'
,
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
,
color
:
'grey'
}}
>
No
E
-
Voucher
Available
<
/Text
>
<
/View
>
<
/TouchableOpacity
>
))
)
}
{
/* <TouchableOpacity>
<Text style={{ textAlign: 'right', color: '#ccb46c' }}>REDEEM E-VOUCHER HISTORY</Text>
...
...
view/RewardsList.js
View file @
a3d9dec7
...
...
@@ -32,9 +32,9 @@ class RewardsList extends React.Component {
Axios
.
post
(
'https://excelsocrm.ravintoladev.com/crm/v2/reward/get_list'
,
params
).
then
(
res
=>
{
let
data
=
res
.
data
.
rewards
// console.log(data)
data
.
map
((
item
,
key
)
=>
{
data
.
map
((
item
,
key
)
=>
{
// console.log(item.expire_time)
item
.
expire_time
=
moment
(
item
.
expire_time
).
format
(
"DD MMMM YYYY"
)
item
.
expire_time
=
moment
(
item
.
expire_time
).
format
(
"DD MMMM YYYY"
)
})
// console.log(data)
this
.
setState
({
...
...
@@ -55,35 +55,41 @@ class RewardsList extends React.Component {
<
/View
>
<
ScrollView
style
=
{
styles
.
body
}
>
{
this
.
state
.
rewardsList
.
map
((
item
,
key
)
=>
(
<
TouchableOpacity
key
=
{
key
}
onPress
=
{()
=>
this
.
props
.
navigation
.
navigate
(
'Reward Detail'
,
{
rewardId
:
item
.
id
})}
>
<
View
style
=
{{
alignItems
:
'center'
}}
>
<
Card
style
=
{{
padding
:
5
,
margin
:
10
}}
>
<
View
>
<
Image
source
=
{{
uri
:
item
.
reward
.
title_image
}}
resizeMethod
=
"resize"
resizeMode
=
'cover'
style
=
{{
height
:
100
,
width
:
'100%'
}}
/
>
<
/View
>
<
View
style
=
{{
flexDirection
:
'row'
,
justifyContent
:
'space-between'
,
padding
:
10
}}
>
this
.
state
.
rewardsList
.
length
?
(
this
.
state
.
rewardsList
.
map
((
item
,
key
)
=>
(
<
TouchableOpacity
key
=
{
key
}
onPress
=
{()
=>
this
.
props
.
navigation
.
navigate
(
'Reward Detail'
,
{
rewardId
:
item
.
id
})}
>
<
View
style
=
{{
alignItems
:
'center'
}}
>
<
Card
style
=
{{
padding
:
5
,
margin
:
10
}}
>
<
View
>
<
Text
style
=
{{
textAlign
:
'left'
,
fontSize
:
12
,
fontFamily
:
'Gotham-Black'
}}
>
{
item
.
reward
.
title
}
<
/Text
>
<
Text
style
=
{{
textAlign
:
'left'
,
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
}}
>
{
item
.
reward
.
subtitle
}
<
/Text
>
<
Image
source
=
{{
uri
:
item
.
reward
.
title_image
}}
resizeMethod
=
"resize"
resizeMode
=
'cover'
style
=
{{
height
:
100
,
width
:
'100%'
}}
/
>
<
/View
>
<
View
>
<
Text
style
=
{{
textAlign
:
'right'
,
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
}}
>
Expired
<
/Text
>
<
Text
style
=
{{
textAlign
:
'right'
,
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
}}
>
{
item
.
expire_time
}
<
/Text
>
<
View
style
=
{{
flexDirection
:
'row'
,
justifyContent
:
'space-between'
,
padding
:
10
}}
>
<
View
>
<
Text
style
=
{{
textAlign
:
'left'
,
fontSize
:
12
,
fontFamily
:
'Gotham-Black'
}}
>
{
item
.
reward
.
title
}
<
/Text
>
<
Text
style
=
{{
textAlign
:
'left'
,
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
}}
>
{
item
.
reward
.
subtitle
}
<
/Text
>
<
/View
>
<
View
>
<
Text
style
=
{{
textAlign
:
'right'
,
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
}}
>
Expired
<
/Text
>
<
Text
style
=
{{
textAlign
:
'right'
,
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
}}
>
{
item
.
expire_time
}
<
/Text
>
<
/View
>
<
/View
>
<
/View
>
<
/Card
>
<
/Card
>
<
/View
>
<
/TouchableOpacity
>
))
)
:
(
<
View
style
=
{{
justifyContent
:
'center'
,
alignItems
:
'center'
,
height
:
100
}}
>
<
Text
style
=
{{
textAlign
:
'left'
,
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
,
color
:
'grey'
}}
>
No
E
-
Voucher
Available
<
/Text
>
<
/View
>
<
/TouchableOpacity
>
))
)
}
<
TouchableOpacity
onPress
=
{()
=>
this
.
props
.
navigation
.
navigate
(
'Reward History'
)}
>
<
TouchableOpacity
onPress
=
{()
=>
this
.
props
.
navigation
.
navigate
(
'Reward History'
)}
>
<
Text
style
=
{{
textAlign
:
'center'
,
color
:
'#CFB368'
,
fontSize
:
12
,
fontFamily
:
'Gotham-Black'
}}
>
REDEEM
E
-
VOUCHER
HISTORY
<
/Text
>
<
/TouchableOpacity
>
<
View
style
=
{{
height
:
15
}}
/
>
<
View
style
=
{{
height
:
15
}}
/
>
<
/ScrollView
>
<
/View
>
)
...
...
view/ShoppingCart.js
View file @
a3d9dec7
...
...
@@ -10,6 +10,7 @@ import Axios from 'axios'
import
ActionType
from
'../redux/globalActionType'
;
import
{
YellowBox
}
from
'react-native'
;
import
session
from
'../function/session'
;
import
NumberFormat
from
'react-number-format'
;
YellowBox
.
ignoreWarnings
([
'VirtualizedLists should never be nested'
]);
...
...
@@ -442,20 +443,20 @@ class ShoppingCart extends React.Component {
{
this
.
props
.
type_pickup
==
true
?
(
<
Card
style
=
{{
margin
:
5
,
padding
:
10
}}
>
<
Text
style
=
{{
textAlign
:
'center'
,
fontFamily
:
'Gotham-Black'
,
fontSize
:
12
}}
>
YOU
WILL
PICKUP
YOUR
ORDER
AT
<
/Text
>
<
Text
style
=
{{
textAlign
:
'center'
,
fontSize
:
12
,
top
:
5
,
fontFamily
:
'Gotham-Light'
}}
>
Excelso
{
this
.
props
.
name_outlet
}
<
/Text
>
<
/
Card
>
<
View
style
=
{{
margin
:
5
,
padding
:
10
}}
>
<
Text
style
=
{{
textAlign
:
'center'
,
fontFamily
:
'Gotham-Black'
,
fontSize
:
12
,
color
:
'grey'
}}
>
YOU
WILL
PICKUP
YOUR
ORDER
AT
<
/Text
>
<
Text
style
=
{{
textAlign
:
'center'
,
fontSize
:
12
,
top
:
5
,
fontFamily
:
'Gotham-Light'
,
color
:
'grey'
}}
>
Excelso
{
this
.
props
.
name_outlet
}
<
/Text
>
<
/
View
>
)
:
(
<
Card
style
=
{{
margin
:
5
,
padding
:
10
}}
>
<
Text
style
=
{{
textAlign
:
'center'
,
fontFamily
:
'Gotham-Black'
,
fontSize
:
12
}}
>
OUR
DRIVER
WILL
DELIVER
YOUR
ORDER
TO
<
/Text
>
<
Text
style
=
{{
textAlign
:
'center'
,
fontSize
:
12
,
top
:
5
,
fontFamily
:
'Gotham-Light'
}}
>
{
this
.
props
.
address
}
<
/Text
>
<
/
Card
>
<
View
style
=
{{
margin
:
5
,
padding
:
10
}}
>
<
Text
style
=
{{
textAlign
:
'center'
,
fontFamily
:
'Gotham-Black'
,
fontSize
:
12
,
color
:
'grey'
}}
>
OUR
DRIVER
WILL
DELIVER
YOUR
ORDER
TO
<
/Text
>
<
Text
style
=
{{
textAlign
:
'center'
,
fontSize
:
12
,
top
:
5
,
fontFamily
:
'Gotham-Light'
,
color
:
'grey'
}}
>
{
this
.
props
.
address
}
<
/Text
>
<
/
View
>
)
}
<
/View
>
<
View
style
=
{
styles
.
header
}
>
<
Text
style
=
{{
textAlign
:
'center'
,
fontSize
:
12
,
fontFamily
:
'Gotham-Black'
}}
>
YOUR
ORDER
(
S
)
<
/Text
>
<
Text
style
=
{{
textAlign
:
'center'
,
fontSize
:
12
,
fontFamily
:
'Gotham-Black'
,
color
:
'grey'
}}
>
YOUR
ORDER
(
S
)
<
/Text
>
<
TouchableOpacity
onPress
=
{()
=>
this
.
props
.
navigation
.
goBack
()}
>
<
Text
style
=
{{
textAlign
:
'center'
,
fontSize
:
12
,
color
:
'#CFB368'
,
fontFamily
:
'Gotham-Light'
}}
>+
ADD
MORE
<
/Text
>
<
/TouchableOpacity
>
...
...
@@ -495,7 +496,7 @@ class ShoppingCart extends React.Component {
}
<
/View
>
<
View
style
=
{
styles
.
payment
}
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Black'
}}
>
PAYMENT
METHODS
<
/Text
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Black'
,
color
:
'grey'
}}
>
PAYMENT
METHODS
<
/Text
>
<
/View
>
<
View
style
=
{{
alignItems
:
'center'
}}
>
...
...
@@ -505,7 +506,7 @@ class ShoppingCart extends React.Component {
<
Card
style
=
{{
margin
:
5
,
padding
:
10
,
backgroundColor
:
'gray'
}}
>
<
View
style
=
{{
flexDirection
:
'row'
,
justifyContent
:
'space-between'
,
alignItems
:
'center'
}}
>
<
View
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Black'
}}
>
EXCELSO
BALANCE
<
/Text
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Black'
,
color
:
'white'
}}
>
EXCELSO
BALANCE
<
/Text
>
<
/View
>
<
View
style
=
{{
paddingRight
:
10
}}
>
<
FontAwesome
name
=
'circle-o'
size
=
{
30
}
color
=
{
'#ccb46c'
}
/
>
...
...
@@ -519,7 +520,7 @@ class ShoppingCart extends React.Component {
<
Card
style
=
{{
margin
:
5
,
padding
:
10
}}
>
<
View
style
=
{{
flexDirection
:
'row'
,
justifyContent
:
'space-between'
,
alignItems
:
'center'
}}
>
<
View
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Black'
}}
>
EXCELSO
BALANCE
<
/Text
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Black'
,
color
:
'grey'
}}
>
EXCELSO
BALANCE
<
/Text
>
<
/View
>
<
View
style
=
{{
paddingRight
:
10
}}
>
<
CheckBox
...
...
@@ -543,7 +544,7 @@ class ShoppingCart extends React.Component {
<
Card
style
=
{{
margin
:
5
,
padding
:
10
,
backgroundColor
:
'gray'
}}
>
<
View
style
=
{{
flexDirection
:
'row'
,
justifyContent
:
'space-between'
,
alignItems
:
'center'
}}
>
<
View
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Black'
}}
>
EXCELSO
POINTS
<
/Text
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Black'
,
color
:
'white'
}}
>
EXCELSO
POINTS
<
/Text
>
<
/View
>
<
View
style
=
{{
paddingRight
:
10
}}
>
<
FontAwesome
name
=
'circle-o'
size
=
{
30
}
color
=
{
'#ccb46c'
}
/
>
...
...
@@ -558,7 +559,7 @@ class ShoppingCart extends React.Component {
<
Card
style
=
{{
margin
:
5
,
padding
:
10
}}
>
<
View
style
=
{{
flexDirection
:
'row'
,
justifyContent
:
'space-between'
,
alignItems
:
'center'
}}
>
<
View
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Black'
}}
>
EXCELSO
POINTS
<
/Text
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Black'
,
color
:
'grey'
}}
>
EXCELSO
POINTS
<
/Text
>
<
/View
>
<
View
style
=
{{
paddingRight
:
10
}}
>
<
CheckBox
...
...
@@ -585,7 +586,7 @@ class ShoppingCart extends React.Component {
<
Card
style
=
{{
margin
:
5
,
padding
:
10
}}
>
<
View
style
=
{{
flexDirection
:
'row'
,
justifyContent
:
'space-between'
,
alignItems
:
'center'
}}
>
<
View
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Black'
}}
>
EXCELSO
BALANCE
+
POINTS
<
/Text
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Black'
,
color
:
'grey'
}}
>
EXCELSO
BALANCE
+
POINTS
<
/Text
>
<
/View
>
<
View
style
=
{{
paddingRight
:
10
}}
>
<
CheckBox
...
...
@@ -604,7 +605,7 @@ class ShoppingCart extends React.Component {
<
Card
style
=
{{
margin
:
5
,
padding
:
10
,
backgroundColor
:
'gray'
}}
>
<
View
style
=
{{
flexDirection
:
'row'
,
justifyContent
:
'space-between'
,
alignItems
:
'center'
}}
>
<
View
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Black'
}}
>
EXCELSO
BALANCE
+
POINTS
<
/Text
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Black'
,
color
:
'white'
}}
>
EXCELSO
BALANCE
+
POINTS
<
/Text
>
<
/View
>
<
View
style
=
{{
paddingRight
:
10
}}
>
<
FontAwesome
name
=
'circle-o'
size
=
{
30
}
color
=
{
'#ccb46c'
}
/
>
...
...
@@ -619,29 +620,29 @@ class ShoppingCart extends React.Component {
<
Card
style
=
{{
margin
:
5
,
padding
:
10
}}
>
<
View
style
=
{{
flexDirection
:
'row'
,
justifyContent
:
'space-between'
,
marginBottom
:
5
}}
>
<
View
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
}}
>
Your
Balance
<
/Text
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
}}
>
Your
Points
<
/Text
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
,
color
:
'grey'
}}
>
Your
Balance
<
/Text
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
,
color
:
'grey'
}}
>
Your
Points
<
/Text
>
<
/View
>
<
View
style
=
{{
alignItems
:
'flex-end'
}}
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
}}
>
{
this
.
state
.
kasproBalance
}
<
/Text
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
}}
>
{
this
.
state
.
kasproPoint
}
<
/Text
>
<
NumberFormat
decimalScale
=
{
0
}
value
=
{
this
.
state
.
kasproBalance
}
renderText
=
{
value
=>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
,
color
:
'grey'
}}
>
Rp
.
{
value
}
<
/Text>} displayType={'text'} thousandSeparator={true} prefix={''} /
>
<
NumberFormat
decimalScale
=
{
0
}
value
=
{
this
.
state
.
kasproPoint
}
renderText
=
{
value
=>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
,
color
:
'grey'
}}
>
Rp
.
{
value
}
<
/Text>} displayType={'text'} thousandSeparator={true} prefix={''} /
>
<
/View
>
<
/View
>
<
View
style
=
{{
flexDirection
:
'row'
,
justifyContent
:
'space-between'
,
borderTopWidth
:
1
}}
>
<
View
style
=
{{
flexDirection
:
'row'
,
justifyContent
:
'space-between'
,
borderTopWidth
:
1
,
borderColor
:
'grey'
}}
>
<
View
style
=
{{
marginTop
:
5
}}
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
}}
>
Your
Balance
Used
<
/Text
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
}}
>
Your
Points
Used
<
/Text
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
,
color
:
'grey'
}}
>
Your
Balance
Used
<
/Text
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
,
color
:
'grey'
}}
>
Your
Points
Used
<
/Text
>
<
/View
>
<
View
style
=
{{
marginTop
:
5
,
alignItems
:
'flex-end'
}}
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
}}
>-
{
this
.
state
.
balanceused
}
<
/Text
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
}}
>-
{
this
.
state
.
pointsused
}
<
/Text
>
<
NumberFormat
decimalScale
=
{
0
}
value
=
{
this
.
state
.
balanceused
}
renderText
=
{
value
=>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
,
color
:
'grey'
}}
>-
Rp
.
{
value
}
<
/Text>} displayType={'text'} thousandSeparator={true} prefix={''} /
>
<
NumberFormat
decimalScale
=
{
0
}
value
=
{
this
.
state
.
pointsused
}
renderText
=
{
value
=>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
,
color
:
'grey'
}}
>-
Rp
.
{
value
}
<
/Text>} displayType={'text'} thousandSeparator={true} prefix={''} /
>
<
/View
>
<
/View
>
<
/Card
>
<
/View
>
<
View
style
=
{
styles
.
paymentDetails
}
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Black'
}}
>
PAYMENT
DETAILS
<
/Text
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Black'
,
color
:
'grey'
}}
>
PAYMENT
DETAILS
<
/Text
>
<
/View
>
<
View
style
=
{{
margin
:
10
}}
>
{
/* <Text style={{ paddingLeft: 20, paddingTop: 15, color: 'gray' }}>Detail Pembayaran</Text> */
}
...
...
@@ -650,7 +651,7 @@ class ShoppingCart extends React.Component {
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
,
color
:
'gray'
}}
>
Harga
<
/Text
>
<
/View
>
<
View
style
=
{{
paddingRight
:
30
,
paddingTop
:
10
,
alignItems
:
'flex-end'
}}
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
,
color
:
'gray'
}}
>
{
this
.
props
.
order_total
}
<
/Text
>
<
NumberFormat
decimalScale
=
{
0
}
value
=
{
this
.
props
.
order_total
}
renderText
=
{
value
=>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
,
color
:
'gray'
}}
>
Rp
.
{
value
}
<
/Text>} displayType={'text'} thousandSeparator={true} prefix={''} /
>
<
/View
>
<
/View
>
{
this
.
props
.
type_pickup
==
true
?
(
...
...
@@ -663,12 +664,12 @@ class ShoppingCart extends React.Component {
<
/View
>
{
this
.
props
.
order_item
.
length
?
(
<
View
style
=
{{
paddingRight
:
30
,
paddingTop
:
10
,
alignItems
:
'flex-end'
}}
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
,
color
:
'gray'
}}
>
{
this
.
props
.
grabamount
}
<
/Text
>
{
/* <Text style={{ fontSize: 12, fontFamily: 'Gotham-Light', color: 'gray' }}>{this.props.grabamount}</Text> */
}
<
NumberFormat
decimalScale
=
{
0
}
value
=
{
this
.
props
.
grabamount
}
renderText
=
{
value
=>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
,
color
:
'gray'
}}
>
Rp
.
{
value
}
<
/Text>} displayType={'text'} thousandSeparator={true} prefix={''} /
>
<
/View
>
)
:
(
<
View
style
=
{{
paddingRight
:
30
,
paddingTop
:
10
,
alignItems
:
'flex-end'
}}
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
,
color
:
'gray'
}}
>
0
<
/Text
>
<
NumberFormat
decimalScale
=
{
0
}
value
=
{
0
}
renderText
=
{
value
=>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
,
color
:
'gray'
}}
>
Rp
.
{
value
}
<
/Text>} displayType={'text'} thousandSeparator={true} prefix={''} /
>
<
/View>
)
}
<
/View>
)
}
{
...
...
@@ -680,7 +681,7 @@ class ShoppingCart extends React.Component {
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
,
color
:
'gray'
}}
>
Diskon
<
/Text
>
<
/View
>
<
View
style
=
{{
paddingRight
:
30
,
paddingTop
:
10
,
alignItems
:
'flex-end'
}}
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
,
color
:
'gray'
}}
>
{
this
.
props
.
voucher
.
reward
.
value
}
<
/Text
>
<
NumberFormat
decimalScale
=
{
0
}
value
=
{
this
.
props
.
voucher
.
reward
.
value
}
renderText
=
{
value
=>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
,
color
:
'gray'
}}
>
Rp
.
{
value
}
<
/Text>} displayType={'text'} thousandSeparator={true} prefix={''} /
>
<
/View
>
<
/View
>
...
...
@@ -689,15 +690,15 @@ class ShoppingCart extends React.Component {
<
View
style
=
{{
flexDirection
:
'row'
,
marginTop
:
10
,
justifyContent
:
'space-between'
}}
>
<
View
style
=
{{
marginTop
:
15
,
paddingLeft
:
20
,
paddingTop
:
10
}}
>
<
Text
style
=
{{
fontSize
:
25
,
color
:
'#CFB368'
,
fontFamily
:
'Gotham-Black'
,
}}
>
TOTAL
<
/Text
>
<
Text
style
=
{{
fontSize
:
18
,
color
:
'#CFB368'
,
fontFamily
:
'Gotham-Black'
,
}}
>
TOTAL
<
/Text
>
<
/View
>
{
this
.
props
.
type_pickup
==
true
?
(
<
View
style
=
{{
marginTop
:
15
,
paddingRight
:
30
,
paddingTop
:
10
,
alignItems
:
'flex-end'
}}
>
{
this
.
props
.
value_voucher
==
''
?
(
<
Text
style
=
{{
fontSize
:
25
,
color
:
'#CFB368'
,
fontFamily
:
'Gotham-Black'
}}
>
{
this
.
props
.
order_total
}
<
/Text
>
<
NumberFormat
decimalScale
=
{
0
}
value
=
{
this
.
props
.
order_total
}
renderText
=
{
value
=>
<
Text
style
=
{{
fontSize
:
18
,
color
:
'#CFB368'
,
fontFamily
:
'Gotham-Black'
}}
>
Rp
.
{
value
}
<
/Text>} displayType={'text'} thousandSeparator={true} prefix={''} /
>
)
:
(
<
Text
style
=
{{
fontSize
:
25
,
color
:
'#CFB368'
,
fontFamily
:
'Gotham-Black'
}}
>
{
Math
.
max
(
0
,
this
.
props
.
order_total
-
this
.
props
.
voucher
.
reward
.
value
)}
<
/Text
>
<
NumberFormat
decimalScale
=
{
0
}
value
=
{
Math
.
max
(
0
,
this
.
props
.
order_total
-
this
.
props
.
voucher
.
reward
.
value
)}
renderText
=
{
value
=>
<
Text
style
=
{{
fontSize
:
18
,
color
:
'#CFB368'
,
fontFamily
:
'Gotham-Black'
}}
>
Rp
.
{
value
}
<
/Text>} displayType={'text'} thousandSeparator={true} prefix={''} /
>
)
}
<
/View
>
...
...
@@ -709,9 +710,26 @@ class ShoppingCart extends React.Component {
<Text style={{ fontSize: 35, color: '#ccb46c' }}>{this.props.order_total + this.state.diskon}</Text>
)} */
}
{
this
.
props
.
value_voucher
==
''
?
(
<
Text
style
=
{{
fontSize
:
25
,
color
:
'#CFB368'
,
fontFamily
:
'Gotham-Black'
}}
>
{
this
.
props
.
order_total
+
this
.
props
.
grabamount
}
<
/Text
>
<>
{
this
.
props
.
order_item
.
length
?
(
<
NumberFormat
decimalScale
=
{
0
}
value
=
{
this
.
props
.
order_total
+
this
.
props
.
grabamount
}
renderText
=
{
value
=>
<
Text
style
=
{{
fontSize
:
18
,
color
:
'#CFB368'
,
fontFamily
:
'Gotham-Black'
}}
>
Rp
.
{
value
}
<
/Text>} displayType={'text'} thousandSeparator={true} prefix={''} /
>
)
:
(
<
NumberFormat
decimalScale
=
{
0
}
value
=
{
0
}
renderText
=
{
value
=>
<
Text
style
=
{{
fontSize
:
18
,
color
:
'#CFB368'
,
fontFamily
:
'Gotham-Black'
}}
>
Rp
.
{
value
}
<
/Text>} displayType={'text'} thousandSeparator={true} prefix={''} /
>
)
}
<
/
>
)
:
(
<
Text
style
=
{{
fontSize
:
25
,
color
:
'#CFB368'
,
fontFamily
:
'Gotham-Black'
}}
>
{
Math
.
max
(
0
,
this
.
props
.
order_total
-
this
.
props
.
voucher
.
reward
.
value
+
this
.
props
.
grabamount
)}
<
/Text
>
<>
{
this
.
props
.
order_item
.
length
?
(
<
NumberFormat
decimalScale
=
{
0
}
value
=
{
Math
.
max
(
0
,
this
.
props
.
order_total
-
this
.
props
.
voucher
.
reward
.
value
+
this
.
props
.
grabamount
)}
renderText
=
{
value
=>
<
Text
style
=
{{
fontSize
:
18
,
color
:
'#CFB368'
,
fontFamily
:
'Gotham-Black'
}}
>
Rp
.
{
value
}
<
/Text>} displayType={'text'} thousandSeparator={true} prefix={''} /
>
)
:
(
<
NumberFormat
decimalScale
=
{
0
}
value
=
{
0
}
renderText
=
{
value
=>
<
Text
style
=
{{
fontSize
:
18
,
color
:
'#CFB368'
,
fontFamily
:
'Gotham-Black'
}}
>
Rp
.
{
value
}
<
/Text>} displayType={'text'} thousandSeparator={true} prefix={''} /
>
)
}
<
/
>
)}
<
/View
>
...
...
@@ -758,6 +776,7 @@ const styles = StyleSheet.create({
padding
:
20
,
borderBottomWidth
:
1
,
borderTopWidth
:
1
,
borderColor
:
'grey'
,
flexDirection
:
'row'
,
alignItems
:
'center'
,
justifyContent
:
'space-between'
...
...
@@ -775,6 +794,7 @@ const styles = StyleSheet.create({
padding
:
20
,
borderTopWidth
:
1
,
borderBottomWidth
:
1
,
borderColor
:
'grey'
// backgroundColor: 'lightblue'
},
...
...
@@ -784,6 +804,7 @@ const styles = StyleSheet.create({
padding
:
20
,
borderTopWidth
:
1
,
borderBottomWidth
:
1
,
borderColor
:
'grey'
// backgroundColor: 'lightblue'
},
...
...
@@ -793,6 +814,7 @@ const styles = StyleSheet.create({
padding
:
20
,
borderTopWidth
:
1
,
borderBottomWidth
:
1
,
borderColor
:
'grey'
// backgroundColor: 'lightblue'
},
button
:
{
...
...
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