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
9d02f0da
Commit
9d02f0da
authored
Aug 06, 2020
by
Trisno
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update fixing bug shopping cart
parent
e0fb59c8
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
245 additions
and
117 deletions
+245
-117
app.json
app.json
+1
-1
ShoppingCart.js
view/ShoppingCart.js
+244
-116
No files found.
app.json
View file @
9d02f0da
{
"expo"
:
{
"extra"
:
{
"buildNumber"
:
"13
4
"
,
"buildNumber"
:
"13
5
"
,
"remarks"
:
""
},
...
...
view/ShoppingCart.js
View file @
9d02f0da
...
...
@@ -362,10 +362,10 @@ class ShoppingCart extends React.Component {
})
}
}
else
{
if
(
this
.
state
.
kasproPoint
-
(
Math
.
max
(
0
,(
parseInt
(
this
.
props
.
order_total
)
-
parseInt
(
this
.
props
.
voucher
.
reward
.
value
)
+
this
.
props
.
grabamount
)))
>=
-
1
)
{
console
.
log
(
this
.
state
.
kasproPoint
-
(
Math
.
max
(
0
,(
parseInt
(
this
.
props
.
order_total
)
-
parseInt
(
this
.
props
.
voucher
.
reward
.
value
)
+
this
.
props
.
grabamount
))))
if
(
this
.
state
.
kasproPoint
-
(
Math
.
max
(
0
,
(
parseInt
(
this
.
props
.
order_total
)
-
parseInt
(
this
.
props
.
voucher
.
reward
.
value
)
+
this
.
props
.
grabamount
)))
>=
-
1
)
{
console
.
log
(
this
.
state
.
kasproPoint
-
(
Math
.
max
(
0
,
(
parseInt
(
this
.
props
.
order_total
)
-
parseInt
(
this
.
props
.
voucher
.
reward
.
value
)
+
this
.
props
.
grabamount
))))
this
.
setState
({
pointsused
:
(
Math
.
max
(
0
,
parseInt
(
this
.
props
.
order_total
)
-
parseInt
(
this
.
props
.
voucher
.
reward
.
value
)
+
this
.
props
.
grabamount
)),
pointsused
:
(
Math
.
max
(
0
,
parseInt
(
this
.
props
.
order_total
)
-
parseInt
(
this
.
props
.
voucher
.
reward
.
value
)
+
this
.
props
.
grabamount
)),
balanceused
:
0
})
}
else
{
...
...
@@ -578,6 +578,9 @@ class ShoppingCart extends React.Component {
<
View
style
=
{
styles
.
payment
}
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Black'
,
color
:
'grey'
}}
>
{
i18n
.
t
(
'paymentMethods'
)}
<
/Text
>
<
/View
>
{
this
.
props
.
value_voucher
==
''
?
(
<>
<
View
style
=
{{
alignItems
:
'center'
}}
>
{
...
...
@@ -697,6 +700,131 @@ class ShoppingCart extends React.Component {
)
}
<
/View
>
<
/
>
)
:
(
<>
<
View
style
=
{{
alignItems
:
'center'
}}
>
{
this
.
state
.
kasproBalance
<
this
.
props
.
order_total
-
parseInt
(
this
.
props
.
voucher
.
reward
.
value
)
+
this
.
props
.
grabamount
||
this
.
props
.
order_total
==
0
?
(
<
Card
style
=
{{
margin
:
5
,
padding
:
10
,
backgroundColor
:
'gray'
}}
>
<
View
style
=
{{
flexDirection
:
'row'
,
justifyContent
:
'space-between'
,
alignItems
:
'center'
}}
>
<
View
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Black'
,
color
:
'white'
}}
>
EXCELSO
{
i18n
.
t
(
'balance'
)}
<
/Text
>
<
/View
>
<
View
>
<
FontAwesome
name
=
'circle-o'
size
=
{
30
}
color
=
{
'#ccb46c'
}
/
>
<
/View
>
<
/View
>
<
/Card
>
)
:
(
<
TouchableOpacity
onPress
=
{()
=>
{
this
.
checkedSelection
(
'balance'
)
}}
>
<
Card
style
=
{{
margin
:
5
,
padding
:
10
}}
>
<
View
style
=
{{
flexDirection
:
'row'
,
justifyContent
:
'space-between'
,
alignItems
:
'center'
}}
>
<
View
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Black'
,
color
:
'grey'
}}
>
EXCELSO
{
i18n
.
t
(
'balance'
)}
<
/Text
>
<
/View
>
<
View
>
<
CheckBox
onClick
=
{()
=>
{
this
.
checkedSelection
(
'balance'
)
}}
isChecked
=
{
this
.
state
.
checkedBalance
}
checkedImage
=
{
<
FontAwesome
name
=
'check-circle'
size
=
{
30
}
color
=
{
'#ccb46c'
}
/>
}
unCheckedImage
=
{
<
FontAwesome
name
=
'circle-o'
size
=
{
30
}
color
=
{
'#ccb46c'
}
/>
}
/>
<
/View
>
<
/View
>
<
/Card
>
<
/TouchableOpacity
>
)
}
<
/View
>
<
View
style
=
{{
alignItems
:
'center'
}}
>
{
this
.
state
.
kasproPoint
<
this
.
props
.
order_total
-
parseInt
(
this
.
props
.
voucher
.
reward
.
value
)
+
this
.
props
.
grabamount
||
this
.
props
.
order_total
==
0
?
(
<
Card
style
=
{{
margin
:
5
,
padding
:
10
,
backgroundColor
:
'gray'
}}
>
<
View
style
=
{{
flexDirection
:
'row'
,
justifyContent
:
'space-between'
,
alignItems
:
'center'
}}
>
<
View
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Black'
,
color
:
'white'
}}
>
EXCELSO
{
i18n
.
t
(
'point'
)}
<
/Text
>
<
/View
>
<
View
>
<
FontAwesome
name
=
'circle-o'
size
=
{
30
}
color
=
{
'#ccb46c'
}
/
>
<
/View
>
<
/View
>
<
/Card
>
)
:
(
<
TouchableOpacity
onPress
=
{()
=>
{
this
.
checkedSelection
(
'point'
)
}}
>
<
Card
style
=
{{
margin
:
5
,
padding
:
10
}}
>
<
View
style
=
{{
flexDirection
:
'row'
,
justifyContent
:
'space-between'
,
alignItems
:
'center'
}}
>
<
View
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Black'
,
color
:
'grey'
}}
>
EXCELSO
{
i18n
.
t
(
'point'
)}
<
/Text
>
<
/View
>
<
View
>
<
CheckBox
onClick
=
{()
=>
{
this
.
checkedSelection
(
'point'
)
}}
isChecked
=
{
this
.
state
.
checkedPoint
}
checkedImage
=
{
<
FontAwesome
name
=
'check-circle'
size
=
{
30
}
color
=
{
'#ccb46c'
}
/>
}
unCheckedImage
=
{
<
FontAwesome
name
=
'circle-o'
size
=
{
30
}
color
=
{
'#ccb46c'
}
/>
}
/>
<
/View
>
<
/View
>
<
/Card
>
<
/TouchableOpacity
>
)
}
<
/View
>
<
View
style
=
{{
alignItems
:
'center'
}}
>
{
parseInt
(
this
.
state
.
kasproPoint
)
+
parseInt
(
this
.
state
.
kasproBalance
)
>=
this
.
props
.
order_total
-
parseInt
(
this
.
props
.
voucher
.
reward
.
value
)
+
this
.
props
.
grabamount
&&
this
.
state
.
kasproBalance
!=
0
&&
this
.
state
.
kasproPoint
!=
0
&&
this
.
props
.
order_total
!=
0
?
(
<
TouchableOpacity
onPress
=
{()
=>
{
this
.
checkedSelection
(
'balancepoint'
)
}}
>
<
Card
style
=
{{
margin
:
5
,
padding
:
10
}}
>
<
View
style
=
{{
flexDirection
:
'row'
,
justifyContent
:
'space-between'
,
alignItems
:
'center'
}}
>
<
View
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Black'
,
color
:
'grey'
}}
>
EXCELSO
{
i18n
.
t
(
'balance'
)}
+
{
i18n
.
t
(
'point'
)}
<
/Text
>
<
/View
>
<
View
>
<
CheckBox
onClick
=
{()
=>
{
this
.
checkedSelection
(
'balancepoint'
)
}}
isChecked
=
{
this
.
state
.
checkedBalancePoint
}
checkedImage
=
{
<
FontAwesome
name
=
'check-circle'
size
=
{
30
}
color
=
{
'#ccb46c'
}
/>
}
unCheckedImage
=
{
<
FontAwesome
name
=
'circle-o'
size
=
{
30
}
color
=
{
'#ccb46c'
}
/>
}
/>
<
/View
>
<
/View
>
<
/Card
>
<
/TouchableOpacity
>
)
:
(
<
Card
style
=
{{
margin
:
5
,
padding
:
10
,
backgroundColor
:
'gray'
}}
>
<
View
style
=
{{
flexDirection
:
'row'
,
justifyContent
:
'space-between'
,
alignItems
:
'center'
}}
>
<
View
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Black'
,
color
:
'white'
}}
>
EXCELSO
{
i18n
.
t
(
'balance'
)}
+
{
i18n
.
t
(
'point'
)}
<
/Text
>
<
/View
>
<
View
>
<
FontAwesome
name
=
'circle-o'
size
=
{
30
}
color
=
{
'#ccb46c'
}
/
>
<
/View
>
<
/View
>
<
/Card
>
)
}
<
/View
>
<
/
>
)
}
<
View
style
=
{{
alignItems
:
'center'
,
}}
>
<
Card
style
=
{{
margin
:
5
,
padding
:
10
}}
>
<
View
style
=
{{
flexDirection
:
'row'
,
justifyContent
:
'space-between'
,
marginBottom
:
5
}}
>
...
...
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