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
baf57aa8
Commit
baf57aa8
authored
Apr 27, 2020
by
Trisno
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
03cdc02e
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
11 deletions
+25
-11
globalReducer.js
redux/globalReducer.js
+4
-3
DeliveryAddrees.js
view/DeliveryAddrees.js
+8
-3
MenuSelection.js
view/MenuSelection.js
+3
-2
PickupName.js
view/PickupName.js
+10
-3
No files found.
redux/globalReducer.js
View file @
baf57aa8
...
@@ -58,7 +58,8 @@ const globalState = {
...
@@ -58,7 +58,8 @@ const globalState = {
order_quantity
:
0
,
order_quantity
:
0
,
order_total
:
0
,
order_total
:
0
,
address
:
''
address
:
''
,
addressId
:
''
}
}
const
rootReducer
=
(
state
=
globalState
,
action
)
=>
{
const
rootReducer
=
(
state
=
globalState
,
action
)
=>
{
...
@@ -205,8 +206,8 @@ const rootReducer = (state = globalState, action) => {
...
@@ -205,8 +206,8 @@ const rootReducer = (state = globalState, action) => {
case
ActionType
.
SET_ADDRESS
:{
case
ActionType
.
SET_ADDRESS
:{
return
{
return
{
...
state
,
...
state
,
address
:
action
.
data
.
address
address
:
action
.
data
.
address
,
addressId
:
action
.
data
.
addressId
}
}
}
}
case
ActionType
.
SET_LOGOUT
:{
case
ActionType
.
SET_LOGOUT
:{
...
...
view/DeliveryAddrees.js
View file @
baf57aa8
...
@@ -15,7 +15,7 @@ class DeliveryAddrees extends React.Component {
...
@@ -15,7 +15,7 @@ class DeliveryAddrees extends React.Component {
componentDidMount
()
{
componentDidMount
()
{
this
.
getAddreess
()
this
.
getAddreess
()
console
.
log
(
this
.
props
)
console
.
log
(
"INI ID ADDRESS : "
+
this
.
props
.
addressId
)
}
}
onChangeAddress
=
data
=>
{
onChangeAddress
=
data
=>
{
...
@@ -35,12 +35,13 @@ class DeliveryAddrees extends React.Component {
...
@@ -35,12 +35,13 @@ class DeliveryAddrees extends React.Component {
for
(
let
i
=
0
;
i
<
dataAlamat
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
dataAlamat
.
length
;
i
++
)
{
const
element
=
dataAlamat
[
i
];
const
element
=
dataAlamat
[
i
];
address
.
push
(
element
)
address
.
push
(
element
)
}
}
this
.
setState
({
this
.
setState
({
data
:
address
data
:
address
})
})
console
.
log
(
this
.
state
.
data
[
0
].
id
)
}).
catch
(
error
=>
{
}).
catch
(
error
=>
{
let
response
=
error
.
response
.
data
;
let
response
=
error
.
response
.
data
;
...
@@ -69,7 +70,8 @@ class DeliveryAddrees extends React.Component {
...
@@ -69,7 +70,8 @@ class DeliveryAddrees extends React.Component {
)
)
let
setDataAddress
=
{
let
setDataAddress
=
{
address
:
address
address
:
address
,
addressId
:
this
.
state
.
data
[
0
].
id
}
}
this
.
props
.
setAddress
(
setDataAddress
);
this
.
props
.
setAddress
(
setDataAddress
);
...
@@ -162,9 +164,11 @@ const styles = StyleSheet.create({
...
@@ -162,9 +164,11 @@ const styles = StyleSheet.create({
})
})
const
mapStateToProps
=
(
state
)
=>
{
const
mapStateToProps
=
(
state
)
=>
{
console
.
log
(
"INI STATE : "
+
JSON
.
stringify
(
state
))
return
{
return
{
session_id
:
state
.
session_id
,
session_id
:
state
.
session_id
,
addressId
:
state
.
addressId
}
}
}
}
...
@@ -177,6 +181,7 @@ const mapDispatchToProps = (dispacth) => {
...
@@ -177,6 +181,7 @@ const mapDispatchToProps = (dispacth) => {
data
:
{
data
:
{
address
:
setDataAddress
.
address
,
address
:
setDataAddress
.
address
,
addressId
:
setDataAddress
.
addressId
}
}
}),
}),
}
}
...
...
view/MenuSelection.js
View file @
baf57aa8
...
@@ -28,7 +28,7 @@ class MenuSelection extends React.Component {
...
@@ -28,7 +28,7 @@ class MenuSelection extends React.Component {
this
.
getMenuList
()
this
.
getMenuList
()
// console.log("INI TOTAL ORDER : " + this.props.orders)
// console.log("INI TOTAL ORDER : " + this.props.orders)
// console.log("INI TOTAL QTY :" + this.props.quantity)
// console.log("INI TOTAL QTY :" + this.props.quantity)
console
.
log
(
"INI O
RDERAN NYA :"
+
JSON
.
stringify
(
this
.
props
.
cart_shop
))
console
.
log
(
"INI O
ETLET :"
+
JSON
.
stringify
(
this
.
props
.
outlet_id
))
}
}
getMenuList
()
{
getMenuList
()
{
...
@@ -245,7 +245,8 @@ const mapStateToProps = (state) => {
...
@@ -245,7 +245,8 @@ const mapStateToProps = (state) => {
order_quantity
:
state
.
order_quantity
,
order_quantity
:
state
.
order_quantity
,
order_total
:
state
.
order_total
,
order_total
:
state
.
order_total
,
quantity
:
state
.
quantity
,
quantity
:
state
.
quantity
,
address
:
state
.
address
address
:
state
.
address
,
// qty: state.qty,
// qty: state.qty,
// totalOrder: state.totalOrder,
// totalOrder: state.totalOrder,
// totalQty: state.totalQty,
// totalQty: state.totalQty,
...
...
view/PickupName.js
View file @
baf57aa8
...
@@ -64,8 +64,15 @@ class PickupName extends React.Component {
...
@@ -64,8 +64,15 @@ class PickupName extends React.Component {
this
.
getOutlet
()
this
.
getOutlet
()
}
}
getOutletDetail
(
id
)
{
getOutletDetail
(
id
,
name
)
{
this
.
props
.
navigation
.
navigate
(
'Outlet Detail'
,{
id
:
id
})
let
OutletChange
=
{
outlet_id
:
id
,
name_outlet
:
name
,
}
this
.
props
.
setChangeOutletProps
(
OutletChange
);
this
.
props
.
navigation
.
navigate
(
"Menu Select"
)
}
}
getOutlet
()
{
getOutlet
()
{
...
@@ -190,7 +197,7 @@ class PickupName extends React.Component {
...
@@ -190,7 +197,7 @@ class PickupName extends React.Component {
<
/Text
>
<
/Text
>
<
/View
>
<
/View
>
<
View
>
<
View
>
<
TouchableOpacity
onPress
=
{()
=>
this
.
getOutletDetail
(
item
.
id
)}
>
<
TouchableOpacity
onPress
=
{()
=>
this
.
getOutletDetail
(
item
.
id
,
item
.
name
)}
>
<
CheckBox
<
CheckBox
center
center
checkedIcon
=
'dot-circle-o'
checkedIcon
=
'dot-circle-o'
...
...
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