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
e5d203f6
Commit
e5d203f6
authored
Apr 28, 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
parents
923faaa6
73ac6bc6
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
24 deletions
+25
-24
MenuConfirmation.js
view/MenuConfirmation.js
+4
-1
OrderHistory.js
view/OrderHistory.js
+16
-18
ShoppingCart.js
view/ShoppingCart.js
+5
-5
No files found.
view/MenuConfirmation.js
View file @
e5d203f6
...
...
@@ -44,9 +44,12 @@ class MenuConfirmation extends React.Component {
}
Axios
.
post
(
'https://excelsocrm.ravintoladev.com/crm/v2/transaction/booking'
,
params
).
then
(
res
=>
{
Alert
.
alert
(
res
.
data
.
response
.
msg
)
Alert
.
alert
(
res
.
data
.
status
,
'Transaksi Berhasil'
)
// console.log(res.data.data)
}).
catch
(
error
=>
{
let
response
=
error
.
response
.
data
;
// console.log('error')
Alert
.
alert
(
response
.
msg
);
})
}
...
...
view/OrderHistory.js
View file @
e5d203f6
...
...
@@ -14,7 +14,7 @@ class OrderHistory extends React.Component {
}
componentDidMount
(){
componentDidMount
()
{
this
.
getOrderHistory
()
...
...
@@ -24,36 +24,34 @@ class OrderHistory extends React.Component {
let
params
=
{
session_id
:
this
.
props
.
session_id
}
Axios
.
post
(
'https://excelsocrm.ravintoladev.com/crm/v2/transaction/
history
'
,
params
).
then
(
res
=>
{
let
data
=
res
.
data
.
transactions
// console.log(
'ini datanya loh : ' + JSON.stringify(data)
)
Axios
.
post
(
'https://excelsocrm.ravintoladev.com/crm/v2/transaction/
list
'
,
params
).
then
(
res
=>
{
let
data
=
res
.
data
.
data
// console.log(
data
)
this
.
setState
({
order_list
:
data
})
console
.
log
(
this
.
state
.
order_list
)
//
console.log(this.state.order_list)
}).
catch
(
error
=>
{
let
response
=
error
.
response
.
data
;
Alert
.
alert
(
response
.
msg
);
})
}
render
(){
render
()
{
// console.log(this.state.order_list)
return
(
return
(
<
View
style
=
{
styles
.
container
}
>
<
ScrollView
style
=
{
styles
.
body
}
>
{
this
.
state
.
order_list
.
map
((
item
)
=>
(
item
.
transactions
.
map
((
i
,
k
)
=>
(
<
TouchableOpacity
key
=
{
k
}
onPress
=
{()
=>
this
.
props
.
navigation
.
navigate
(
'Transaction Detail'
,
{
idTrans
:
i
.
id
})}
>
this
.
state
.
order_list
.
map
((
item
,
key
)
=>
(
<
View
key
=
{
key
}
>
<
Card
style
=
{{
padding
:
10
,
margin
:
10
,
alignContent
:
'center'
}}
>
<
Text
>
{
i
.
trans_id
}
<
/Text
>
<
Text
>
{
i
.
trans_date
}
<
/Text
>
<
Text
>
{
i
.
trans_total
}
<
/Text
>
<
Text
>
{
item
.
outlet
}
<
/Text
>
<
Text
>
{
item
.
trans_date
}
<
/Text
>
<
Text
>
{
item
.
trans_total
}
<
/Text
>
<
/Card
>
<
/TouchableOpacity
>
))
<
/View
>
))
}
<
/ScrollView
>
...
...
view/ShoppingCart.js
View file @
e5d203f6
...
...
@@ -127,7 +127,7 @@ class ShoppingCart extends React.Component {
checkedBalance
:
true
,
checkedPoint
:
false
,
checkedBalancePoint
:
false
,
balanceused
:
this
.
props
.
order_total
,
balanceused
:
this
.
props
.
order_total
+
this
.
props
.
grabamount
,
pointsused
:
0
})
}
else
if
(
val
==
'point'
)
{
...
...
@@ -135,7 +135,7 @@ class ShoppingCart extends React.Component {
checkedBalance
:
false
,
checkedPoint
:
true
,
checkedBalancePoint
:
false
,
pointsused
:
this
.
props
.
order_total
,
pointsused
:
this
.
props
.
order_total
+
this
.
props
.
grabamount
,
balanceused
:
0
})
}
else
{
...
...
@@ -146,13 +146,13 @@ class ShoppingCart extends React.Component {
// balanceused : this.props.order_total - this.state.dummyPoint,
// pointsused : this.props.order_total,
})
if
(
this
.
state
.
kasproPoint
-
this
.
props
.
order_total
>=
-
1
)
{
if
(
this
.
state
.
kasproPoint
-
(
this
.
props
.
order_total
+
this
.
props
.
grabamount
)
>=
-
1
)
{
this
.
setState
({
pointsused
:
this
.
props
.
order_total
pointsused
:
this
.
props
.
order_total
+
this
.
props
.
grabamount
})
}
else
{
this
.
setState
({
balanceused
:
this
.
props
.
order_total
-
this
.
state
.
kasproPoint
,
balanceused
:
(
this
.
props
.
order_total
+
this
.
props
.
grabamount
)
-
this
.
state
.
kasproPoint
,
pointsused
:
this
.
state
.
kasproPoint
})
}
...
...
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