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
f7eeee7f
Commit
f7eeee7f
authored
Jun 10, 2020
by
Trisno
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
minimum transaksi reward
parent
b7ec065c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
+10
-2
ShoppingCart.js
view/ShoppingCart.js
+10
-2
No files found.
view/ShoppingCart.js
View file @
f7eeee7f
import
React
from
'react'
;
import
React
from
'react'
;
import
{
View
,
Text
,
TextInput
,
StyleSheet
,
Button
,
TouchableOpacity
,
ScrollView
,
FlatList
,
Image
,
Alert
,
ActivityIndicator
}
from
'react-native'
;
import
{
View
,
Text
,
TextInput
,
StyleSheet
,
Button
,
TouchableOpacity
,
ScrollView
,
FlatList
,
Image
,
Alert
,
ActivityIndicator
,
ToastAndroid
}
from
'react-native'
;
import
{
connect
}
from
'react-redux'
import
{
connect
}
from
'react-redux'
import
CheckBox
from
'react-native-check-box'
import
CheckBox
from
'react-native-check-box'
import
{
Card
}
from
'react-native-shadow-cards'
import
{
Card
}
from
'react-native-shadow-cards'
...
@@ -392,9 +392,16 @@ class ShoppingCart extends React.Component {
...
@@ -392,9 +392,16 @@ class ShoppingCart extends React.Component {
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
if
(
this
.
props
.
value_voucher
!==
''
)
{
if
(
parseInt
(
this
.
props
.
value_voucher
.
reward
.
min_transaction
)
>
parseInt
(
this
.
props
.
order_total
))
{
Alert
.
alert
(
''
,
'Reward tidak bisa dipakai karena minimum transaksi kurang, ayo tambah pesanan mu lagi'
)
}
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
})
}
}
}
else
{
this
.
props
.
navigation
.
navigate
(
'CONFIRM YOUR ORDER'
,
{
balanceUsed
:
this
.
state
.
balanceused
,
pointused
:
this
.
state
.
pointsused
})
}
}
}
getBalance
()
{
getBalance
()
{
...
@@ -409,7 +416,7 @@ class ShoppingCart extends React.Component {
...
@@ -409,7 +416,7 @@ class ShoppingCart extends React.Component {
kasproPoint
:
kaspro_point
.
replace
(
/,/g
,
''
)
kasproPoint
:
kaspro_point
.
replace
(
/,/g
,
''
)
})
})
console
.
log
(
this
.
state
.
kasproBalance
,
this
.
state
.
kasproPoint
)
//
console.log(this.state.kasproBalance, this.state.kasproPoint)
}).
catch
(
error
=>
{
}).
catch
(
error
=>
{
const
{
navigation
}
=
this
.
props
const
{
navigation
}
=
this
.
props
let
response
=
error
.
response
.
data
let
response
=
error
.
response
.
data
...
@@ -423,6 +430,7 @@ class ShoppingCart extends React.Component {
...
@@ -423,6 +430,7 @@ class ShoppingCart extends React.Component {
// console.log(this.props)
// console.log(this.props)
// console.log(this.props.order_total)
// console.log(this.props.order_total)
// console.log(this.props.order_item.length)
// console.log(this.props.order_item.length)
console
.
log
(
this
.
props
.
value_voucher
)
return
(
return
(
<
ScrollView
style
=
{
styles
.
container
}
>
<
ScrollView
style
=
{
styles
.
container
}
>
<
View
style
=
{{
flexDirection
:
'row'
,
justifyContent
:
'center'
}}
>
<
View
style
=
{{
flexDirection
:
'row'
,
justifyContent
:
'center'
}}
>
...
...
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