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
eed0973c
Commit
eed0973c
authored
Apr 27, 2020
by
Trisno
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
checkout order
parent
630880ee
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
4 deletions
+28
-4
MenuConfirmation.js
view/MenuConfirmation.js
+28
-4
No files found.
view/MenuConfirmation.js
View file @
eed0973c
import
React
from
'react'
;
import
React
from
'react'
;
import
{
View
,
Text
,
TextInput
,
StyleSheet
,
Button
,
ScrollView
}
from
'react-native'
;
import
{
View
,
Text
,
Alert
,
TextInput
,
StyleSheet
,
Button
,
ScrollView
}
from
'react-native'
;
import
Axios
from
'axios'
import
Axios
from
'axios'
import
{
connect
}
from
'react-redux'
import
{
connect
}
from
'react-redux'
class
MenuConfirmation
extends
React
.
Component
{
class
MenuConfirmation
extends
React
.
Component
{
...
@@ -16,8 +16,31 @@ class MenuConfirmation extends React.Component {
...
@@ -16,8 +16,31 @@ class MenuConfirmation extends React.Component {
}
}
}
}
setOrder
()
{
let
params
=
{
session_id
:
this
.
props
.
session_id
,
outlet_id
:
this
.
props
.
outlet_id
,
address_id
:
this
.
props
.
addressId
,
trans_type
:
"Delivery"
,
order_item
:
this
.
props
.
order_item
,
delivery_charge
:
this
.
state
.
ongkir
,
voucher
:
[],
payment
:
{
balance
:
this
.
props
.
route
.
params
.
balanceUsed
,
point
:
this
.
props
.
route
.
params
.
pointused
}
}
Axios
.
post
(
'https://excelsocrm.ravintoladev.com/crm/v2/transaction/booking'
,
params
).
then
(
res
=>
{
console
.
log
(
res
)
}).
catch
(
error
=>
{
let
response
=
error
.
response
.
data
;
Alert
.
alert
(
response
.
msg
);
})
}
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
}
>
...
@@ -96,7 +119,7 @@ class MenuConfirmation extends React.Component {
...
@@ -96,7 +119,7 @@ class MenuConfirmation extends React.Component {
<
/View
>
<
/View
>
<
/View
>
<
/View
>
<
View
style
=
{{
margin
:
10
}}
>
<
View
style
=
{{
margin
:
10
}}
>
<
Button
title
=
'order'
/>
<
Button
title
=
'order'
onPress
=
{
this
.
setOrder
()}
/
>
<
/View
>
<
/View
>
<
/ScrollView
>
<
/ScrollView
>
)
)
...
@@ -136,7 +159,8 @@ const mapStateToProps = (state) => {
...
@@ -136,7 +159,8 @@ const mapStateToProps = (state) => {
order_total
:
state
.
order_total
,
order_total
:
state
.
order_total
,
order_item
:
state
.
order_item
,
order_item
:
state
.
order_item
,
quantity
:
state
.
quantity
,
quantity
:
state
.
quantity
,
address
:
state
.
address
address
:
state
.
address
,
addressId
:
state
.
addressId
}
}
}
}
...
...
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