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
5330b388
Commit
5330b388
authored
May 04, 2020
by
Afid
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
betulin state type order dan reset seluruh data order ketika sudah finish
parent
5dddbe28
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
125 additions
and
131 deletions
+125
-131
globalActionType.js
redux/globalActionType.js
+2
-2
globalReducer.js
redux/globalReducer.js
+27
-5
Account.js
view/Account.js
+4
-5
DeliveryAddrees.js
view/DeliveryAddrees.js
+22
-8
Home.js
view/Home.js
+20
-17
MenuConfirmation.js
view/MenuConfirmation.js
+18
-75
PickupName.js
view/PickupName.js
+3
-9
ShoppingCart.js
view/ShoppingCart.js
+29
-10
No files found.
redux/globalActionType.js
View file @
5330b388
...
@@ -30,8 +30,8 @@ const ActionType = {
...
@@ -30,8 +30,8 @@ const ActionType = {
SET_ORDERS
:
'SET_ORDERS'
,
SET_ORDERS
:
'SET_ORDERS'
,
SET_TYPE
:
'SET_TYPE'
,
SET_TYPE
:
'SET_TYPE'
,
SET_TRANS_TYPE
:
'SET_TRANS_TYPE'
,
SET_TRANS_TYPE
:
'SET_TRANS_TYPE'
,
SET_RECALCULATE
:
'SET_RECALCULATE'
SET_RECALCULATE
:
'SET_RECALCULATE'
,
SET_ORDER_FINISH
:
'SET_ORDER_FINISH'
,
}
}
export
default
ActionType
;
export
default
ActionType
;
\ No newline at end of file
redux/globalReducer.js
View file @
5330b388
...
@@ -49,7 +49,7 @@ const globalState = {
...
@@ -49,7 +49,7 @@ const globalState = {
outlet_id
:
''
,
outlet_id
:
''
,
name_outlet
:
''
,
name_outlet
:
''
,
type_pickup
:
fals
e
,
type_pickup
:
tru
e
,
type_trans
:
''
,
type_trans
:
''
,
...
@@ -92,19 +92,26 @@ const rootReducer = (state = globalState, action) => {
...
@@ -92,19 +92,26 @@ const rootReducer = (state = globalState, action) => {
}
}
}
}
case
ActionType
.
SET_TYPE
:
{
case
ActionType
.
SET_TYPE
:
{
if
(
action
.
data
.
type_pickup
)
{
delivery_amount
=
0
}
else
{
delivery_amount
=
state
.
grabamount
}
return
{
return
{
...
state
,
...
state
,
type_pickup
:
action
.
data
.
type_pickup
,
type_pickup
:
action
.
data
.
type_pickup
,
grabamount
:
delivery_amount
}
}
}
}
case
ActionType
.
SET_GRAB
:
{
case
ActionType
.
SET_GRAB
:
{
return
{
return
{
...
state
,
...
state
,
grabtype
:
action
.
data
.
grabtype
,
//
grabtype: action.data.grabtype,
grabamount
:
action
.
data
.
grabamount
,
grabamount
:
action
.
data
.
grabamount
,
grabpickup
:
action
.
data
.
grabpickup
,
//
grabpickup: action.data.grabpickup,
grabdropoff
:
action
.
data
.
grabdropoff
,
//
grabdropoff: action.data.grabdropoff,
grabdestination
:
action
.
data
.
grabdestination
,
//
grabdestination: action.data.grabdestination,
}
}
}
}
case
ActionType
.
SET_ORDERS
:
{
case
ActionType
.
SET_ORDERS
:
{
...
@@ -408,6 +415,21 @@ const rootReducer = (state = globalState, action) => {
...
@@ -408,6 +415,21 @@ const rootReducer = (state = globalState, action) => {
}
}
}
}
case
ActionType
.
SET_ORDER_FINISH
:
{
return
{
...
state
,
type_pickup
:
true
,
order_total
:
0
,
order_quantity
:
0
,
order_item
:
[],
grabamount
:
0
,
outlet_id
:
''
,
name_outlet
:
''
,
address_id
:
''
}
}
default
:
default
:
return
state
;
return
state
;
}
}
...
...
view/Account.js
View file @
5330b388
...
@@ -40,10 +40,9 @@ class Account extends React.Component {
...
@@ -40,10 +40,9 @@ class Account extends React.Component {
}
}
componentDidMount
()
{
componentDidMount
()
{
this
.
_getPermissions
()
this
.
_getProfile
()
this
.
_unsubscribe
=
this
.
props
.
navigation
.
addListener
(
'focus'
,
()
=>
{
this
.
_unsubscribe
=
this
.
props
.
navigation
.
addListener
(
'focus'
,
()
=>
{
// do something
this
.
_getProfile
()
console
.
log
(
'DISINI DI RELOAD ULANG "ACCOUNT"'
)
});
});
}
}
...
...
view/DeliveryAddrees.js
View file @
5330b388
...
@@ -4,14 +4,15 @@ import { ScrollView, TouchableOpacity } from 'react-native-gesture-handler';
...
@@ -4,14 +4,15 @@ import { ScrollView, TouchableOpacity } from 'react-native-gesture-handler';
import
{
connect
}
from
'react-redux'
;
import
{
connect
}
from
'react-redux'
;
import
Axios
from
'axios'
;
import
Axios
from
'axios'
;
import
ActionType
from
'../redux/globalActionType'
;
import
ActionType
from
'../redux/globalActionType'
;
import
ravLog
from
'../helper/debug'
;
class
DeliveryAddrees
extends
React
.
Component
{
class
DeliveryAddrees
extends
React
.
Component
{
constructor
(
props
)
{
constructor
(
props
)
{
super
(
props
)
super
(
props
)
this
.
state
=
{
this
.
state
=
{
data
:
[],
data
:
[],
outlet_id
:
''
,
//
outlet_id: '',
grabamount
:
''
//
grabamount: ''
}
}
}
}
...
@@ -62,24 +63,29 @@ class DeliveryAddrees extends React.Component {
...
@@ -62,24 +63,29 @@ class DeliveryAddrees extends React.Component {
Axios
.
post
(
'https://excelsocrm.ravintoladev.com/crm/v2/delivery/rate'
,
params
).
then
(
res
=>
{
Axios
.
post
(
'https://excelsocrm.ravintoladev.com/crm/v2/delivery/rate'
,
params
).
then
(
res
=>
{
this
.
setState
({
//
this.setState({
grabamount
:
res
.
data
.
data
.
amount
,
//
grabamount: res.data.data.amount,
grabdestination
:
res
.
data
.
data
.
outlet_name
,
//
grabdestination: res.data.data.outlet_name,
})
//
})
let
setGrabProps
=
{
let
setGrabProps
=
{
grabdestination
:
this
.
state
.
grabdestination
,
// grabdestination: this.state.grabdestination,
grabamount
:
this
.
state
.
grabamount
,
// grabamount: this.state.grabamount,
grabamount
:
res
.
data
.
data
.
amount
}
}
let
OutletChange
=
{
let
OutletChange
=
{
outlet_id
:
res
.
data
.
data
.
outlet_id
,
outlet_id
:
res
.
data
.
data
.
outlet_id
,
name_outlet
:
res
.
data
.
data
.
outlet_name
,
name_outlet
:
res
.
data
.
data
.
outlet_name
,
}
}
this
.
props
.
setGrab
(
setGrabProps
);
this
.
props
.
setGrab
(
setGrabProps
);
this
.
props
.
setChangeOutletProps
(
OutletChange
);
this
.
props
.
setChangeOutletProps
(
OutletChange
);
console
.
log
(
"INI SUKSES RESPONNYA "
)
console
.
log
(
"INI SUKSES RESPONNYA "
)
console
.
log
(
'Delivery Amount : '
+
res
.
data
.
data
.
amount
)
// let setOrdersProps = {
// let setOrdersProps = {
// balanceUsed: this.state.balanceused,
// balanceUsed: this.state.balanceused,
...
@@ -109,6 +115,8 @@ class DeliveryAddrees extends React.Component {
...
@@ -109,6 +115,8 @@ class DeliveryAddrees extends React.Component {
this
.
getRate
()
this
.
getRate
()
this
.
props
.
setTypePickup
(
false
)
// console.log(this.props)
// console.log(this.props)
if
(
this
.
props
.
route
.
params
.
from
==
'shoppingCart'
)
{
if
(
this
.
props
.
route
.
params
.
from
==
'shoppingCart'
)
{
...
@@ -261,6 +269,12 @@ const mapDispatchToProps = (dispacth) => {
...
@@ -261,6 +269,12 @@ const mapDispatchToProps = (dispacth) => {
}
}
}),
}),
setTypePickup
:
(
type
)
=>
dispacth
({
type
:
ActionType
.
SET_TYPE
,
data
:
{
type_pickup
:
type
}
}),
}
}
}
}
...
...
view/Home.js
View file @
5330b388
...
@@ -34,8 +34,9 @@ class Home extends React.Component {
...
@@ -34,8 +34,9 @@ class Home extends React.Component {
this
.
_renderCarousell
()
this
.
_renderCarousell
()
this
.
_account
();
this
.
_account
();
this
.
_unsubscribe
=
this
.
props
.
navigation
.
addListener
(
'focus'
,
()
=>
{
this
.
_unsubscribe
=
this
.
props
.
navigation
.
addListener
(
'focus'
,
()
=>
{
// do something
this
.
_getPermissions
()
console
.
log
(
'DISINI DI RELOAD ULANG "HOME"'
)
this
.
_renderCarousell
()
this
.
_account
();
});
});
}
}
...
@@ -140,21 +141,23 @@ class Home extends React.Component {
...
@@ -140,21 +141,23 @@ class Home extends React.Component {
}
}
_pickup
()
{
_pickup
()
{
let
typeProps
=
{
type_pickup
:
true
,
}
this
.
props
.
setTypePickup
(
typeProps
);
this
.
props
.
navigation
.
navigate
(
'Pickup Name'
,
{
from
:
'home'
});
this
.
props
.
navigation
.
navigate
(
'Pickup Name'
,
{
from
:
'home'
});
}
}
_order
(){
_delivery
(){
let
typeProps
=
{
type_pickup
:
false
,
}
this
.
props
.
setTypePickup
(
typeProps
);
this
.
props
.
navigation
.
navigate
(
'Delivery Address'
,
{
from
:
'home'
});
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"
)
}
else
{
Alert
.
alert
(
'Belum dapat outlet terdekat'
)
}
}
render
()
{
render
()
{
return
(
return
(
...
@@ -198,7 +201,7 @@ class Home extends React.Component {
...
@@ -198,7 +201,7 @@ class Home extends React.Component {
<
View
style
=
{
styles
.
card
}
>
<
View
style
=
{
styles
.
card
}
>
<
Card
>
<
Card
>
<
View
style
=
{{
flexDirection
:
'row'
,
justifyContent
:
'center'
}}
>
<
View
style
=
{{
flexDirection
:
'row'
,
justifyContent
:
'center'
}}
>
<
TouchableOpacity
style
=
{
styles
.
buttonDelivery
}
onPress
=
{()
=>
this
.
_
order
()
}
>
<
TouchableOpacity
style
=
{
styles
.
buttonDelivery
}
onPress
=
{()
=>
this
.
_
delivery
()
}
>
<
Text
style
=
{{
textAlign
:
'center'
,
color
:
'#354175'
,
fontWeight
:
'bold'
}}
>
{
i18n
.
t
(
'delivery'
)}
<
/Text
>
<
Text
style
=
{{
textAlign
:
'center'
,
color
:
'#354175'
,
fontWeight
:
'bold'
}}
>
{
i18n
.
t
(
'delivery'
)}
<
/Text
>
<
/TouchableOpacity
>
<
/TouchableOpacity
>
<
TouchableOpacity
style
=
{
styles
.
buttonPickup
}
onPress
=
{()
=>
this
.
_pickup
()}
>
<
TouchableOpacity
style
=
{
styles
.
buttonPickup
}
onPress
=
{()
=>
this
.
_pickup
()}
>
...
@@ -215,7 +218,7 @@ class Home extends React.Component {
...
@@ -215,7 +218,7 @@ class Home extends React.Component {
Excelso
{
this
.
props
.
name_outlet
}
Excelso
{
this
.
props
.
name_outlet
}
<
/Text
>
<
/Text
>
)}
)}
<
TouchableOpacity
style
=
{
styles
.
submitOrder
}
activeOpacity
=
{.
5
}
onPress
=
{()
=>
this
.
props
.
navigation
.
navigate
(
"Menu Select"
)}
>
<
TouchableOpacity
style
=
{
styles
.
submitOrder
}
activeOpacity
=
{.
5
}
onPress
=
{()
=>
this
.
_orderNow
(
)}
>
<
Text
style
=
{{
textAlign
:
'center'
,
bottom
:
5
,
color
:
'white'
}}
>
{
i18n
.
t
(
'orderNow'
)}
<
/Text
>
<
Text
style
=
{{
textAlign
:
'center'
,
bottom
:
5
,
color
:
'white'
}}
>
{
i18n
.
t
(
'orderNow'
)}
<
/Text
>
<
/TouchableOpacity
>
<
/TouchableOpacity
>
<
/Card
>
<
/Card
>
...
@@ -359,14 +362,14 @@ const mapDispatchToProps = (dispacth) => {
...
@@ -359,14 +362,14 @@ const mapDispatchToProps = (dispacth) => {
name_outlet
:
OutletChange
.
name_outlet
,
name_outlet
:
OutletChange
.
name_outlet
,
}
}
}),
}),
setTypePickup
:
(
type
Props
)
=>
dispacth
({
setTypePickup
:
(
type
)
=>
dispacth
({
type
:
ActionType
.
SET_TYPE
,
type
:
ActionType
.
SET_TYPE
,
data
:
{
data
:
{
type_pickup
:
type
type_pickup
:
typeProps
.
type_pickup
}
}
}),
}),
}
}
}
}
...
...
view/MenuConfirmation.js
View file @
5330b388
...
@@ -31,15 +31,21 @@ class MenuConfirmation extends React.Component {
...
@@ -31,15 +31,21 @@ class MenuConfirmation extends React.Component {
}
}
setOrder
()
{
setOrder
(
is_pickup
)
{
this
.
setState
({
this
.
setState
({
spinner
:
true
,
spinner
:
true
,
})
})
if
(
is_pickup
)
{
type
=
'Pick Up'
}
else
{
type
=
'Delivery'
}
let
params
=
{
let
params
=
{
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
:
"Delivery"
,
trans_type
:
type
,
order_item
:
this
.
props
.
order_item
,
order_item
:
this
.
props
.
order_item
,
delivery_charge
:
this
.
props
.
grabamount
,
delivery_charge
:
this
.
props
.
grabamount
,
voucher
:
[],
voucher
:
[],
...
@@ -58,19 +64,11 @@ class MenuConfirmation extends React.Component {
...
@@ -58,19 +64,11 @@ class MenuConfirmation extends React.Component {
"Berhasil"
,
"Berhasil"
,
"Transaksi sudah berhasil, terimakasih sudah menggunakan excelso untuk ngopi"
,
"Transaksi sudah berhasil, terimakasih sudah menggunakan excelso untuk ngopi"
,
[
[
{
text
:
"OK"
,
onPress
:
()
=>
this
.
props
.
navigation
.
reset
({
{
text
:
"OK"
,
onPress
:
()
=>
this
.
orderSuccess
()}
routes
:
[{
name
:
'Home'
}]
})}
],
],
{
cancelable
:
false
}
{
cancelable
:
false
}
);
);
let
typeProps
=
{
type_pickup
:
true
,
}
this
.
props
.
setTypePickup
(
typeProps
);
}).
catch
(
error
=>
{
}).
catch
(
error
=>
{
let
response
=
error
.
response
.
data
;
let
response
=
error
.
response
.
data
;
// console.log('error')
// console.log('error')
...
@@ -81,58 +79,14 @@ class MenuConfirmation extends React.Component {
...
@@ -81,58 +79,14 @@ class MenuConfirmation extends React.Component {
})
})
}
}
orderSuccess
=
()
=>
{
setPickup
()
{
this
.
props
.
setOrderFinish
()
this
.
setState
({
this
.
props
.
navigation
.
reset
({
spinner
:
true
,
})
let
params
=
{
session_id
:
this
.
props
.
session_id
,
outlet_id
:
this
.
props
.
outlet_id
,
address_id
:
this
.
props
.
addressId
,
trans_type
:
"Pick Up"
,
order_item
:
this
.
props
.
order_item
,
delivery_charge
:
0
,
voucher
:
[],
payment
:
{
balance
:
this
.
props
.
route
.
params
.
balanceUsed
,
point
:
this
.
props
.
route
.
params
.
pointused
}
}
console
.
log
(
"INI params : "
+
JSON
.
stringify
(
params
)
)
Axios
.
post
(
'https://excelsocrm.ravintoladev.com/crm/v2/transaction/booking'
,
params
).
then
(
res
=>
{
this
.
setState
({
spinner
:
false
,
})
Alert
.
alert
(
"Berhasil"
,
"Transaksi sudah berhasil, terimakasih sudah menggunakan excelso untuk ngopi"
,
[
{
text
:
"OK"
,
onPress
:
()
=>
this
.
props
.
navigation
.
reset
({
routes
:
[{
name
:
'Home'
}]
routes
:
[{
name
:
'Home'
}]
})}
],
{
cancelable
:
false
}
);
let
typeProps
=
{
type_pickup
:
false
,
}
this
.
props
.
setTypePickup
(
typeProps
);
}).
catch
(
error
=>
{
let
response
=
error
.
response
.
data
;
// console.log('error')
Alert
.
alert
(
response
.
msg
);
this
.
setState
({
spinner
:
false
,
})
})
})
}
}
render
()
{
render
()
{
console
.
log
(
this
.
props
)
console
.
log
(
this
.
props
)
let
total
=
0
let
total
=
0
...
@@ -234,12 +188,7 @@ class MenuConfirmation extends React.Component {
...
@@ -234,12 +188,7 @@ class MenuConfirmation extends React.Component {
<
/View
>
<
/View
>
<
/View
>
<
/View
>
<
View
style
=
{{
margin
:
10
}}
>
<
View
style
=
{{
margin
:
10
}}
>
{
this
.
props
.
type_pickup
==
true
?
(
<
Button
title
=
'order'
onPress
=
{()
=>
this
.
setOrder
(
this
.
props
.
type_pickup
)}
/
>
<
Button
title
=
'order'
onPress
=
{()
=>
this
.
setPickup
()}
/
>
):(
<
Button
title
=
'order'
onPress
=
{()
=>
this
.
setOrder
()}
/
>
)}
<
/View
>
<
/View
>
<
/ScrollView
>
<
/ScrollView
>
)
)
...
@@ -273,15 +222,9 @@ const styles = StyleSheet.create({
...
@@ -273,15 +222,9 @@ const styles = StyleSheet.create({
const
mapDispatchToProps
=
(
dispacth
)
=>
{
const
mapDispatchToProps
=
(
dispacth
)
=>
{
return
{
return
{
setOrderFinish
:
()
=>
dispacth
({
setTypePickup
:
(
typeProps
)
=>
dispacth
({
type
:
ActionType
.
SET_ORDER_FINISH
type
:
ActionType
.
SET_TYPE
,
})
data
:
{
type_pickup
:
typeProps
.
type_pickup
}
}),
}
}
}
}
...
...
view/PickupName.js
View file @
5330b388
...
@@ -71,10 +71,6 @@ class PickupName extends React.Component {
...
@@ -71,10 +71,6 @@ class PickupName extends React.Component {
name_outlet
:
name
,
name_outlet
:
name
,
}
}
let
typeProps
=
{
type_pickup
:
true
,
}
// let recalculateProps = {
// let recalculateProps = {
// order_total: 0,
// order_total: 0,
// order_quantity:0,
// order_quantity:0,
...
@@ -82,7 +78,7 @@ class PickupName extends React.Component {
...
@@ -82,7 +78,7 @@ class PickupName extends React.Component {
// }
// }
// this.props.setRecalculate(recalculateProps)
// this.props.setRecalculate(recalculateProps)
this
.
props
.
setChangeOutletProps
(
OutletChange
);
this
.
props
.
setChangeOutletProps
(
OutletChange
);
this
.
props
.
setTypePickup
(
t
ypeProps
);
this
.
props
.
setTypePickup
(
t
rue
);
if
(
this
.
props
.
route
.
params
.
from
==
'shoppingCart'
)
{
if
(
this
.
props
.
route
.
params
.
from
==
'shoppingCart'
)
{
this
.
props
.
navigation
.
navigate
(
'Shopping Cart'
)
this
.
props
.
navigation
.
navigate
(
'Shopping Cart'
)
...
@@ -310,12 +306,10 @@ const mapDispatchToProps = (dispacth) => {
...
@@ -310,12 +306,10 @@ const mapDispatchToProps = (dispacth) => {
}
}
}),
}),
setTypePickup
:
(
type
Props
)
=>
dispacth
({
setTypePickup
:
(
type
)
=>
dispacth
({
type
:
ActionType
.
SET_TYPE
,
type
:
ActionType
.
SET_TYPE
,
data
:
{
data
:
{
type_pickup
:
type
type_pickup
:
typeProps
.
type_pickup
}
}
}),
}),
setRecalculate
:
(
recalculateProps
)
=>
dispacth
({
setRecalculate
:
(
recalculateProps
)
=>
dispacth
({
...
...
view/ShoppingCart.js
View file @
5330b388
...
@@ -42,17 +42,19 @@ class ShoppingCart extends React.Component {
...
@@ -42,17 +42,19 @@ class ShoppingCart extends React.Component {
componentDidMount
()
{
componentDidMount
()
{
if
(
!
this
.
props
.
type_pickup
)
{
this
.
getRate
()
this
.
getRate
()
}
this
.
getBalance
()
this
.
getBalance
()
}
}
checkChangeTrans
(
val
)
{
checkChangeTrans
(
val
)
{
if
(
val
==
'delivery'
)
{
if
(
val
==
'delivery'
)
{
let
typeProps
=
{
//
let typeProps = {
type_pickup
:
false
,
//
type_pickup: false,
}
//
}
this
.
props
.
setTypePickup
(
typeProps
);
//
this.props.setTypePickup(typeProps);
this
.
setState
({
this
.
setState
({
checkedBalance
:
false
,
checkedBalance
:
false
,
checkedPoint
:
false
,
checkedPoint
:
false
,
...
@@ -62,10 +64,10 @@ class ShoppingCart extends React.Component {
...
@@ -62,10 +64,10 @@ class ShoppingCart extends React.Component {
})
})
this
.
props
.
navigation
.
navigate
(
"Delivery Address"
,
{
from
:
'shoppingCart'
})
this
.
props
.
navigation
.
navigate
(
"Delivery Address"
,
{
from
:
'shoppingCart'
})
}
else
{
}
else
{
let
typeProps
=
{
//
let typeProps = {
type_pickup
:
true
,
//
type_pickup: true,
}
//
}
this
.
props
.
setTypePickup
(
typeProps
);
//
this.props.setTypePickup(typeProps);
this
.
setState
({
this
.
setState
({
checkedBalance
:
false
,
checkedBalance
:
false
,
checkedPoint
:
false
,
checkedPoint
:
false
,
...
@@ -244,6 +246,15 @@ class ShoppingCart extends React.Component {
...
@@ -244,6 +246,15 @@ class ShoppingCart extends React.Component {
this
.
props
.
setGrab
(
setGrabProps
);
this
.
props
.
setGrab
(
setGrabProps
);
console
.
log
(
"INI SUKSES RESPONNYA "
)
console
.
log
(
"INI SUKSES RESPONNYA "
)
console
.
log
(
'Delivery Amount Cart : '
+
res
.
data
.
data
.
amount
)
let
OutletChange
=
{
outlet_id
:
res
.
data
.
data
.
outlet_id
,
name_outlet
:
res
.
data
.
data
.
outlet_name
,
}
this
.
props
.
setChangeOutletProps
(
OutletChange
);
let
setOrdersProps
=
{
let
setOrdersProps
=
{
balanceUsed
:
this
.
state
.
balanceused
,
balanceUsed
:
this
.
state
.
balanceused
,
...
@@ -251,7 +262,6 @@ class ShoppingCart extends React.Component {
...
@@ -251,7 +262,6 @@ class ShoppingCart extends React.Component {
}
}
this
.
props
.
setOrder
(
setOrdersProps
);
this
.
props
.
setOrder
(
setOrdersProps
);
}).
catch
(
error
=>
{
}).
catch
(
error
=>
{
console
.
log
(
'ini error '
+
error
)
console
.
log
(
'ini error '
+
error
)
})
})
...
@@ -688,6 +698,15 @@ const styles = StyleSheet.create({
...
@@ -688,6 +698,15 @@ const styles = StyleSheet.create({
const
mapDispatchToProps
=
(
dispacth
)
=>
{
const
mapDispatchToProps
=
(
dispacth
)
=>
{
return
{
return
{
setChangeOutletProps
:
(
OutletChange
)
=>
dispacth
({
type
:
ActionType
.
SET_CHANGE_OUTLET
,
data
:
{
outlet_id
:
OutletChange
.
outlet_id
,
name_outlet
:
OutletChange
.
name_outlet
,
}
}),
addToChart
:
(
item
)
=>
dispacth
({
addToChart
:
(
item
)
=>
dispacth
({
type
:
ActionType
.
ADD_TO_CHART
,
type
:
ActionType
.
ADD_TO_CHART
,
...
...
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