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
fe285e90
Commit
fe285e90
authored
Jun 24, 2020
by
Trisno
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
state component account info
parent
f2e78982
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
96 additions
and
43 deletions
+96
-43
Account.js
view/Account.js
+96
-43
No files found.
view/Account.js
View file @
fe285e90
...
...
@@ -46,6 +46,9 @@ class Account extends React.Component {
full_name
:
''
,
indicator
:
true
,
clickSettings
:
0
,
old_balance_claimed
:
false
,
old_balance
:
0
,
is_expired
:
false
}
}
...
...
@@ -103,6 +106,18 @@ class Account extends React.Component {
this
.
props
.
navigation
.
replace
(
'Login'
);
}
handleClaimCredit
()
{
let
params
=
{
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'
))
}).
catch
(
error
=>
{
let
response
=
error
.
response
.
data
Alert
.
alert
(
error
,
response
.
msg
)
})
}
_getProfile
()
{
let
params
=
{
session_id
:
this
.
props
.
session_id
,
...
...
@@ -114,6 +129,7 @@ class Account extends React.Component {
Axios
.
post
(
this
.
props
.
BASE_URL
+
'crm/v2/member/get_profile'
,
params
).
then
(
res
=>
{
const
dataCard
=
res
.
data
console
.
log
(
dataCard
)
let
email
=
dataCard
.
email
let
point
=
dataCard
.
kaspro_point
let
balance
=
dataCard
.
kaspro_balance
...
...
@@ -123,6 +139,9 @@ class Account extends React.Component {
let
premium
=
dataCard
.
kaspro_is_premium
let
kaspro
=
dataCard
.
kaspro_account_number
let
full_name
=
dataCard
.
name
let
old_balance_claimed
=
dataCard
.
old_balance_claimed
let
old_balance
=
dataCard
.
old_balance
let
is_expired
=
dataCard
.
is_expired
if
(
kaspro
===
""
)
{
...
...
@@ -152,7 +171,11 @@ class Account extends React.Component {
expire_date
:
expire
,
premium
:
premium
,
full_name
:
full_name
,
indicator
:
false
indicator
:
false
,
old_balance_claimed
:
old_balance_claimed
,
old_balance
:
old_balance
,
is_expired
:
is_expired
})
}).
catch
(
error
=>
{
...
...
@@ -265,13 +288,19 @@ class Account extends React.Component {
<
ActivityIndicator
style
=
{{
justifyContent
:
"center"
}}
size
=
"large"
color
=
"#c9af6d"
/>
<
/Card
>
)
:
(
<>
<
Card
style
=
{{
padding
:
20
,
alignContent
:
'center'
}}
>
<
View
style
=
{{
flexDirection
:
'row'
,
flex
:
1
,
paddingBottom
:
5
}}
>
<
View
style
=
{{
flex
:
0.5
}}
>
<
Text
style
=
{{
fontSize
:
10
,
fontFamily
:
'Gotham-Light'
}}
>
{
i18n
.
t
(
'cardnumber'
)}
<
/Text
>
<
/View
>
<
View
style
=
{{
flex
:
0.5
}}
>
{
this
.
state
.
is_expired
?
(
<
Text
style
=
{{
fontSize
:
10
,
textAlign
:
'right'
,
fontFamily
:
'Gotham-Light'
,
color
:
'#d34343'
}}
>
Expired
<
/Text
>
)
:
(
<
Text
style
=
{{
fontSize
:
10
,
textAlign
:
'right'
,
fontFamily
:
'Gotham-Light'
}}
>
{
i18n
.
t
(
'expired'
)}
{
this
.
state
.
expire_date
}
<
/Text
>
)
}
<
/View
>
<
/View
>
<
View
style
=
{{
paddingHorizontal
:
10
}}
>
...
...
@@ -301,7 +330,31 @@ class Account extends React.Component {
<
Text
style
=
{{
fontSize
:
14
,
fontFamily
:
'Gotham-Black'
,
color
:
'gray'
}}
>
IDR
{
this
.
state
.
points
}
<
/Text
>
<
/View
>
<
/View
>
{
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'
}}
>
<
Text
style
=
{{
fontFamily
:
'Gotham-Black'
,
color
:
'white'
,
fontSize
:
16
,
textAlign
:
'center'
,
margin
:
15
}}
>
RENEWAL
<
/Text
>
<
/View
>
<
/TouchableOpacity
>
)
:
null
}
<
/Card
>
{
this
.
state
.
old_balance_claimed
==
false
?
(
<
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
>
<
View
style
=
{{
justifyContent
:
'center'
}}
>
<
TouchableOpacity
onPress
=
{()
=>
this
.
handleClaimCredit
()}
>
<
View
style
=
{{
height
:
40
,
borderRadius
:
10
,
backgroundColor
:
'#CFB368'
,
marginRight
:
20
,
marginLeft
:
20
,
justifyContent
:
'center'
}}
>
<
Text
style
=
{{
fontFamily
:
'Gotham-Black'
,
color
:
'white'
,
fontSize
:
16
,
textAlign
:
'center'
,
margin
:
15
}}
>
CLAIM
CREDIT
<
/Text
>
<
/View
>
<
/TouchableOpacity
>
<
/View
>
<
/View
>
<
/Card>
)
:
(
null
)
}
<
/
>
)
}
<
/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