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
ca55e122
Commit
ca55e122
authored
May 18, 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
7ebf6ad8
e6ff26ce
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
271 additions
and
62 deletions
+271
-62
App.js
App.js
+56
-3
app.json
app.json
+5
-2
notification.png
assets/icon/notification.png
+0
-0
RootNavigation.js
helper/RootNavigation.js
+7
-0
Home.js
view/Home.js
+1
-1
MenuConfirmation.js
view/MenuConfirmation.js
+175
-39
ShoppingCart.js
view/ShoppingCart.js
+27
-17
No files found.
App.js
View file @
ca55e122
...
@@ -12,11 +12,14 @@ import i18n from 'i18n-js';
...
@@ -12,11 +12,14 @@ import i18n from 'i18n-js';
import
en
from
'./lib/en'
;
import
en
from
'./lib/en'
;
import
id
from
'./lib/id'
;
import
id
from
'./lib/id'
;
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
{
Text
,
View
}
from
'react-native'
;
import
{
Alert
,
Vibration
}
from
'react-native'
;
import
{
AppLoading
}
from
'expo'
;
import
{
AppLoading
,
Notifications
}
from
'expo'
;
import
*
as
Font
from
'expo-font'
;
import
*
as
Font
from
'expo-font'
;
import
*
as
Sentry
from
'sentry-expo'
;
import
*
as
Sentry
from
'sentry-expo'
;
import
Constants
from
'expo-constants'
;
import
Constants
from
'expo-constants'
;
import
{
navigationRef
}
from
'./helper/RootNavigation'
;
import
*
as
RootNavigation
from
'./helper/RootNavigation'
;
Sentry
.
init
({
Sentry
.
init
({
dsn
:
'https://ae2449ac801244d99f170140c7cd6d0a@o392471.ingest.sentry.io/5239999'
,
dsn
:
'https://ae2449ac801244d99f170140c7cd6d0a@o392471.ingest.sentry.io/5239999'
,
...
@@ -58,8 +61,58 @@ export default function App() {
...
@@ -58,8 +61,58 @@ export default function App() {
await
Font
.
loadAsync
(
customFonts
);
await
Font
.
loadAsync
(
customFonts
);
};
};
const
routing
=
(
data
)
=>
{
if
(
data
.
action_type
==
'Rewards'
)
{
RootNavigation
.
navigate
(
'Reward Detail'
,
{
rewardId
:
data
.
data_id
});
}
else
if
(
data
.
action_type
==
'Inbox'
)
{
}
else
if
(
data
.
action_type
==
'Transaction'
)
{
RootNavigation
.
navigate
(
'Transaction Detail'
,
{
idTrans
:
data
.
data_id
});
}
else
if
(
data
.
action_type
==
'Review'
)
{
}
else
if
(
data
.
action_type
==
'WebView'
)
{
}
else
if
(
data
.
action_type
==
'Transfer Receive'
)
{
}
else
if
(
data
.
action_type
==
'Cashback'
)
{
}
}
const
handleNotification
=
notification
=>
{
// console.log('Notification Origin : ' + JSON.stringify(notification.origin))
// console.log('Notification Payload Data : ' + JSON.stringify(notification.data))
const
origin
=
notification
.
origin
;
const
data
=
notification
.
data
;
if
(
origin
==
'selected'
)
{
routing
(
data
)
}
else
{
Vibration
.
vibrate
();
Alert
.
alert
(
data
.
title
,
data
.
body
,
[
{
text
:
'Close'
,
style
:
'cancel'
,
},
{
text
:
'View'
,
onPress
:
()
=>
{
routing
(
data
)
}
},
],
{
cancelable
:
false
},
)
}
}
useEffect
(()
=>
{
useEffect
(()
=>
{
console
.
log
(
'===> Did Mount'
);
console
.
log
(
'===> Did Mount'
);
this
.
_notificationSubscription
=
Notifications
.
addListener
(
handleNotification
);
loadFont
().
then
(
_
=>
{
loadFont
().
then
(
_
=>
{
setfontsLoaded
(
true
);
setfontsLoaded
(
true
);
})
})
...
@@ -71,7 +124,7 @@ export default function App() {
...
@@ -71,7 +124,7 @@ export default function App() {
return
(
return
(
<
Provider
store
=
{
store
}
>
<
Provider
store
=
{
store
}
>
<
PersistGate
loading
=
{
null
}
persistor
=
{
persistor
}
>
<
PersistGate
loading
=
{
null
}
persistor
=
{
persistor
}
>
<
NavigationContainer
>
<
NavigationContainer
ref
=
{
navigationRef
}
>
<
Auth
/>
<
Auth
/>
<
/NavigationContainer
>
<
/NavigationContainer
>
<
/PersistGate
>
<
/PersistGate
>
...
...
app.json
View file @
ca55e122
...
@@ -30,7 +30,7 @@
...
@@ -30,7 +30,7 @@
},
},
"android"
:
{
"android"
:
{
"package"
:
"local.ravExcelso"
,
"package"
:
"local.ravExcelso"
,
"versionCode"
:
20
200327
"versionCode"
:
20
05151310
},
},
"description"
:
""
,
"description"
:
""
,
"hooks"
:
{
"hooks"
:
{
...
@@ -45,6 +45,9 @@
...
@@ -45,6 +45,9 @@
}
}
}
}
]
]
},
"notification"
:
{
"icon"
:
"./assets/icon/notification.png"
}
}
}
}
}
}
\ No newline at end of file
assets/icon/notification.png
0 → 100644
View file @
ca55e122
5.5 KB
helper/RootNavigation.js
0 → 100644
View file @
ca55e122
import
*
as
React
from
'react'
;
export
const
navigationRef
=
React
.
createRef
();
export
function
navigate
(
name
,
params
)
{
navigationRef
.
current
?.
navigate
(
name
,
params
);
}
\ No newline at end of file
view/Home.js
View file @
ca55e122
...
@@ -367,7 +367,7 @@ class Home extends React.Component {
...
@@ -367,7 +367,7 @@ class Home extends React.Component {
<
View
style
=
{{
flexDirection
:
'row'
,
flex
:
1
}}
>
<
View
style
=
{{
flexDirection
:
'row'
,
flex
:
1
}}
>
<
TouchableOpacity
<
TouchableOpacity
// style={styles.submitUpgradePemium}
// style={styles.submitUpgradePemium}
activeOpacity
=
{.
5
}
onPress
=
{
this
.
onPress
}
>
activeOpacity
=
{.
5
}
onPress
=
{
()
=>
this
.
props
.
navigation
.
navigate
(
'TopUpInfo'
)
}
>
<
View
style
=
{
styles
.
topUseBalance
}
>
<
View
style
=
{
styles
.
topUseBalance
}
>
<
Text
style
=
{{
textAlign
:
'center'
,
bottom
:
5
,
color
:
'white'
,
fontFamily
:
'Gotham-Black'
}}
>
TOP
BALANCE
<
/Text
>
<
Text
style
=
{{
textAlign
:
'center'
,
bottom
:
5
,
color
:
'white'
,
fontFamily
:
'Gotham-Black'
}}
>
TOP
BALANCE
<
/Text
>
<
/View
>
<
/View
>
...
...
view/MenuConfirmation.js
View file @
ca55e122
import
React
from
'react'
;
import
React
from
'react'
;
import
{
View
,
Text
,
Alert
,
T
extInput
,
StyleSheet
,
Button
,
ScrollView
}
from
'react-native'
;
import
{
View
,
Text
,
Alert
,
T
ouchableOpacity
,
StyleSheet
,
Button
,
ScrollView
}
from
'react-native'
;
import
Axios
from
'axios'
import
Axios
from
'axios'
import
{
connect
}
from
'react-redux'
import
{
connect
}
from
'react-redux'
import
ActionType
from
'../redux/globalActionType'
;
import
ActionType
from
'../redux/globalActionType'
;
import
Spinner
from
'react-native-loading-spinner-overlay'
;
import
Spinner
from
'react-native-loading-spinner-overlay'
;
import
session
from
'../function/session'
;
import
session
from
'../function/session'
;
import
moment
from
'moment'
import
{
FontAwesome
}
from
'@expo/vector-icons'
;
class
MenuConfirmation
extends
React
.
Component
{
class
MenuConfirmation
extends
React
.
Component
{
constructor
(
props
)
{
constructor
(
props
)
{
super
(
props
)
super
(
props
)
...
@@ -29,6 +31,8 @@ class MenuConfirmation extends React.Component {
...
@@ -29,6 +31,8 @@ class MenuConfirmation extends React.Component {
// console.log("type" +this.props.grabtype)
// console.log("type" +this.props.grabtype)
// console.log("BALANCED" +this.props.balanceUsed)
// console.log("BALANCED" +this.props.balanceUsed)
// console.log("POINT" +this.props.pointsused)
// console.log("POINT" +this.props.pointsused)
// console.log(this.props.type_pickup)
// console.log('kosong'+this.props.value_voucher)
}
}
...
@@ -37,6 +41,7 @@ class MenuConfirmation extends React.Component {
...
@@ -37,6 +41,7 @@ class MenuConfirmation extends React.Component {
this
.
setState
({
this
.
setState
({
spinner
:
true
,
spinner
:
true
,
})
})
// console.log(is_pickup)
if
(
is_pickup
)
{
if
(
is_pickup
)
{
this
.
setState
({
this
.
setState
({
type
:
'Pick Up'
type
:
'Pick Up'
...
@@ -46,6 +51,7 @@ class MenuConfirmation extends React.Component {
...
@@ -46,6 +51,7 @@ class MenuConfirmation extends React.Component {
type
:
'Delivery'
type
:
'Delivery'
})
})
}
}
// console.log(this.state.type)
// console.log(is_pickup)
// console.log(is_pickup)
if
(
this
.
props
.
value_voucher
==
''
)
{
if
(
this
.
props
.
value_voucher
==
''
)
{
...
@@ -53,7 +59,7 @@ class MenuConfirmation extends React.Component {
...
@@ -53,7 +59,7 @@ class MenuConfirmation extends React.Component {
session_id
:
this
.
props
.
session_id
,
session_id
:
this
.
props
.
session_id
,
outlet_id
:
this
.
props
.
outlet_id
,
outlet_id
:
this
.
props
.
outlet_id
,
address_id
:
this
.
props
.
addressId
,
address_id
:
this
.
props
.
addressId
,
trans_type
:
this
.
state
.
type
,
trans_type
:
this
.
props
.
type_pickup
?
'Pick Up'
:
'Delivery'
,
order_item
:
this
.
props
.
order_item
,
order_item
:
this
.
props
.
order_item
,
delivery_charge
:
this
.
props
.
grabamount
,
delivery_charge
:
this
.
props
.
grabamount
,
voucher
:
[],
voucher
:
[],
...
@@ -106,10 +112,11 @@ class MenuConfirmation extends React.Component {
...
@@ -106,10 +112,11 @@ class MenuConfirmation extends React.Component {
{
cancelable
:
false
}
{
cancelable
:
false
}
);
);
}).
catch
(
error
=>
{
}).
catch
(
error
=>
{
const
{
navigation
}
=
this
.
props
// const { navigation } = this.props
let
response
=
error
.
response
.
data
// let response = error.response.data
session
(
response
,
navigation
)
// session(response, navigation)
Alert
.
alert
(
response
.
msg
);
console
.
log
(
error
)
Alert
.
alert
(
'error'
,
error
.
response
.
msg
);
this
.
setState
({
this
.
setState
({
spinner
:
false
,
spinner
:
false
,
})
})
...
@@ -120,7 +127,7 @@ class MenuConfirmation extends React.Component {
...
@@ -120,7 +127,7 @@ class MenuConfirmation extends React.Component {
session_id
:
this
.
props
.
session_id
,
session_id
:
this
.
props
.
session_id
,
outlet_id
:
this
.
props
.
outlet_id
,
outlet_id
:
this
.
props
.
outlet_id
,
address_id
:
this
.
props
.
addressId
,
address_id
:
this
.
props
.
addressId
,
trans_type
:
this
.
state
.
type
,
trans_type
:
this
.
props
.
type_pickup
?
'Pick Up'
:
'Delivery'
,
order_item
:
this
.
props
.
order_item
,
order_item
:
this
.
props
.
order_item
,
delivery_charge
:
this
.
props
.
grabamount
,
delivery_charge
:
this
.
props
.
grabamount
,
voucher
:
[{
voucher
:
[{
...
@@ -176,10 +183,10 @@ class MenuConfirmation extends React.Component {
...
@@ -176,10 +183,10 @@ class MenuConfirmation extends React.Component {
{
cancelable
:
false
}
{
cancelable
:
false
}
);
);
}).
catch
(
error
=>
{
}).
catch
(
error
=>
{
const
{
navigation
}
=
this
.
props
//
const { navigation } = this.props
let
response
=
error
.
response
.
data
//
let response = error.response.data
session
(
response
,
navigation
)
//
session(response, navigation)
Alert
.
alert
(
response
.
msg
);
Alert
.
alert
(
error
.
response
.
msg
);
this
.
setState
({
this
.
setState
({
spinner
:
false
,
spinner
:
false
,
})
})
...
@@ -197,7 +204,7 @@ class MenuConfirmation extends React.Component {
...
@@ -197,7 +204,7 @@ class MenuConfirmation extends React.Component {
render
()
{
render
()
{
// console.log(this.props.value_voucher
)
console
.
log
(
this
.
props
.
session_id
)
let
total
=
0
let
total
=
0
return
(
return
(
<
ScrollView
style
=
{
styles
.
container
}
>
<
ScrollView
style
=
{
styles
.
container
}
>
...
@@ -206,33 +213,159 @@ class MenuConfirmation extends React.Component {
...
@@ -206,33 +213,159 @@ class MenuConfirmation extends React.Component {
textContent
=
{
'Sedang Proses...'
}
textContent
=
{
'Sedang Proses...'
}
textStyle
=
{
styles
.
spinnerTextStyle
}
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
>
<
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
.
props
.
type_pickup
==
true
?
(
<
View
style
=
{{
flex
:
0.6
,
justifyContent
:
'center'
}}
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
}}
>
{
this
.
props
.
name_outlet
}
<
/Text
>
<
/View
>
)
:
(
<
View
style
=
{{
flex
:
0.6
,
justifyContent
:
'center'
}}
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
}}
>
{
this
.
props
.
address
}
<
/Text
>
<
/View
>
)
}
{
this
.
props
.
type_pickup
==
true
?
(
<
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
.
props
.
order_item
.
map
((
item
,
index
)
=>
{
this
.
props
.
order_item
.
map
((
item
,
index
)
=>
{
total
=
total
+
item
.
quantity
*
item
.
price
total
=
total
+
item
.
quantity
*
item
.
price
return
(
return
(
<
View
style
=
{{
margin
:
10
}}
key
=
{
index
}
>
<
View
style
=
{{
margin
:
10
}}
key
=
{
index
}
>
<
View
style
=
{{
flex
:
1
,
margin
:
10
,
flexDirection
:
'row'
,
justifyContent
:
'space-around'
}}
>
<
View
style
=
{{
flex
:
1
,
margin
:
10
,
flexDirection
:
'row'
,
justifyContent
:
'space-around'
}}
>
<
View
style
=
{{
flex
:
0.3
,
alignItems
:
'center'
}}
>
<
View
style
=
{{
flex
:
0.3
,
alignItems
:
'center'
}}
>
<
Text
>
{
item
.
quantity
}
<
/Text
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
}}
>
{
item
.
quantity
}
<
/Text
>
<
/View
>
<
/View
>
<
View
style
=
{{
flex
:
0.1
,
alignItems
:
'flex-start'
}}
>
<
View
style
=
{{
flex
:
0.1
,
alignItems
:
'flex-start'
}}
>
<
Text
>
x
<
/Text
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
}}
>
x
<
/Text
>
<
/View
>
<
/View
>
<
View
style
=
{{
flex
:
0.3
,
alignItems
:
'baseline'
}}
>
<
View
style
=
{{
flex
:
0.3
,
alignItems
:
'baseline'
}}
>
<
Text
>
{
item
.
name
}
<
/Text
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
}}
>
{
item
.
name
}
<
/Text
>
<
/View
>
<
/View
>
<
View
style
=
{{
flex
:
0.3
,
alignItems
:
'flex-end'
}}
>
<
View
style
=
{{
flex
:
0.3
,
alignItems
:
'flex-end'
}}
>
<
Text
>
{
item
.
quantity
*
item
.
price
}
<
/Text
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
}}
>
{
item
.
quantity
*
item
.
price
}
<
/Text
>
<
/View
>
<
/View
>
<
/View
>
<
/View
>
<
/View
>
<
/View
>
)
)
})
})
}
}
<
View
style
=
{{
alignItems
:
'flex-end'
,
borderTopWidth
:
1
,
margin
:
10
,
padding
:
10
}}
>
{
<
Text
>
{
total
}
<
/Text
>
this
.
props
.
value_voucher
==
''
?
(
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
>
<
View
style
=
{{
flexDirection
:
'row'
,
margin
:
10
,
justifyContent
:
'space-between'
}}
>
<
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
.
props
.
route
.
params
.
balanceUsed
}
<
/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
.
props
.
route
.
params
.
pointused
}
<
/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'
}}
>
{
total
}
<
/Text
>
<
/View
>
<
/View
>
{
this
.
props
.
value_voucher
==
''
?
(
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
.
props
.
voucher
.
reward
.
value
}
<
/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
>
{
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
>
)
:
(
<
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
>
<
/View
>
)
}
<
/View
>
{
/* <View style={{ flexDirection: 'row', margin: 10, justifyContent: 'space-between' }}>
<View style={{ margin: 10 }}>
<View style={{ margin: 10 }}>
<Text>Voucher Discount</Text>
<Text>Voucher Discount</Text>
</View>
</View>
...
@@ -292,22 +425,7 @@ class MenuConfirmation extends React.Component {
...
@@ -292,22 +425,7 @@ class MenuConfirmation extends React.Component {
)}
)}
</View>
</View>
<
View
style
=
{{
flexDirection
:
'row'
,
margin
:
10
,
justifyContent
:
'space-between'
,
borderTopWidth
:
1
}}
>
<
View
style
=
{{
margin
:
10
}}
>
<
Text
>
Balance
Used
<
/Text
>
<
/View
>
<
View
style
=
{{
margin
:
10
}}
>
<
Text
>
{
this
.
props
.
route
.
params
.
balanceUsed
}
<
/Text
>
<
/View
>
<
/View
>
<
View
style
=
{{
flexDirection
:
'row'
,
margin
:
10
,
justifyContent
:
'space-between'
}}
>
<
View
style
=
{{
margin
:
10
}}
>
<
Text
>
Point
Used
<
/Text
>
<
/View
>
<
View
style
=
{{
margin
:
10
}}
>
<
Text
>
{
this
.
props
.
route
.
params
.
pointused
}
<
/Text
>
<
/View
>
<
/View
>
{this.props.type_pickup == true ? (
{this.props.type_pickup == true ? (
null
null
) : (
) : (
...
@@ -319,10 +437,16 @@ class MenuConfirmation extends React.Component {
...
@@ -319,10 +437,16 @@ class MenuConfirmation extends React.Component {
<Text>{this.props.address}</Text>
<Text>{this.props.address}</Text>
</View>
</View>
</View>
</View>
)}
)}
*/
}
<
View
style
=
{{
margin
:
10
}}
>
{
/*
<View style={{ margin: 10 }}>
<Button title='order' onPress={() => this.setOrder(this.props.type_pickup)} />
<Button title='order' onPress={() => this.setOrder(this.props.type_pickup)} />
<
/View
>
</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
>
<
/TouchableOpacity
>
<
View
style
=
{{
height
:
30
}}
/
>
<
/ScrollView
>
<
/ScrollView
>
)
)
}
}
...
@@ -349,6 +473,15 @@ const styles = StyleSheet.create({
...
@@ -349,6 +473,15 @@ const styles = StyleSheet.create({
body
:
{
body
:
{
flex
:
3
,
flex
:
3
,
},
},
button
:
{
backgroundColor
:
'#CFB368'
,
marginTop
:
25
,
marginHorizontal
:
30
,
borderRadius
:
10
,
paddingVertical
:
5
,
alignItems
:
'center'
,
justifyContent
:
'center'
},
})
})
...
@@ -387,7 +520,10 @@ const mapStateToProps = (state) => {
...
@@ -387,7 +520,10 @@ const mapStateToProps = (state) => {
grabdestination
:
state
.
grabdestination
,
grabdestination
:
state
.
grabdestination
,
balanceUsed
:
state
.
balanceUsed
,
balanceUsed
:
state
.
balanceUsed
,
pointused
:
state
.
pointused
,
pointused
:
state
.
pointused
,
address
:
state
.
address
,
addressId
:
state
.
addressId
,
addressId
:
state
.
addressId
,
outlet_id
:
state
.
outlet_id
,
name_outlet
:
state
.
name_outlet
,
lat
:
state
.
lat
,
lat
:
state
.
lat
,
long
:
state
.
long
long
:
state
.
long
}
}
...
...
view/ShoppingCart.js
View file @
ca55e122
...
@@ -126,6 +126,17 @@ class ShoppingCart extends React.Component {
...
@@ -126,6 +126,17 @@ class ShoppingCart extends React.Component {
this
.
props
.
navigation
.
navigate
(
'Reward Select'
)
this
.
props
.
navigation
.
navigate
(
'Reward Select'
)
}
}
handleAddVoucher
()
{
this
.
setState
({
checkedBalance
:
false
,
checkedPoint
:
false
,
checkedBalancePoint
:
false
,
pointsused
:
0
,
balanceused
:
0
})
this
.
props
.
navigation
.
navigate
(
'Reward Select'
)
}
handleMin
(
item
,
index
)
{
handleMin
(
item
,
index
)
{
this
.
setState
({
this
.
setState
({
checkedBalance
:
false
,
checkedBalance
:
false
,
...
@@ -437,7 +448,7 @@ class ShoppingCart extends React.Component {
...
@@ -437,7 +448,7 @@ class ShoppingCart extends React.Component {
<
/Card
>
<
/Card
>
)
:
(
)
:
(
<
Card
style
=
{{
margin
:
5
,
padding
:
10
}}
>
<
Card
style
=
{{
margin
:
5
,
padding
:
10
}}
>
<
Text
style
=
{{
textAlign
:
'center'
,
fontFamily
:
'Gotham-Black'
,
fontSize
:
12
}}
>
OUR
DRIVER
WILL
DELIVER
YOU
ORDER
TO
<
/Text
>
<
Text
style
=
{{
textAlign
:
'center'
,
fontFamily
:
'Gotham-Black'
,
fontSize
:
12
}}
>
OUR
DRIVER
WILL
DELIVER
YOU
R
ORDER
TO
<
/Text
>
<
Text
style
=
{{
textAlign
:
'center'
,
fontSize
:
12
,
top
:
5
,
fontFamily
:
'Gotham-Light'
}}
>
{
this
.
props
.
address
}
<
/Text
>
<
Text
style
=
{{
textAlign
:
'center'
,
fontSize
:
12
,
top
:
5
,
fontFamily
:
'Gotham-Light'
}}
>
{
this
.
props
.
address
}
<
/Text
>
<
/Card
>
<
/Card
>
)
)
...
@@ -466,7 +477,7 @@ class ShoppingCart extends React.Component {
...
@@ -466,7 +477,7 @@ class ShoppingCart extends React.Component {
<
View
style
=
{
styles
.
voucher
}
>
<
View
style
=
{
styles
.
voucher
}
>
{
{
this
.
props
.
value_voucher
==
''
?
(
this
.
props
.
value_voucher
==
''
?
(
<
TouchableOpacity
onPress
=
{()
=>
this
.
props
.
navigation
.
navigate
(
'Reward Select'
)}
>
<
TouchableOpacity
onPress
=
{()
=>
this
.
handleAddVoucher
(
)}
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
,
color
:
'#CFB368'
}}
>+
ADD
VOUCHER
<
/Text
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
,
color
:
'#CFB368'
}}
>+
ADD
VOUCHER
<
/Text
>
<
/TouchableOpacity
>
<
/TouchableOpacity
>
)
:
(
)
:
(
...
@@ -611,7 +622,7 @@ class ShoppingCart extends React.Component {
...
@@ -611,7 +622,7 @@ class ShoppingCart extends React.Component {
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
}}
>
Your
Balance
<
/Text
>
<
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'
}}
>
Your
Points
<
/Text
>
<
/View
>
<
/View
>
<
View
style
=
{{
paddingRight
:
30
,
alignItems
:
'flex-end'
}}
>
<
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
.
kasproBalance
}
<
/Text
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
}}
>
{
this
.
state
.
kasproPoint
}
<
/Text
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
}}
>
{
this
.
state
.
kasproPoint
}
<
/Text
>
<
/View
>
<
/View
>
...
@@ -621,7 +632,7 @@ class ShoppingCart extends React.Component {
...
@@ -621,7 +632,7 @@ class ShoppingCart extends React.Component {
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
}}
>
Your
Balance
Used
<
/Text
>
<
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'
}}
>
Your
Points
Used
<
/Text
>
<
/View
>
<
/View
>
<
View
style
=
{{
paddingRight
:
30
,
marginTop
:
5
,
alignItems
:
'flex-end'
}}
>
<
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
.
balanceused
}
<
/Text
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
}}
>-
{
this
.
state
.
pointsused
}
<
/Text
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
}}
>-
{
this
.
state
.
pointsused
}
<
/Text
>
<
/View
>
<
/View
>
...
@@ -660,23 +671,22 @@ class ShoppingCart extends React.Component {
...
@@ -660,23 +671,22 @@ class ShoppingCart extends React.Component {
<
/View>
)
}
<
/View>
)
}
<
View
style
=
{{
flexDirection
:
'row'
,
marginTop
:
10
,
justifyContent
:
'space-between'
}}
>
{
<
View
style
=
{{
paddingLeft
:
20
,
paddingTop
:
10
,
}}
>
this
.
props
.
value_voucher
==
''
?
(
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
,
color
:
'gray'
}}
>
Diskon
<
/Text
>
null
<
/View
>
)
:
(
{
<
View
style
=
{{
flexDirection
:
'row'
,
marginTop
:
10
,
justifyContent
:
'space-between'
}}
>
this
.
props
.
value_voucher
==
''
?
(
<
View
style
=
{{
paddingLeft
:
20
,
paddingTop
:
10
,
}}
>
<
View
style
=
{{
paddingRight
:
30
,
paddingTop
:
10
,
alignItems
:
'flex-end'
}}
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
,
color
:
'gray'
}}
>
Diskon
<
/Text
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
,
color
:
'gray'
}}
>
{
this
.
state
.
diskon
}
<
/Text
>
<
/View
>
<
/View
>
)
:
(
<
View
style
=
{{
paddingRight
:
30
,
paddingTop
:
10
,
alignItems
:
'flex-end'
}}
>
<
View
style
=
{{
paddingRight
:
30
,
paddingTop
:
10
,
alignItems
:
'flex-end'
}}
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
,
color
:
'gray'
}}
>
{
this
.
props
.
voucher
.
reward
.
value
}
<
/Text
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
,
color
:
'gray'
}}
>
{
this
.
props
.
voucher
.
reward
.
value
}
<
/Text
>
<
/View
>
<
/View
>
)
<
/View
>
}
)
}
<
/View
>
<
View
style
=
{{
flexDirection
:
'row'
,
marginTop
:
10
,
justifyContent
:
'space-between'
}}
>
<
View
style
=
{{
flexDirection
:
'row'
,
marginTop
:
10
,
justifyContent
:
'space-between'
}}
>
<
View
style
=
{{
marginTop
:
15
,
paddingLeft
:
20
,
paddingTop
:
10
}}
>
<
View
style
=
{{
marginTop
:
15
,
paddingLeft
:
20
,
paddingTop
:
10
}}
>
<
Text
style
=
{{
fontSize
:
25
,
color
:
'#CFB368'
,
fontFamily
:
'Gotham-Black'
,
}}
>
TOTAL
<
/Text
>
<
Text
style
=
{{
fontSize
:
25
,
color
:
'#CFB368'
,
fontFamily
:
'Gotham-Black'
,
}}
>
TOTAL
<
/Text
>
...
...
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