Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
C
clone_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
clone_excelso
Commits
6ea744fa
Commit
6ea744fa
authored
May 04, 2020
by
Afid
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update price shopping cart sesuai outletnya
parent
fdbf2451
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
140 additions
and
60 deletions
+140
-60
globalReducer.js
redux/globalReducer.js
+6
-6
Account.js
view/Account.js
+2
-2
AddreesDetail.js
view/AddreesDetail.js
+3
-3
DeliveryAddrees.js
view/DeliveryAddrees.js
+59
-14
Home.js
view/Home.js
+2
-2
Item.js
view/Item.js
+2
-2
ItemShopingCart.js
view/ItemShopingCart.js
+1
-1
MenuConfirmation.js
view/MenuConfirmation.js
+4
-2
MenuSelection.js
view/MenuSelection.js
+3
-3
OutletDetails.js
view/OutletDetails.js
+2
-2
PickupName.js
view/PickupName.js
+1
-1
ResetPassword.js
view/ResetPassword.js
+1
-1
ShoppingCart.js
view/ShoppingCart.js
+43
-10
TopUpInfo.js
view/TopUpInfo.js
+1
-1
TransactionDetail.js
view/TransactionDetail.js
+2
-2
TransactionHistory.js
view/TransactionHistory.js
+1
-1
TransferBalance.js
view/TransferBalance.js
+5
-5
UpgradePremium.js
view/UpgradePremium.js
+1
-1
VerifyEmail.js
view/VerifyEmail.js
+1
-1
No files found.
redux/globalReducer.js
View file @
6ea744fa
...
@@ -289,7 +289,7 @@ const rootReducer = (state = globalState, action) => {
...
@@ -289,7 +289,7 @@ const rootReducer = (state = globalState, action) => {
update
.
quantity
=
1
update
.
quantity
=
1
}
}
update
.
quantity
+=
1
update
.
quantity
+=
1
console
.
log
(
'Update : '
+
JSON
.
stringify
(
update
))
//
console.log('Update : ' + JSON.stringify(update))
data
=
{
...
old_data
,
...
update
}
data
=
{
...
old_data
,
...
update
}
}
}
...
@@ -300,7 +300,7 @@ const rootReducer = (state = globalState, action) => {
...
@@ -300,7 +300,7 @@ const rootReducer = (state = globalState, action) => {
}
else
{
}
else
{
// add
// add
addedItem
.
quantity
=
1
addedItem
.
quantity
=
1
console
.
log
(
'Baru : '
+
JSON
.
stringify
(
addedItem
))
//
console.log('Baru : ' + JSON.stringify(addedItem))
order_item
=
[...
state
.
order_item
,
addedItem
]
order_item
=
[...
state
.
order_item
,
addedItem
]
}
}
...
@@ -358,7 +358,7 @@ const rootReducer = (state = globalState, action) => {
...
@@ -358,7 +358,7 @@ const rootReducer = (state = globalState, action) => {
data
=
null
data
=
null
}
else
{
}
else
{
update
.
quantity
-=
1
update
.
quantity
-=
1
console
.
log
(
'Update : '
+
JSON
.
stringify
(
update
))
//
console.log('Update : ' + JSON.stringify(update))
data
=
{
...
old_data
,
...
update
}
data
=
{
...
old_data
,
...
update
}
}
}
}
}
...
@@ -438,7 +438,7 @@ const rootReducer = (state = globalState, action) => {
...
@@ -438,7 +438,7 @@ const rootReducer = (state = globalState, action) => {
let
quantity
=
state
.
order_quantity
let
quantity
=
state
.
order_quantity
let
total
=
parseInt
(
state
.
order_total
)
-
parseInt
(
addedItem
.
price
)
let
total
=
parseInt
(
state
.
order_total
)
-
parseInt
(
addedItem
.
price
)
console
.
log
(
"UPDATE "
+
order_item
)
//
console.log("UPDATE " + order_item)
}
}
return
{
return
{
...
@@ -480,11 +480,11 @@ const rootReducer = (state = globalState, action) => {
...
@@ -480,11 +480,11 @@ const rootReducer = (state = globalState, action) => {
for
(
let
i
=
0
;
i
<
state
.
order_item
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
state
.
order_item
.
length
;
i
++
)
{
const
row
=
state
.
order_item
[
i
];
const
row
=
state
.
order_item
[
i
];
let
is_updated
=
state
.
menu_item
.
find
(
item
=>
item
.
id
==
row
.
id
)
let
is_updated
=
menu
.
find
(
item
=>
item
.
id
==
row
.
id
)
// Update Price in Cart
// Update Price in Cart
if
(
is_updated
)
{
if
(
is_updated
)
{
row
.
price
=
is_updated
.
price
row
.
price
=
parseInt
(
is_updated
.
price
)
}
}
quantity
+=
parseInt
(
row
.
quantity
)
quantity
+=
parseInt
(
row
.
quantity
)
...
...
view/Account.js
View file @
6ea744fa
...
@@ -86,7 +86,7 @@ class Account extends React.Component {
...
@@ -86,7 +86,7 @@ class Account extends React.Component {
session_id
:
''
session_id
:
''
}
}
this
.
props
.
setConfig
(
configProps
);
this
.
props
.
setConfig
(
configProps
);
console
.
log
(
this
.
props
.
navigation
.
replace
(
'Login'
));
//
console.log(this.props.navigation.replace('Login'));
}
}
_getProfile
()
{
_getProfile
()
{
...
@@ -98,7 +98,7 @@ class Account extends React.Component {
...
@@ -98,7 +98,7 @@ class Account extends React.Component {
}
}
Axios
.
post
(
'https://excelsocrm.ravintoladev.com/crm/v2/member/get_profile'
,
params
).
then
(
res
=>
{
Axios
.
post
(
'https://excelsocrm.ravintoladev.com/crm/v2/member/get_profile'
,
params
).
then
(
res
=>
{
console
.
log
(
'WAKWAWWWW '
+
JSON
.
stringify
(
res
.
data
))
//
console.log('WAKWAWWWW ' + JSON.stringify(res.data))
const
dataCard
=
res
.
data
const
dataCard
=
res
.
data
let
email
=
dataCard
.
email
let
email
=
dataCard
.
email
let
point
=
dataCard
.
kaspro_point
let
point
=
dataCard
.
kaspro_point
...
...
view/AddreesDetail.js
View file @
6ea744fa
...
@@ -62,7 +62,7 @@ import Spinner from 'react-native-loading-spinner-overlay';
...
@@ -62,7 +62,7 @@ import Spinner from 'react-native-loading-spinner-overlay';
})
})
let
detail
=
await
Location
.
reverseGeocodeAsync
(
location
.
coords
)
let
detail
=
await
Location
.
reverseGeocodeAsync
(
location
.
coords
)
console
.
log
(
" INI DETAIL "
+
JSON
.
stringify
(
detail
)
)
//
console.log(" INI DETAIL "+ JSON.stringify(detail) )
let
latitude
=
location
.
coords
.
latitude
;
let
latitude
=
location
.
coords
.
latitude
;
let
longitude
=
location
.
coords
.
longitude
;
let
longitude
=
location
.
coords
.
longitude
;
this
.
setState
({
location
,
latitude
:
latitude
,
longitude
:
longitude
})
this
.
setState
({
location
,
latitude
:
latitude
,
longitude
:
longitude
})
...
@@ -103,7 +103,7 @@ import Spinner from 'react-native-loading-spinner-overlay';
...
@@ -103,7 +103,7 @@ import Spinner from 'react-native-loading-spinner-overlay';
})
})
}
}
console
.
log
(
'LATITUDE'
+
''
+
this
.
state
.
latitude
+
''
+
'LONGITUDE'
+
this
.
state
.
longitude
)
//
console.log('LATITUDE' + '' + this.state.latitude + '' + 'LONGITUDE' + this.state.longitude)
}
}
saveAddress
()
{
saveAddress
()
{
...
@@ -122,7 +122,7 @@ import Spinner from 'react-native-loading-spinner-overlay';
...
@@ -122,7 +122,7 @@ import Spinner from 'react-native-loading-spinner-overlay';
lat
:
this
.
state
.
latitude
,
lat
:
this
.
state
.
latitude
,
long
:
this
.
state
.
longitude
long
:
this
.
state
.
longitude
}
}
console
.
log
(
params
)
//
console.log(params)
Axios
.
post
(
'https://excelsocrm.ravintoladev.com/crm/v2/member/set_address'
,
params
).
then
(
res
=>
{
Axios
.
post
(
'https://excelsocrm.ravintoladev.com/crm/v2/member/set_address'
,
params
).
then
(
res
=>
{
Alert
.
alert
(
Alert
.
alert
(
...
...
view/DeliveryAddrees.js
View file @
6ea744fa
...
@@ -18,11 +18,11 @@ class DeliveryAddrees extends React.Component {
...
@@ -18,11 +18,11 @@ class DeliveryAddrees extends React.Component {
componentDidMount
()
{
componentDidMount
()
{
this
.
getAddreess
()
this
.
getAddreess
()
console
.
log
(
"INI ADDRESS ID : "
+
this
.
props
.
addressId
)
//
console.log("INI ADDRESS ID : " + this.props.addressId)
}
}
onChangeAddress
=
data
=>
{
onChangeAddress
=
data
=>
{
console
.
log
(
'DATA FROM CHANGE PROFILE '
+
data
);
//
console.log('DATA FROM CHANGE PROFILE ' + data);
this
.
getAddreess
()
this
.
getAddreess
()
}
}
...
@@ -54,13 +54,13 @@ class DeliveryAddrees extends React.Component {
...
@@ -54,13 +54,13 @@ class DeliveryAddrees extends React.Component {
getRate
(
address_id
)
{
getRate
(
address_id
)
{
console
.
log
(
'ADdress id : '
+
address_id
)
//
console.log('ADdress id : ' + address_id)
let
params
=
{
let
params
=
{
session_id
:
this
.
props
.
session_id
,
session_id
:
this
.
props
.
session_id
,
address_id
:
address_id
,
address_id
:
address_id
,
}
}
console
.
log
(
"INI PRAMETER NYA : "
+
JSON
.
stringify
(
params
))
//
console.log("INI PRAMETER NYA : " + JSON.stringify(params))
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
=>
{
...
@@ -84,8 +84,8 @@ class DeliveryAddrees extends React.Component {
...
@@ -84,8 +84,8 @@ class DeliveryAddrees extends React.Component {
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 Address : '
+
res
.
data
.
data
.
amount
)
//
console.log('Delivery Amount Address : ' + res.data.data.amount)
// let setOrdersProps = {
// let setOrdersProps = {
...
@@ -114,17 +114,62 @@ class DeliveryAddrees extends React.Component {
...
@@ -114,17 +114,62 @@ class DeliveryAddrees extends React.Component {
this
.
props
.
setAddress
(
setDataAddress
);
this
.
props
.
setAddress
(
setDataAddress
);
this
.
getRate
(
id
)
// this.getRate(id)
let
params
=
{
session_id
:
this
.
props
.
session_id
,
address_id
:
id
,
}
this
.
props
.
setTypePickup
(
false
)
// console.log("INI PRAMETER NYA : " + JSON.stringify(params)
)
// console.log(this.props)
Axios
.
post
(
'https://excelsocrm.ravintoladev.com/crm/v2/delivery/rate'
,
params
).
then
(
res
=>
{
if
(
this
.
props
.
route
.
params
.
from
==
'shoppingCart'
)
{
// this.setState({
this
.
props
.
navigation
.
navigate
(
'Shopping Cart'
)
// grabamount: res.data.data.amount,
}
else
{
// grabdestination: res.data.data.outlet_name,
this
.
props
.
navigation
.
navigate
(
"Menu Select"
)
// })
}
let
setGrabProps
=
{
// grabdestination: this.state.grabdestination,
// grabamount: this.state.grabamount,
grabamount
:
res
.
data
.
data
.
amount
}
let
OutletChange
=
{
outlet_id
:
res
.
data
.
data
.
outlet_id
,
name_outlet
:
res
.
data
.
data
.
outlet_name
,
}
this
.
props
.
setGrab
(
setGrabProps
);
this
.
props
.
setChangeOutletProps
(
OutletChange
);
// console.log("INI SUKSES RESPONNYA ")
// console.log('Delivery Amount Address : ' + res.data.data.amount)
// let setOrdersProps = {
// balanceUsed: this.state.balanceused,
// pointused: this.state.pointsused,
// }
// this.props.setOrder(setOrdersProps);
this
.
props
.
setTypePickup
(
false
)
// console.log(this.props)
if
(
this
.
props
.
route
.
params
.
from
==
'shoppingCart'
)
{
this
.
props
.
navigation
.
navigate
(
'Shopping Cart'
,
{
outlet_change
:
true
,
outlet_id
:
res
.
data
.
data
.
outlet_id
})
}
else
{
this
.
props
.
navigation
.
navigate
(
"Menu Select"
)
}
}).
catch
(
error
=>
{
console
.
log
(
'ini error '
+
error
)
})
...
...
view/Home.js
View file @
6ea744fa
...
@@ -93,7 +93,7 @@ class Home extends React.Component {
...
@@ -93,7 +93,7 @@ class Home extends React.Component {
let
params
=
{
let
params
=
{
session_id
:
this
.
props
.
session_id
,
session_id
:
this
.
props
.
session_id
,
}
}
console
.
log
(
params
);
//
console.log(params);
Axios
.
post
(
'https://excelsocrm.ravintoladev.com/crm/v2/member/get_profile'
,
params
).
then
(
res
=>
{
Axios
.
post
(
'https://excelsocrm.ravintoladev.com/crm/v2/member/get_profile'
,
params
).
then
(
res
=>
{
const
dataCard
=
res
.
data
const
dataCard
=
res
.
data
...
@@ -120,7 +120,7 @@ class Home extends React.Component {
...
@@ -120,7 +120,7 @@ class Home extends React.Component {
lat
:
this
.
state
.
my_lat
,
lat
:
this
.
state
.
my_lat
,
long
:
this
.
state
.
my_long
long
:
this
.
state
.
my_long
}
}
console
.
log
(
params
);
//
console.log(params);
Axios
.
post
(
'https://excelsocrm.ravintoladev.com/crm/v2/outlet/get_closest'
,
params
).
then
(
res
=>
{
Axios
.
post
(
'https://excelsocrm.ravintoladev.com/crm/v2/outlet/get_closest'
,
params
).
then
(
res
=>
{
...
...
view/Item.js
View file @
6ea744fa
...
@@ -5,7 +5,7 @@ import { connect } from 'react-redux';
...
@@ -5,7 +5,7 @@ import { connect } from 'react-redux';
class
Item
extends
React
.
Component
{
class
Item
extends
React
.
Component
{
render
()
{
render
()
{
const
{
item
}
=
this
.
props
const
{
item
}
=
this
.
props
console
.
log
(
"ini id itemnya "
+
item
.
id
)
//
console.log("ini id itemnya "+item.id)
return
(
return
(
<
View
style
=
{{
flex
:
1
,
margin
:
10
}}
key
=
{
item
.
id
}
ref
=
{
this
.
props
.
_scrollView
}
>
<
View
style
=
{{
flex
:
1
,
margin
:
10
}}
key
=
{
item
.
id
}
ref
=
{
this
.
props
.
_scrollView
}
>
...
@@ -100,7 +100,7 @@ const styles = StyleSheet.create({
...
@@ -100,7 +100,7 @@ const styles = StyleSheet.create({
})
})
const
mapStateToProps
=
(
state
)
=>
{
const
mapStateToProps
=
(
state
)
=>
{
console
.
log
(
state
)
//
console.log(state)
return
{
return
{
session_id
:
state
.
session_id
,
session_id
:
state
.
session_id
,
outlet_id
:
state
.
outlet_id
,
outlet_id
:
state
.
outlet_id
,
...
...
view/ItemShopingCart.js
View file @
6ea744fa
...
@@ -93,7 +93,7 @@ const styles = StyleSheet.create({
...
@@ -93,7 +93,7 @@ const styles = StyleSheet.create({
})
})
const
mapStateToProps
=
(
state
)
=>
{
const
mapStateToProps
=
(
state
)
=>
{
console
.
log
(
state
)
//
console.log(state)
return
{
return
{
session_id
:
state
.
session_id
,
session_id
:
state
.
session_id
,
outlet_id
:
state
.
outlet_id
,
outlet_id
:
state
.
outlet_id
,
...
...
view/MenuConfirmation.js
View file @
6ea744fa
...
@@ -55,6 +55,8 @@ class MenuConfirmation extends React.Component {
...
@@ -55,6 +55,8 @@ class MenuConfirmation extends React.Component {
}
}
}
}
console
.
log
(
'BOOK : '
+
JSON
.
stringify
(
params
))
Axios
.
post
(
'https://excelsocrm.ravintoladev.com/crm/v2/transaction/booking'
,
params
).
then
(
res
=>
{
Axios
.
post
(
'https://excelsocrm.ravintoladev.com/crm/v2/transaction/booking'
,
params
).
then
(
res
=>
{
this
.
setState
({
this
.
setState
({
...
@@ -88,7 +90,7 @@ class MenuConfirmation extends React.Component {
...
@@ -88,7 +90,7 @@ class MenuConfirmation extends React.Component {
render
()
{
render
()
{
console
.
log
(
this
.
props
)
//
console.log(this.props)
let
total
=
0
let
total
=
0
return
(
return
(
<
ScrollView
style
=
{
styles
.
container
}
>
<
ScrollView
style
=
{
styles
.
container
}
>
...
@@ -229,7 +231,7 @@ const mapDispatchToProps = (dispacth) => {
...
@@ -229,7 +231,7 @@ const mapDispatchToProps = (dispacth) => {
}
}
const
mapStateToProps
=
(
state
)
=>
{
const
mapStateToProps
=
(
state
)
=>
{
console
.
log
(
state
)
//
console.log(state)
return
{
return
{
session_id
:
state
.
session_id
,
session_id
:
state
.
session_id
,
type_pickup
:
state
.
type_pickup
,
type_pickup
:
state
.
type_pickup
,
...
...
view/MenuSelection.js
View file @
6ea744fa
...
@@ -29,7 +29,7 @@ class MenuSelection extends React.Component {
...
@@ -29,7 +29,7 @@ class MenuSelection extends React.Component {
}
else
{
}
else
{
Alert
.
alert
(
'Device belum mendapatkan lokasi anda'
)
Alert
.
alert
(
'Device belum mendapatkan lokasi anda'
)
}
}
console
.
log
(
"INI OUTLET : "
+
this
.
props
.
outlet_id
)
//
console.log("INI OUTLET : "+ this.props.outlet_id)
this
.
_unsubscribe
=
this
.
props
.
navigation
.
addListener
(
'focus'
,
()
=>
{
this
.
_unsubscribe
=
this
.
props
.
navigation
.
addListener
(
'focus'
,
()
=>
{
if
(
this
.
props
.
outlet_id
!=
''
)
{
if
(
this
.
props
.
outlet_id
!=
''
)
{
this
.
getMenuList
()
this
.
getMenuList
()
...
@@ -47,11 +47,11 @@ class MenuSelection extends React.Component {
...
@@ -47,11 +47,11 @@ class MenuSelection extends React.Component {
let
params
=
{
let
params
=
{
outlet_id
:
this
.
props
.
outlet_id
outlet_id
:
this
.
props
.
outlet_id
}
}
console
.
log
(
"INI YA "
+
params
)
//
console.log("INI YA " + params)
Axios
.
post
(
'https://excelsocrm.ravintoladev.com/crm/v2/menu/get_list'
,
params
).
then
(
res
=>
{
Axios
.
post
(
'https://excelsocrm.ravintoladev.com/crm/v2/menu/get_list'
,
params
).
then
(
res
=>
{
let
data
=
res
.
data
.
data
let
data
=
res
.
data
.
data
console
.
log
(
"INI DATANYA"
+
JSON
.
stringify
(
data
))
//
console.log("INI DATANYA" + JSON.stringify(data))
this
.
setState
({
this
.
setState
({
listCategory
:
data
.
category
,
listCategory
:
data
.
category
,
listMenu
:
data
.
menu
,
listMenu
:
data
.
menu
,
...
...
view/OutletDetails.js
View file @
6ea744fa
...
@@ -25,13 +25,13 @@ class OutletDetail extends React.Component {
...
@@ -25,13 +25,13 @@ class OutletDetail extends React.Component {
getMaps
()
{
getMaps
()
{
const
{
navigation
,
route
}
=
this
.
props
;
const
{
navigation
,
route
}
=
this
.
props
;
const
{
id
}
=
route
.
params
const
{
id
}
=
route
.
params
console
.
log
(
this
.
props
.
session_id
)
//
console.log(this.props.session_id)
let
params
=
{
let
params
=
{
session_id
:
this
.
props
.
session_id
,
session_id
:
this
.
props
.
session_id
,
outlet_id
:
id
outlet_id
:
id
}
}
console
.
log
(
"INI PARAMETERNYA"
+
JSON
.
stringify
(
params
))
//
console.log("INI PARAMETERNYA" + JSON.stringify(params))
Axios
.
post
(
"https://excelsocrm.ravintoladev.com/crm/v2/outlet/get_detail"
,
params
).
then
(
res
=>
{
Axios
.
post
(
"https://excelsocrm.ravintoladev.com/crm/v2/outlet/get_detail"
,
params
).
then
(
res
=>
{
let
data_details
=
res
.
data
.
outlet
let
data_details
=
res
.
data
.
outlet
...
...
view/PickupName.js
View file @
6ea744fa
...
@@ -81,7 +81,7 @@ class PickupName extends React.Component {
...
@@ -81,7 +81,7 @@ class PickupName extends React.Component {
this
.
props
.
setTypePickup
(
true
);
this
.
props
.
setTypePickup
(
true
);
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'
,
{
outlet_change
:
true
,
outlet_id
:
id
}
)
}
else
{
}
else
{
this
.
props
.
navigation
.
navigate
(
"Menu Select"
)
this
.
props
.
navigation
.
navigate
(
"Menu Select"
)
}
}
...
...
view/ResetPassword.js
View file @
6ea744fa
...
@@ -25,7 +25,7 @@ class ResetPassword extends React.Component {
...
@@ -25,7 +25,7 @@ class ResetPassword extends React.Component {
let
params
=
{
let
params
=
{
'email'
:
this
.
state
.
email
'email'
:
this
.
state
.
email
}
}
console
.
log
(
this
.
state
.
email
)
//
console.log(this.state.email)
Axios
.
post
(
BASE_URL_RESET_PASSWORD
,
params
).
then
(
res
=>
{
Axios
.
post
(
BASE_URL_RESET_PASSWORD
,
params
).
then
(
res
=>
{
if
(
res
.
status
===
200
)
{
if
(
res
.
status
===
200
)
{
let
resetProps
=
{
let
resetProps
=
{
...
...
view/ShoppingCart.js
View file @
6ea744fa
...
@@ -25,7 +25,6 @@ class ShoppingCart extends React.Component {
...
@@ -25,7 +25,6 @@ class ShoppingCart extends React.Component {
pointsused
:
0
,
pointsused
:
0
,
ongkir
:
0
,
ongkir
:
0
,
diskon
:
0
,
diskon
:
0
,
// order_item: this.props.order_item,
grabtype
:
''
,
grabtype
:
''
,
grabamount
:
''
,
grabamount
:
''
,
grabpickup
:
''
,
grabpickup
:
''
,
...
@@ -45,8 +44,36 @@ class ShoppingCart extends React.Component {
...
@@ -45,8 +44,36 @@ class ShoppingCart extends React.Component {
if
(
!
this
.
props
.
type_pickup
)
{
if
(
!
this
.
props
.
type_pickup
)
{
this
.
getRate
()
this
.
getRate
()
}
}
this
.
getBalance
()
this
.
getBalance
()
this
.
_unsubscribe
=
this
.
props
.
navigation
.
addListener
(
'focus'
,
()
=>
{
if
(
!
this
.
props
.
type_pickup
)
{
this
.
getRate
()
}
this
.
getBalance
()
// console.log('UPDATE PRICE')
let
params
=
this
.
props
.
route
.
params
;
if
(
params
!=
undefined
)
{
if
(
params
.
outlet_change
!=
undefined
&&
params
.
outlet_change
)
{
Axios
.
post
(
'https://excelsocrm.ravintoladev.com/crm/v2/menu/get_list'
,
{
outlet_id
:
params
.
outlet_id
}).
then
(
res
=>
{
let
data
=
res
.
data
.
data
// console.log('UPDATEING PRICE :' + JSON.stringify(data.menu))
this
.
props
.
updateMenu
(
data
.
menu
)
})
}
}
});
}
componentWillUnmount
()
{
this
.
_unsubscribe
();
}
}
checkChangeTrans
(
val
)
{
checkChangeTrans
(
val
)
{
...
@@ -80,13 +107,13 @@ class ShoppingCart extends React.Component {
...
@@ -80,13 +107,13 @@ class ShoppingCart extends React.Component {
}
}
handleMin
(
item
,
index
)
{
handleMin
(
item
,
index
)
{
console
.
log
(
"hai"
)
//
console.log("hai")
const
list_order_item
=
this
.
props
.
order_item
;
const
list_order_item
=
this
.
props
.
order_item
;
console
.
log
(
'wakwaw'
)
//
console.log('wakwaw')
let
is_xist
=
list_order_item
.
find
(
row
=>
row
.
id
==
item
.
id
)
let
is_xist
=
list_order_item
.
find
(
row
=>
row
.
id
==
item
.
id
)
console
.
log
(
'next'
)
//
console.log('next')
console
.
log
(
JSON
.
stringify
(
is_xist
))
//
console.log(JSON.stringify(is_xist))
if
(
is_xist
)
{
if
(
is_xist
)
{
if
(
is_xist
.
quantity
!=
0
)
{
if
(
is_xist
.
quantity
!=
0
)
{
const
order_item
=
{
const
order_item
=
{
...
@@ -141,7 +168,7 @@ class ShoppingCart extends React.Component {
...
@@ -141,7 +168,7 @@ class ShoppingCart extends React.Component {
const
list_order_item
=
this
.
props
.
order_item
;
const
list_order_item
=
this
.
props
.
order_item
;
let
is_xist
=
list_order_item
.
find
(
row
=>
row
.
id
==
item
.
id
)
let
is_xist
=
list_order_item
.
find
(
row
=>
row
.
id
==
item
.
id
)
console
.
log
(
"INI YA : "
+
is_xist
)
//
console.log("INI YA : " + is_xist)
let
quantity
=
0
let
quantity
=
0
if
(
is_xist
)
{
if
(
is_xist
)
{
...
@@ -229,7 +256,7 @@ class ShoppingCart extends React.Component {
...
@@ -229,7 +256,7 @@ class ShoppingCart extends React.Component {
address_id
:
this
.
props
.
addressId
,
address_id
:
this
.
props
.
addressId
,
}
}
console
.
log
(
"INI PRAMETER NYA : "
+
JSON
.
stringify
(
params
))
//
console.log("INI PRAMETER NYA : " + JSON.stringify(params))
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
=>
{
...
@@ -245,8 +272,8 @@ class ShoppingCart extends React.Component {
...
@@ -245,8 +272,8 @@ 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
)
//
console.log('Delivery Amount Cart : ' + res.data.data.amount)
let
OutletChange
=
{
let
OutletChange
=
{
...
@@ -698,6 +725,12 @@ const styles = StyleSheet.create({
...
@@ -698,6 +725,12 @@ const styles = StyleSheet.create({
const
mapDispatchToProps
=
(
dispacth
)
=>
{
const
mapDispatchToProps
=
(
dispacth
)
=>
{
return
{
return
{
updateMenu
:
(
menu
)
=>
dispacth
({
type
:
ActionType
.
UPDATE_MENU
,
data
:
{
menu
:
menu
}
}),
setChangeOutletProps
:
(
OutletChange
)
=>
dispacth
({
setChangeOutletProps
:
(
OutletChange
)
=>
dispacth
({
type
:
ActionType
.
SET_CHANGE_OUTLET
,
type
:
ActionType
.
SET_CHANGE_OUTLET
,
data
:
{
data
:
{
...
...
view/TopUpInfo.js
View file @
6ea744fa
...
@@ -39,7 +39,7 @@ export default class TopUpInfo extends React.Component {
...
@@ -39,7 +39,7 @@ export default class TopUpInfo extends React.Component {
}).
catch
(
error
=>
{
}).
catch
(
error
=>
{
let
response
=
error
.
response
.
data
;
let
response
=
error
.
response
.
data
;
console
.
log
(
response
.
msg
)
//
console.log(response.msg)
Alert
.
alert
(
response
.
msg
);
Alert
.
alert
(
response
.
msg
);
})
})
}
}
...
...
view/TransactionDetail.js
View file @
6ea744fa
...
@@ -34,9 +34,9 @@ class TransactionDetail extends React.Component {
...
@@ -34,9 +34,9 @@ class TransactionDetail extends React.Component {
transaction_id
:
this
.
props
.
route
.
params
.
idTrans
transaction_id
:
this
.
props
.
route
.
params
.
idTrans
}
}
Axios
.
post
(
'https://excelsocrm.ravintoladev.com/crm/v2/transaction/detail'
,
params
).
then
(
res
=>
{
Axios
.
post
(
'https://excelsocrm.ravintoladev.com/crm/v2/transaction/detail'
,
params
).
then
(
res
=>
{
console
.
log
(
"INI DATA NYA LHOOOOO ......."
+
JSON
.
stringify
(
res
.
data
))
//
console.log("INI DATA NYA LHOOOOO ......." + JSON.stringify(res.data))
let
data
=
res
.
data
let
data
=
res
.
data
console
.
log
(
data
)
//
console.log(data)
this
.
setState
({
this
.
setState
({
trans_type_display
:
data
.
trans_type_display
,
trans_type_display
:
data
.
trans_type_display
,
transId
:
data
.
trans_id
,
transId
:
data
.
trans_id
,
...
...
view/TransactionHistory.js
View file @
6ea744fa
...
@@ -22,7 +22,7 @@ class TransactionHistory extends React.Component {
...
@@ -22,7 +22,7 @@ class TransactionHistory extends React.Component {
}
}
Axios
.
post
(
'https://excelsocrm.ravintoladev.com/crm/v2/transaction/history'
,
params
).
then
(
res
=>
{
Axios
.
post
(
'https://excelsocrm.ravintoladev.com/crm/v2/transaction/history'
,
params
).
then
(
res
=>
{
let
data
=
res
.
data
.
transactions
let
data
=
res
.
data
.
transactions
console
.
log
(
'ini datanya loh : '
+
JSON
.
stringify
(
data
))
//
console.log('ini datanya loh : ' + JSON.stringify(data))
this
.
setState
({
this
.
setState
({
history_list
:
data
history_list
:
data
})
})
...
...
view/TransferBalance.js
View file @
6ea744fa
...
@@ -30,7 +30,7 @@ class TransferBalance extends React.Component {
...
@@ -30,7 +30,7 @@ class TransferBalance extends React.Component {
}
}
Axios
.
post
(
'https://excelsocrm.ravintoladev.com/crm/v2/member/get_profile'
,
params
).
then
(
res
=>
{
Axios
.
post
(
'https://excelsocrm.ravintoladev.com/crm/v2/member/get_profile'
,
params
).
then
(
res
=>
{
let
data
=
res
.
data
let
data
=
res
.
data
console
.
log
(
'ini res nya : '
+
data
.
kaspro_balance
)
//
console.log('ini res nya : ' + data.kaspro_balance)
this
.
setState
({
this
.
setState
({
full_name
:
data
.
name
,
full_name
:
data
.
name
,
email
:
data
.
email
,
email
:
data
.
email
,
...
@@ -42,7 +42,7 @@ class TransferBalance extends React.Component {
...
@@ -42,7 +42,7 @@ class TransferBalance extends React.Component {
})
})
}).
catch
(
error
=>
{
}).
catch
(
error
=>
{
let
response
=
error
.
response
.
data
;
let
response
=
error
.
response
.
data
;
console
.
log
(
response
.
msg
);
//
console.log(response.msg);
})
})
}
}
...
@@ -54,9 +54,9 @@ class TransferBalance extends React.Component {
...
@@ -54,9 +54,9 @@ class TransferBalance extends React.Component {
"reference"
:
this
.
state
.
reference
"reference"
:
this
.
state
.
reference
}
}
console
.
log
(
params
);
//
console.log(params);
Axios
.
post
(
'https://excelsocrm.ravintoladev.com/crm/v2/card/transfer'
,
params
).
then
(
res
=>
{
Axios
.
post
(
'https://excelsocrm.ravintoladev.com/crm/v2/card/transfer'
,
params
).
then
(
res
=>
{
console
.
log
(
'ini res '
+
JSON
.
stringify
(
res
.
data
))
//
console.log('ini res ' + JSON.stringify(res.data))
Alert
.
alert
(
'Transaksi Berhasil'
)
Alert
.
alert
(
'Transaksi Berhasil'
)
this
.
props
.
navigation
.
goBack
()
this
.
props
.
navigation
.
goBack
()
}).
catch
(
error
=>
{
}).
catch
(
error
=>
{
...
@@ -196,7 +196,7 @@ const mapStateToProps = (state) => {
...
@@ -196,7 +196,7 @@ const mapStateToProps = (state) => {
}
}
const
mapDispatchToProps
=
(
dispacth
)
=>
{
const
mapDispatchToProps
=
(
dispacth
)
=>
{
console
.
log
(
dispacth
)
//
console.log(dispacth)
return
{
return
{
setCardactive
:
(
cardProps
)
=>
dispacth
({
setCardactive
:
(
cardProps
)
=>
dispacth
({
type
:
ActionType
.
SET_CARD
,
type
:
ActionType
.
SET_CARD
,
...
...
view/UpgradePremium.js
View file @
6ea744fa
...
@@ -147,7 +147,7 @@ class UpgradePremium extends React.Component {
...
@@ -147,7 +147,7 @@ class UpgradePremium extends React.Component {
// console.log(params.customer_image);
// console.log(params.customer_image);
Axios
.
post
(
'https://excelsocrm.ravintoladev.com/crm/v2/card/upgrade_premium'
,
params
).
then
(
res
=>
{
Axios
.
post
(
'https://excelsocrm.ravintoladev.com/crm/v2/card/upgrade_premium'
,
params
).
then
(
res
=>
{
console
.
log
(
'ini res '
+
JSON
.
stringify
(
res
.
data
))
//
console.log('ini res ' + JSON.stringify(res.data))
Alert
.
alert
(
Alert
.
alert
(
''
,
''
,
'Permintaan upgrade premium anda telah kami terima, mohon menunggu 1x24 jam!'
'Permintaan upgrade premium anda telah kami terima, mohon menunggu 1x24 jam!'
...
...
view/VerifyEmail.js
View file @
6ea744fa
...
@@ -3,7 +3,7 @@ import { View, Text, TextInput, StyleSheet, Button } from 'react-native';
...
@@ -3,7 +3,7 @@ import { View, Text, TextInput, StyleSheet, Button } from 'react-native';
export
default
class
VerifyEmail
extends
React
.
Component
{
export
default
class
VerifyEmail
extends
React
.
Component
{
submit
()
{
submit
()
{
console
.
log
(
'hai'
);
//
console.log('hai');
}
}
render
()
{
render
()
{
...
...
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