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
887cbbe4
Commit
887cbbe4
authored
Jun 26, 2020
by
Trisno
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update state component
parent
a32e5c35
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
24 deletions
+48
-24
Account.js
view/Account.js
+48
-24
No files found.
view/Account.js
View file @
887cbbe4
...
...
@@ -50,7 +50,7 @@ class Account extends React.Component {
old_balance_claimed
:
false
,
old_balance
:
0
,
is_expired
:
false
,
card_number
:
""
,
card_number
:
""
,
}
}
...
...
@@ -131,7 +131,9 @@ class Account extends React.Component {
session_id
:
this
.
props
.
session_id
}
Axios
.
post
(
this
.
props
.
BASE_URL
+
'crm/v2/card/claim_old_balance'
,
params
).
then
(
res
=>
{
Alert
.
alert
(
i18n
.
t
(
'success'
),
i18n
.
t
(
'alertclaimcredit'
))
// Alert.alert(i18n.t('success'), i18n.t('alertclaimcredit'))
Toast
.
show
(
i18n
.
t
(
'alertclaimcredit'
))
this
.
_getProfile
()
}).
catch
(
error
=>
{
let
response
=
error
.
response
.
data
Alert
.
alert
(
error
,
response
.
msg
)
...
...
@@ -148,7 +150,7 @@ class Account extends React.Component {
}
Axios
.
post
(
this
.
props
.
BASE_URL
+
'crm/v2/member/get_profile'
,
params
).
then
(
res
=>
{
console
.
log
(
"INI DATANYA : "
+
JSON
.
stringify
(
res
))
console
.
log
(
"INI DATANYA : "
+
JSON
.
stringify
(
res
))
const
dataCard
=
res
.
data
console
.
log
(
dataCard
)
let
email
=
dataCard
.
email
...
...
@@ -165,6 +167,7 @@ class Account extends React.Component {
let
is_expired
=
dataCard
.
is_expired
let
card_number
=
dataCard
.
card_number
if
(
kaspro
===
""
)
{
let
cardProps
=
{
...
...
@@ -183,28 +186,49 @@ class Account extends React.Component {
let
account_number
=
dataCard
.
card_number
let
setCardNumberProps
=
{
card_number
:
account_number
card_number
:
account_number
}
this
.
props
.
setCardNumber
(
setCardNumberProps
)
this
.
setState
({
email
:
email
,
points
:
point
,
img_card
:
img_card
,
member_since
:
member_since
,
balance
:
balance
,
account_number
:
account_number
,
img_card
:
img_card
,
expire_date
:
expire
,
premium
:
premium
,
full_name
:
full_name
,
indicator
:
false
,
old_balance_claimed
:
old_balance_claimed
,
old_balance
:
old_balance
,
is_expired
:
is_expired
,
card_number
:
card_number
})
if
(
old_balance
==
0
)
{
this
.
setState
({
email
:
email
,
points
:
point
,
img_card
:
img_card
,
member_since
:
member_since
,
balance
:
balance
,
account_number
:
account_number
,
img_card
:
img_card
,
expire_date
:
expire
,
premium
:
premium
,
full_name
:
full_name
,
indicator
:
false
,
old_balance_claimed
:
true
,
old_balance
:
old_balance
,
is_expired
:
is_expired
,
card_number
:
card_number
})
}
else
{
this
.
setState
({
email
:
email
,
points
:
point
,
img_card
:
img_card
,
member_since
:
member_since
,
balance
:
balance
,
account_number
:
account_number
,
img_card
:
img_card
,
expire_date
:
expire
,
premium
:
premium
,
full_name
:
full_name
,
indicator
:
false
,
old_balance_claimed
:
old_balance_claimed
,
old_balance
:
old_balance
,
is_expired
:
is_expired
,
card_number
:
card_number
})
}
}).
catch
(
error
=>
{
// const { navigation } = this.props
...
...
@@ -361,7 +385,7 @@ class Account extends React.Component {
{
this
.
state
.
is_expired
?
(
<
TouchableOpacity
onPress
=
{()
=>
this
.
props
.
navigation
.
navigate
(
'Renewal'
)}
>
<
View
style
=
{{
height
:
40
,
borderRadius
:
10
,
backgroundColor
:
'#CFB368'
,
marginRight
:
20
,
marginLeft
:
20
,
marginTop
:
20
,
justifyContent
:
'center'
}}
>
<
View
style
=
{{
height
:
40
,
borderRadius
:
10
,
backgroundColor
:
'#CFB368'
,
marginRight
:
20
,
marginLeft
:
20
,
marginTop
:
20
,
justifyContent
:
'center'
}}
>
<
Text
style
=
{{
fontFamily
:
'Gotham-Black'
,
color
:
'white'
,
fontSize
:
16
,
textAlign
:
'center'
,
margin
:
15
}}
>
RENEWAL
<
/Text
>
<
/View
>
<
/TouchableOpacity
>
...
...
@@ -372,7 +396,7 @@ class Account extends React.Component {
<
Card
style
=
{{
padding
:
10
,
margin
:
10
,
alignContent
:
'center'
}}
>
<
View
style
=
{{
flex
:
1
,
height
:
80
,
borderRadius
:
20
,
marginRight
:
10
,
marginLeft
:
10
,
justifyContent
:
'center'
}}
>
{
/* <Text style={{ fontSize: 14, fontFamily: 'Gotham-Light', textAlign: 'center', marginBottom: 10 }}>CREDIT : {this.state.old_balance} </Text> */
}
<
NumberFormat
decimalScale
=
{
0
}
value
=
{
this
.
state
.
old_balance
}
renderText
=
{
value
=>
<
Text
style
=
{{
fontSize
:
14
,
fontFamily
:
'Gotham-Light'
,
textAlign
:
'center'
,
marginBottom
:
10
,
color
:
'#838383'
}}
>
CREDIT
:
Rp
.
{
value
}
<
/Text>} displayType={'text'} thousandSeparator={true} prefix={''} /
>
<
NumberFormat
decimalScale
=
{
0
}
value
=
{
this
.
state
.
old_balance
}
renderText
=
{
value
=>
<
Text
style
=
{{
fontSize
:
14
,
fontFamily
:
'Gotham-Light'
,
textAlign
:
'center'
,
marginBottom
:
10
,
color
:
'#838383'
}}
>
CREDIT
:
Rp
.
{
value
}
<
/Text>} displayType={'text'} thousandSeparator={true} prefix={''} /
>
<
View
style
=
{{
justifyContent
:
'center'
}}
>
<
TouchableOpacity
onPress
=
{()
=>
this
.
onClickClaimCredit
()}
>
<
View
style
=
{{
height
:
40
,
borderRadius
:
10
,
backgroundColor
:
'#CFB368'
,
marginRight
:
20
,
marginLeft
:
20
,
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