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
37ecc649
Commit
37ecc649
authored
May 12, 2020
by
Trisno
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add reward di shopping cart
parent
16c8be4d
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
48 additions
and
19 deletions
+48
-19
RewardSelect.js
view/RewardSelect.js
+7
-7
ShoppingCart.js
view/ShoppingCart.js
+41
-12
No files found.
view/RewardSelect.js
View file @
37ecc649
...
@@ -96,17 +96,17 @@ class RewardSelect extends React.Component {
...
@@ -96,17 +96,17 @@ class RewardSelect extends React.Component {
<
View
>
<
View
>
<
Image
source
=
{{
uri
:
item
.
reward
.
title_image
}}
<
Image
source
=
{{
uri
:
item
.
reward
.
title_image
}}
resizeMethod
=
"resize"
resizeMethod
=
"resize"
resizeMode
=
'
stretch
'
resizeMode
=
'
cover
'
style
=
{{
height
:
150
,
width
:
430
}}
/
>
style
=
{{
height
:
150
,
width
:
'100%'
}}
/
>
<
/View
>
<
/View
>
<
View
style
=
{{
flexDirection
:
'row'
,
justifyContent
:
'space-between'
,
padding
:
10
}}
>
<
View
style
=
{{
flexDirection
:
'row'
,
justifyContent
:
'space-between'
,
padding
:
10
}}
>
<
View
>
<
View
>
<
Text
style
=
{{
fontWeight
:
'bold'
}}
>
{
item
.
reward
.
title
}
<
/Text
>
<
Text
style
=
{{
fontWeight
:
'bold'
,
textAlign
:
'left'
}}
>
{
item
.
reward
.
title
}
<
/Text
>
<
Text
>
{
item
.
reward
.
subtitle
}
<
/Text
>
<
Text
style
=
{{
textAlign
:
'left'
}}
>
{
item
.
reward
.
subtitle
}
<
/Text
>
<
/View
>
<
/View
>
<
View
>
<
View
>
<
Text
style
=
{{
textAlign
:
'right'
}}
>
Expired
<
/Text
>
<
Text
style
=
{{
textAlign
:
'right'
}}
>
Expired
<
/Text
>
<
Text
style
=
{{
textAlign
:
'right'
}}
>
{
item
.
expire_time
}
<
/Text
>
<
Text
style
=
{{
textAlign
:
'right'
}}
>
{
item
.
expire_time
}
<
/Text
>
<
/View
>
<
/View
>
<
/View
>
<
/View
>
<
/Card
>
<
/Card
>
...
...
view/ShoppingCart.js
View file @
37ecc649
...
@@ -43,7 +43,7 @@ class ShoppingCart extends React.Component {
...
@@ -43,7 +43,7 @@ class ShoppingCart extends React.Component {
componentDidMount
()
{
componentDidMount
()
{
console
.
log
(
'INI VOUCHER : '
+
this
.
props
.
voucher
)
console
.
log
(
this
.
props
.
voucher
)
console
.
log
(
'INI VALUE : '
+
this
.
props
.
value_voucher
)
console
.
log
(
'INI VALUE : '
+
this
.
props
.
value_voucher
)
if
(
!
this
.
props
.
type_pickup
)
{
if
(
!
this
.
props
.
type_pickup
)
{
this
.
getRate
()
this
.
getRate
()
...
@@ -110,7 +110,7 @@ class ShoppingCart extends React.Component {
...
@@ -110,7 +110,7 @@ class ShoppingCart extends React.Component {
}
}
onChange
(
params
){
onChange
(
params
)
{
console
.
log
(
params
);
console
.
log
(
params
);
}
}
...
@@ -325,15 +325,15 @@ class ShoppingCart extends React.Component {
...
@@ -325,15 +325,15 @@ class ShoppingCart extends React.Component {
this
.
props
.
setOrder
(
setOrdersProps
);
this
.
props
.
setOrder
(
setOrdersProps
);
}).
catch
(
error
=>
{
}).
catch
(
error
=>
{
const
{
navigation
}
=
this
.
props
const
{
navigation
}
=
this
.
props
let
response
=
error
.
response
.
data
let
response
=
error
.
response
.
data
session
(
response
,
navigation
)
session
(
response
,
navigation
)
Alert
.
alert
(
response
.
msg
);
Alert
.
alert
(
response
.
msg
);
})
})
}
}
onChange
(){
onChange
()
{
this
.
setState
({
this
.
setState
({
checkedBalance
:
false
,
checkedBalance
:
false
,
checkedPoint
:
false
,
checkedPoint
:
false
,
...
@@ -344,9 +344,9 @@ class ShoppingCart extends React.Component {
...
@@ -344,9 +344,9 @@ class ShoppingCart extends React.Component {
}
}
checkOut
()
{
checkOut
()
{
if
(
this
.
props
.
order_item
.
length
==
0
){
if
(
this
.
props
.
order_item
.
length
==
0
)
{
Alert
.
alert
(
'Error'
,
'Please choose your order first'
)
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'
)
Alert
.
alert
(
'Error'
,
'Please insert payment methods'
)
}
else
{
}
else
{
this
.
props
.
navigation
.
navigate
(
'Confirm Your Order'
,
{
balanceUsed
:
this
.
state
.
balanceused
,
pointused
:
this
.
state
.
pointsused
})
this
.
props
.
navigation
.
navigate
(
'Confirm Your Order'
,
{
balanceUsed
:
this
.
state
.
balanceused
,
pointused
:
this
.
state
.
pointsused
})
...
@@ -419,7 +419,7 @@ class ShoppingCart extends React.Component {
...
@@ -419,7 +419,7 @@ class ShoppingCart extends React.Component {
item
=
{
item
}
item
=
{
item
}
handleAdd
=
{()
=>
this
.
handleAdd
(
item
,
index
)}
handleAdd
=
{()
=>
this
.
handleAdd
(
item
,
index
)}
handleMin
=
{()
=>
this
.
handleMin
(
item
,
index
)}
handleMin
=
{()
=>
this
.
handleMin
(
item
,
index
)}
onChange
=
{()
=>
this
.
onChange
(
item
,
index
)}
onChange
=
{()
=>
this
.
onChange
(
item
,
index
)}
/
>
/
>
)}
)}
keyExtractor
=
{
item
=>
item
.
id
}
keyExtractor
=
{
item
=>
item
.
id
}
...
@@ -430,6 +430,33 @@ class ShoppingCart extends React.Component {
...
@@ -430,6 +430,33 @@ class ShoppingCart extends React.Component {
<
Text
style
=
{{
color
:
'#ccb46c'
}}
>+
ADD
VOUCHER
<
/Text
>
<
Text
style
=
{{
color
:
'#ccb46c'
}}
>+
ADD
VOUCHER
<
/Text
>
<
/TouchableOpacity
>
<
/TouchableOpacity
>
<
/View
>
<
/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
}
>
<
View
style
=
{
styles
.
payment
}
>
<
Text
>
PAYMENT
METHODS
<
/Text
>
<
Text
>
PAYMENT
METHODS
<
/Text
>
<
/View
>
<
/View
>
...
@@ -861,6 +888,8 @@ const mapStateToProps = (state) => {
...
@@ -861,6 +888,8 @@ const mapStateToProps = (state) => {
session_id
:
state
.
session_id
,
session_id
:
state
.
session_id
,
outlet_id
:
state
.
outlet_id
,
outlet_id
:
state
.
outlet_id
,
name_outlet
:
state
.
name_outlet
,
name_outlet
:
state
.
name_outlet
,
value_voucher
:
state
.
value_voucher
,
voucher
:
state
.
voucher
,
order_quantity
:
state
.
order_quantity
,
order_quantity
:
state
.
order_quantity
,
order_total
:
state
.
order_total
,
order_total
:
state
.
order_total
,
order_item
:
state
.
order_item
,
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