Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
N
new_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
new_excelso
Commits
85453be2
Commit
85453be2
authored
Sep 02, 2020
by
Wahyu Adjie Prasetyo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
benerin logic renewal kalau saldo < biaya renewal maka tombol hilang
parent
5049a174
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
10 deletions
+18
-10
Renewal.js
view/Renewal.js
+18
-10
No files found.
view/Renewal.js
View file @
85453be2
...
...
@@ -16,11 +16,11 @@ class Renewal extends React.Component {
current_balance
:
""
,
expired
:
""
,
card_number
:
""
,
biaya_renewal
:
"100.000"
,
renew_until
:
""
,
indicator
:
true
,
spinner
:
false
,
renew_button
:
false
hide_renew_button
:
false
,
renewal_cost
:
0
}
}
...
...
@@ -93,26 +93,34 @@ class Renewal extends React.Component {
let
balance
=
dataCard
.
kaspro_balance
let
expired
=
dataCard
.
expire_date
let
renew
=
dataCard
.
renew_until
let
renewal_cost
=
dataCard
.
renewal_cost
// cek apakah saldo sama dengan 0
if
(
balance
==
0
)
{
//kalau saldo sama dengan 0 disable renew button = true
let
balance_replace
=
balance
.
replace
(
','
,
''
)
this
.
setState
({
renewal_cost
:
renewal_cost
})
// cek apakah saldo kurang dari renewal_cost
if
(
balance_replace
<
this
.
state
.
renewal_cost
)
{
//kalau saldo sama kurang dari renewal cost disable renew button = true
this
.
setState
({
current_balance
:
balance
,
expired
:
expired
,
renew_until
:
renew
,
indicator
:
false
,
renew_button
:
true
hide_
renew_button
:
true
})
}
else
{
// kalau tidak renew button = false
// kalau tidak
hide
renew button = false
this
.
setState
({
current_balance
:
balance
,
expired
:
expired
,
renew_until
:
renew
,
indicator
:
false
,
renew_button
:
false
hide_
renew_button
:
false
})
}
}).
catch
(
error
=>
{
...
...
@@ -165,7 +173,7 @@ class Renewal extends React.Component {
<
Text
style
=
{{
textAlign
:
'center'
,
fontSize
:
12
,
fontFamily
:
'Gotham-Black'
,
color
:
'#CFB368'
}}
>
{
i18n
.
t
(
'renewalfees'
)}
<
/Text
>
<
/View
>
<
View
style
=
{
styles
.
value_current_balance
}
>
<
Text
style
=
{{
textAlign
:
'center'
,
fontSize
:
12
,
fontFamily
:
'Gotham-Black'
,
color
:
'gray'
}}
>
IDR
{
this
.
state
.
biaya_renewal
}
<
/Text
>
<
Text
style
=
{{
textAlign
:
'center'
,
fontSize
:
12
,
fontFamily
:
'Gotham-Black'
,
color
:
'gray'
}}
>
IDR
{
this
.
state
.
renewal_cost
}
<
/Text
>
<
/View
>
<
/View
>
<
View
style
=
{
styles
.
cont_curent_balance
}
>
...
...
@@ -190,7 +198,7 @@ class Renewal extends React.Component {
</View> */
}
{
/* cek tombol berdasarkan state renew_button */
}
{
this
.
state
.
renew_button
==
true
?
(
null
)
:
<
TouchableOpacity
onPress
=
{()
=>
this
.
_handleRenewal
()}
>
{
this
.
state
.
hide_
renew_button
==
true
?
(
null
)
:
<
TouchableOpacity
onPress
=
{()
=>
this
.
_handleRenewal
()}
>
<
View
style
=
{
styles
.
button
}
>
<
Text
style
=
{{
color
:
'white'
,
fontSize
:
16
,
textAlign
:
'center'
,
fontFamily
:
'Gotham-Black'
}}
>
{
i18n
.
t
(
'renew'
)}
<
/Text
>
<
/View
>
...
...
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