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
e1aaba3a
Commit
e1aaba3a
authored
Aug 21, 2020
by
William Goszal
🚴
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
buat user gak bisa klik tombol claim balance saat sudah diklik
parent
480476cb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
6 deletions
+25
-6
Home.js
view/Home.js
+25
-6
No files found.
view/Home.js
View file @
e1aaba3a
...
@@ -16,6 +16,7 @@ import session from '../function/session';
...
@@ -16,6 +16,7 @@ import session from '../function/session';
import
requestParams
from
'../helper/requestParams'
;
import
requestParams
from
'../helper/requestParams'
;
import
ActionType
from
'../redux/globalActionType'
;
import
ActionType
from
'../redux/globalActionType'
;
import
CustomIosStatusBar
from
'./CustomIosStatusBar'
;
import
CustomIosStatusBar
from
'./CustomIosStatusBar'
;
import
Spinner
from
'react-native-loading-spinner-overlay'
;
class
Home
extends
React
.
Component
{
class
Home
extends
React
.
Component
{
...
@@ -25,6 +26,7 @@ class Home extends React.Component {
...
@@ -25,6 +26,7 @@ class Home extends React.Component {
super
(
props
);
super
(
props
);
this
.
state
=
{
this
.
state
=
{
spinner
:
false
,
data_baner
:
[],
data_baner
:
[],
images
:
[],
images
:
[],
point
:
""
,
point
:
""
,
...
@@ -42,12 +44,15 @@ class Home extends React.Component {
...
@@ -42,12 +44,15 @@ class Home extends React.Component {
member_since
:
""
,
member_since
:
""
,
old_balance
:
0
,
old_balance
:
0
,
expired
:
''
,
expired
:
''
,
card_number
:
''
card_number
:
''
}
}
}
}
componentDidMount
()
{
componentDidMount
()
{
this
.
loadAll
()
}
loadAll
(){
this
.
CheckInbox
()
this
.
CheckInbox
()
const
screenWidth
=
Math
.
round
(
Dimensions
.
get
(
'window'
).
width
);
const
screenWidth
=
Math
.
round
(
Dimensions
.
get
(
'window'
).
width
);
...
@@ -186,6 +191,7 @@ class Home extends React.Component {
...
@@ -186,6 +191,7 @@ class Home extends React.Component {
let
params
=
Object
.
assign
(
requestParams
,
{
let
params
=
Object
.
assign
(
requestParams
,
{
session_id
:
this
.
props
.
session_id
,
session_id
:
this
.
props
.
session_id
,
})
})
this
.
setState
({
indicatorProfileCard
:
true
})
Axios
.
post
(
this
.
props
.
BASE_URL
+
'crm/v2/member/get_profile'
,
params
).
then
(
res
=>
{
Axios
.
post
(
this
.
props
.
BASE_URL
+
'crm/v2/member/get_profile'
,
params
).
then
(
res
=>
{
const
dataCard
=
res
.
data
const
dataCard
=
res
.
data
...
@@ -296,12 +302,16 @@ class Home extends React.Component {
...
@@ -296,12 +302,16 @@ class Home extends React.Component {
let
params
=
Object
.
assign
(
requestParams
,
{
let
params
=
Object
.
assign
(
requestParams
,
{
session_id
:
this
.
props
.
session_id
,
session_id
:
this
.
props
.
session_id
,
})
})
Axios
.
post
(
this
.
props
.
BASE_URL
+
'crm/v2/card/claim_old_balance'
,
params
).
then
(
res
=>
{
Axios
.
post
(
this
.
props
.
BASE_URL
+
'crm/v2/card/claim_old_balance'
,
params
).
then
(
res
=>
{
Alert
.
alert
(
i18n
.
t
(
'success'
),
i18n
.
t
(
'alertclaimcredit'
))
this
.
setState
({
spinner
:
false
})
this
.
componentDidMount
()
this
.
_account
()
Alert
.
alert
(
i18n
.
t
(
'success'
),
i18n
.
t
(
'alertclaimcredit'
))
}).
catch
(
error
=>
{
}).
catch
(
error
=>
{
let
response
=
error
.
response
.
data
this
.
setState
({
spinner
:
false
})
Alert
.
alert
(
error
,
response
.
msg
)
this
.
_account
()
let
response
=
error
.
response
.
data
Alert
.
alert
(
error
,
response
.
msg
)
})
})
}
}
...
@@ -316,7 +326,12 @@ class Home extends React.Component {
...
@@ -316,7 +326,12 @@ class Home extends React.Component {
style
:
'cancel'
,
style
:
'cancel'
,
},
},
{
{
text
:
i18n
.
t
(
'alertyes'
),
onPress
:
()
=>
this
.
handleClaimCredit
()
text
:
i18n
.
t
(
'alertyes'
),
onPress
:
()
=>
{
this
.
setState
({
spinner
:
true
})
this
.
setState
({
old_balance_claimed
:
true
})
/** set jadi true dulu buat hilangkan bagian claim credit */
this
.
setState
({
indicatorProfileCard
:
true
})
/** atau sekalian dibuat loading aja bagian profilecardnya */
this
.
handleClaimCredit
()
}
},
},
],
],
{
cancelable
:
false
},
{
cancelable
:
false
},
...
@@ -333,6 +348,8 @@ class Home extends React.Component {
...
@@ -333,6 +348,8 @@ class Home extends React.Component {
return
(
return
(
<
View
style
=
{
styles
.
container
}
>
<
View
style
=
{
styles
.
container
}
>
<
Spinner
visible
=
{
this
.
state
.
spinner
}
textContent
=
{
'Loading...'
}
textStyle
=
{{
color
:
"white"
}}
/
>
{
Platform
.
OS
===
'ios'
?
(
{
Platform
.
OS
===
'ios'
?
(
<
CustomIosStatusBar
color
=
'#CFB368'
/>
<
CustomIosStatusBar
color
=
'#CFB368'
/>
)
:
(
)
:
(
...
@@ -481,6 +498,7 @@ class Home extends React.Component {
...
@@ -481,6 +498,7 @@ class Home extends React.Component {
<
/Card
>
<
/Card
>
)
)
}
}
{
{
this
.
state
.
indicatorProfileCard
==
true
?
(
this
.
state
.
indicatorProfileCard
==
true
?
(
<
View
style
=
{
styles
.
card
}
>
<
View
style
=
{
styles
.
card
}
>
...
@@ -489,6 +507,7 @@ class Home extends React.Component {
...
@@ -489,6 +507,7 @@ class Home extends React.Component {
<
/Card
>
<
/Card
>
<
/View
>
<
/View
>
)
:
)
:
//jika member belum punya account kaspro
//jika member belum punya account kaspro
this
.
state
.
account_number
==
""
?
(
this
.
state
.
account_number
==
""
?
(
<
View
style
=
{
styles
.
card
}
>
<
View
style
=
{
styles
.
card
}
>
...
...
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