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
ffb55903
Commit
ffb55903
authored
May 12, 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
# Conflicts: # view/ShoppingCart.js
parents
5161e829
37ecc649
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
12 deletions
+41
-12
ShoppingCart.js
view/ShoppingCart.js
+41
-12
No files found.
view/ShoppingCart.js
View file @
ffb55903
...
...
@@ -43,7 +43,7 @@ class ShoppingCart extends React.Component {
componentDidMount
()
{
console
.
log
(
'INI VOUCHER : '
+
JSON
.
stringify
(
this
.
props
.
voucher
)
)
console
.
log
(
this
.
props
.
voucher
)
console
.
log
(
'INI VALUE : '
+
this
.
props
.
value_voucher
)
if
(
!
this
.
props
.
type_pickup
)
{
this
.
getRate
()
...
...
@@ -110,7 +110,7 @@ class ShoppingCart extends React.Component {
}
onChange
(
params
){
onChange
(
params
)
{
console
.
log
(
params
);
}
...
...
@@ -151,7 +151,7 @@ class ShoppingCart extends React.Component {
{
text
:
'Delete Item'
,
onPress
:
()
=>
{
this
.
props
.
reduceQuantityItem
(
order_item
)
if
(
is_xist
.
quantity
==
0
)
{
const
order_item
=
{
id
:
item
.
id
,
...
...
@@ -161,9 +161,9 @@ class ShoppingCart extends React.Component {
image
:
item
.
image
,
description
:
item
.
description
,
quantity
:
item
.
quantity
}
this
.
props
.
removeFromChart
(
order_item
)
}
}
...
...
@@ -179,7 +179,7 @@ class ShoppingCart extends React.Component {
}
deleteItem
()
{
}
handleAdd
(
item
,
index
)
{
...
...
@@ -325,15 +325,15 @@ class ShoppingCart extends React.Component {
this
.
props
.
setOrder
(
setOrdersProps
);
}).
catch
(
error
=>
{
const
{
navigation
}
=
this
.
props
const
{
navigation
}
=
this
.
props
let
response
=
error
.
response
.
data
session
(
response
,
navigation
)
session
(
response
,
navigation
)
Alert
.
alert
(
response
.
msg
);
})
}
onChange
(){
onChange
()
{
this
.
setState
({
checkedBalance
:
false
,
checkedPoint
:
false
,
...
...
@@ -344,9 +344,9 @@ class ShoppingCart extends React.Component {
}
checkOut
()
{
if
(
this
.
props
.
order_item
.
length
==
0
){
if
(
this
.
props
.
order_item
.
length
==
0
)
{
Alert
.
alert
(
'Error'
,
'Please choose your order first'
)
}
else
if
(
this
.
state
.
checkedBalance
==
false
&&
this
.
state
.
checkedPoint
==
false
&&
this
.
state
.
checkedBalancePoint
==
false
){
}
else
if
(
this
.
state
.
checkedBalance
==
false
&&
this
.
state
.
checkedPoint
==
false
&&
this
.
state
.
checkedBalancePoint
==
false
)
{
Alert
.
alert
(
'Error'
,
'Please insert payment methods'
)
}
else
{
this
.
props
.
navigation
.
navigate
(
'Confirm Your Order'
,
{
balanceUsed
:
this
.
state
.
balanceused
,
pointused
:
this
.
state
.
pointsused
})
...
...
@@ -419,7 +419,7 @@ class ShoppingCart extends React.Component {
item
=
{
item
}
handleAdd
=
{()
=>
this
.
handleAdd
(
item
,
index
)}
handleMin
=
{()
=>
this
.
handleMin
(
item
,
index
)}
onChange
=
{()
=>
this
.
onChange
(
item
,
index
)}
onChange
=
{()
=>
this
.
onChange
(
item
,
index
)}
/
>
)}
keyExtractor
=
{
item
=>
item
.
id
}
...
...
@@ -430,6 +430,33 @@ class ShoppingCart extends React.Component {
<
Text
style
=
{{
color
:
'#ccb46c'
}}
>+
ADD
VOUCHER
<
/Text
>
<
/TouchableOpacity
>
<
/View
>
<
View
style
=
{{
alignItems
:
'center'
}}
>
{
this
.
props
.
voucher
===
[]
?
(
<>
<
/
>
)
:
(
<
Card
style
=
{{
padding
:
5
,
margin
:
10
}}
>
<
View
>
<
Image
source
=
{{
uri
:
this
.
props
.
voucher
.
title_image
}}
resizeMethod
=
"resize"
resizeMode
=
'cover'
style
=
{{
height
:
150
,
width
:
'100%'
}}
/
>
<
/View
>
<
View
style
=
{{
flexDirection
:
'row'
,
justifyContent
:
'space-between'
,
padding
:
10
}}
>
<
View
>
<
Text
style
=
{{
fontWeight
:
'bold'
,
textAlign
:
'left'
}}
>
{
this
.
props
.
voucher
.
title
}
<
/Text
>
<
Text
style
=
{{
textAlign
:
'left'
}}
>
{
this
.
props
.
voucher
.
subtitle
}
<
/Text
>
<
/View
>
<
View
>
<
Text
style
=
{{
textAlign
:
'right'
}}
>
Diskon
<
/Text
>
<
Text
style
=
{{
textAlign
:
'right'
}}
>
{
this
.
props
.
voucher
.
value
}
<
/Text
>
<
/View
>
<
/View
>
<
/Card
>
)
}
<
/View
>
<
View
style
=
{
styles
.
payment
}
>
<
Text
>
PAYMENT
METHODS
<
/Text
>
<
/View
>
...
...
@@ -861,6 +888,8 @@ const mapStateToProps = (state) => {
session_id
:
state
.
session_id
,
outlet_id
:
state
.
outlet_id
,
name_outlet
:
state
.
name_outlet
,
value_voucher
:
state
.
value_voucher
,
voucher
:
state
.
voucher
,
order_quantity
:
state
.
order_quantity
,
order_total
:
state
.
order_total
,
order_item
:
state
.
order_item
,
...
...
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