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
09dc293c
Commit
09dc293c
authored
May 04, 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
# Conflicts: # view/MenuSelection.js
parents
ec8a6ac2
f72d6870
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
55 additions
and
16 deletions
+55
-16
Home.js
view/Home.js
+13
-1
MenuConfirmation.js
view/MenuConfirmation.js
+4
-3
MenuSelection.js
view/MenuSelection.js
+12
-4
ShoppingCart.js
view/ShoppingCart.js
+26
-8
No files found.
view/Home.js
View file @
09dc293c
...
...
@@ -140,10 +140,22 @@ class Home extends React.Component {
})
}
_pickup
()
{
this
.
props
.
navigation
.
navigate
(
'Pickup Name'
,
{
from
:
'home'
});
}
_delivery
(){
this
.
props
.
navigation
.
navigate
(
'Delivery Address'
,
{
from
:
'home'
});
}
_orderNow
=
()
=>
{
if
(
this
.
props
.
outlet_id
!=
''
&&
this
.
props
.
name_outlet
!=
''
)
{
this
.
props
.
setTypePickup
(
true
)
this
.
props
.
navigation
.
navigate
(
"Menu Select"
)
this
.
props
.
navigation
.
navigate
(
'Home'
,
{
screen
:
'MENU'
,
params
:
{
user
:
'jaxi'
},
});
}
else
{
Alert
.
alert
(
'Belum dapat outlet terdekat'
)
}
...
...
view/MenuConfirmation.js
View file @
09dc293c
...
...
@@ -81,9 +81,10 @@ class MenuConfirmation extends React.Component {
orderSuccess
=
()
=>
{
this
.
props
.
setOrderFinish
()
this
.
props
.
navigation
.
reset
({
routes
:
[{
name
:
'Home'
}]
})
this
.
props
.
navigation
.
navigate
(
'Home'
,
{
screen
:
'ORDER'
,
params
:
{
user
:
'jax'
},
});
}
...
...
view/MenuSelection.js
View file @
09dc293c
import
React
from
'react'
;
import
{
View
,
Text
,
StyleSheet
,
ScrollView
,
TouchableOpacity
,
Image
,
FlatList
,
Button
,
StatusBar
,
ActivityIndicator
}
from
'react-native'
;
import
{
View
,
Text
,
StyleSheet
,
ScrollView
,
TouchableOpacity
,
Image
,
FlatList
,
Button
,
StatusBar
,
ActivityIndicator
,
Alert
}
from
'react-native'
;
import
Axios
from
'axios'
;
import
Item
from
'./Item'
;
import
{
connect
}
from
'react-redux'
;
...
...
@@ -25,10 +25,18 @@ class MenuSelection extends React.Component {
}
componentDidMount
()
{
if
(
this
.
props
.
outlet_id
!=
''
)
{
this
.
getMenuList
()
}
else
{
Alert
.
alert
(
'Device belum mendapatkan lokasi anda'
)
}
console
.
log
(
"INI OUTLET : "
+
this
.
props
.
outlet_id
)
this
.
_unsubscribe
=
this
.
props
.
navigation
.
addListener
(
'focus'
,
()
=>
{
if
(
this
.
props
.
outlet_id
!=
''
)
{
this
.
getMenuList
()
console
.
log
(
"INI DI RELOAD"
);
}
else
{
Alert
.
alert
(
'Device belum mendapatkan lokasi anda'
)
}
});
}
...
...
view/ShoppingCart.js
View file @
09dc293c
...
...
@@ -46,7 +46,19 @@ class ShoppingCart extends React.Component {
this
.
getRate
()
}
this
.
getBalance
()
this
.
_unsubscribe
=
this
.
props
.
navigation
.
addListener
(
'focus'
,
()
=>
{
if
(
!
this
.
props
.
type_pickup
)
{
this
.
getRate
()
}
this
.
getBalance
()
});
}
componentWillUnmount
()
{
this
.
_unsubscribe
();
}
checkChangeTrans
(
val
)
{
...
...
@@ -549,6 +561,10 @@ class ShoppingCart extends React.Component {
<
/View
>
)}
<
/View
>
{
this
.
props
.
type_pickup
==
true
?
(
null
):(
<
View
style
=
{{
flexDirection
:
'row'
,
marginTop
:
10
,
justifyContent
:
'space-between'
}}
>
<
View
>
<
Text
style
=
{{
paddingLeft
:
20
,
paddingTop
:
10
,
color
:
'gray'
}}
>
Tujuan
<
/Text
>
...
...
@@ -557,6 +573,8 @@ class ShoppingCart extends React.Component {
<
Text
style
=
{{
color
:
'#ccb46c'
}}
>
{
this
.
props
.
address
}
<
/Text
>
<
/View
>
<
/View
>
)}
<
View
style
=
{{
margin
:
20
,
}}
>
<
Button
title
=
'Checkout'
color
=
'#ccb46c'
onPress
=
{()
=>
this
.
checkOut
()}
/
>
<
/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