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
6755d13a
Commit
6755d13a
authored
May 20, 2020
by
Trisno
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tampilkan 'No E-Voucher Available' ketika tidak ada voucher
parent
ff3f6147
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
25 deletions
+31
-25
RewardSelect.js
view/RewardSelect.js
+1
-1
RewardsList.js
view/RewardsList.js
+30
-24
No files found.
view/RewardSelect.js
View file @
6755d13a
...
@@ -116,7 +116,7 @@ class RewardSelect extends React.Component {
...
@@ -116,7 +116,7 @@ class RewardSelect extends React.Component {
))
))
)
:
(
)
:
(
<
View
style
=
{{
justifyContent
:
'center'
,
alignItems
:
'center'
,
height
:
100
}}
>
<
View
style
=
{{
justifyContent
:
'center'
,
alignItems
:
'center'
,
height
:
100
}}
>
<
Text
style
=
{{
textAlign
:
'left'
,
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
}}
>
No
data
<
/Text
>
<
Text
style
=
{{
textAlign
:
'left'
,
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
,
color
:
'grey'
}}
>
No
E
-
Voucher
Available
<
/Text
>
<
/View
>
<
/View
>
)
)
}
}
...
...
view/RewardsList.js
View file @
6755d13a
...
@@ -32,9 +32,9 @@ class RewardsList extends React.Component {
...
@@ -32,9 +32,9 @@ class RewardsList extends React.Component {
Axios
.
post
(
'https://excelsocrm.ravintoladev.com/crm/v2/reward/get_list'
,
params
).
then
(
res
=>
{
Axios
.
post
(
'https://excelsocrm.ravintoladev.com/crm/v2/reward/get_list'
,
params
).
then
(
res
=>
{
let
data
=
res
.
data
.
rewards
let
data
=
res
.
data
.
rewards
// console.log(data)
// console.log(data)
data
.
map
((
item
,
key
)
=>
{
data
.
map
((
item
,
key
)
=>
{
// console.log(item.expire_time)
// console.log(item.expire_time)
item
.
expire_time
=
moment
(
item
.
expire_time
).
format
(
"DD MMMM YYYY"
)
item
.
expire_time
=
moment
(
item
.
expire_time
).
format
(
"DD MMMM YYYY"
)
})
})
// console.log(data)
// console.log(data)
this
.
setState
({
this
.
setState
({
...
@@ -55,35 +55,41 @@ class RewardsList extends React.Component {
...
@@ -55,35 +55,41 @@ class RewardsList extends React.Component {
<
/View
>
<
/View
>
<
ScrollView
style
=
{
styles
.
body
}
>
<
ScrollView
style
=
{
styles
.
body
}
>
{
{
this
.
state
.
rewardsList
.
map
((
item
,
key
)
=>
(
this
.
state
.
rewardsList
.
length
?
(
<
TouchableOpacity
key
=
{
key
}
onPress
=
{()
=>
this
.
props
.
navigation
.
navigate
(
'Reward Detail'
,
{
rewardId
:
item
.
id
})}
>
this
.
state
.
rewardsList
.
map
((
item
,
key
)
=>
(
<
View
style
=
{{
alignItems
:
'center'
}}
>
<
TouchableOpacity
key
=
{
key
}
onPress
=
{()
=>
this
.
props
.
navigation
.
navigate
(
'Reward Detail'
,
{
rewardId
:
item
.
id
})}
>
<
Card
style
=
{{
padding
:
5
,
margin
:
10
}}
>
<
View
style
=
{{
alignItems
:
'center'
}}
>
<
View
>
<
Card
style
=
{{
padding
:
5
,
margin
:
10
}}
>
<
Image
source
=
{{
uri
:
item
.
reward
.
title_image
}}
resizeMethod
=
"resize"
resizeMode
=
'cover'
style
=
{{
height
:
100
,
width
:
'100%'
}}
/
>
<
/View
>
<
View
style
=
{{
flexDirection
:
'row'
,
justifyContent
:
'space-between'
,
padding
:
10
}}
>
<
View
>
<
View
>
<
Text
style
=
{{
textAlign
:
'left'
,
fontSize
:
12
,
fontFamily
:
'Gotham-Black'
}}
>
{
item
.
reward
.
title
}
<
/Text
>
<
Image
source
=
{{
uri
:
item
.
reward
.
title_image
}}
<
Text
style
=
{{
textAlign
:
'left'
,
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
}}
>
{
item
.
reward
.
subtitle
}
<
/Text
>
resizeMethod
=
"resize"
resizeMode
=
'cover'
style
=
{{
height
:
100
,
width
:
'100%'
}}
/
>
<
/View
>
<
/View
>
<
View
>
<
View
style
=
{{
flexDirection
:
'row'
,
justifyContent
:
'space-between'
,
padding
:
10
}}
>
<
Text
style
=
{{
textAlign
:
'right'
,
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
}}
>
Expired
<
/Text
>
<
View
>
<
Text
style
=
{{
textAlign
:
'right'
,
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
}}
>
{
item
.
expire_time
}
<
/Text
>
<
Text
style
=
{{
textAlign
:
'left'
,
fontSize
:
12
,
fontFamily
:
'Gotham-Black'
}}
>
{
item
.
reward
.
title
}
<
/Text
>
<
Text
style
=
{{
textAlign
:
'left'
,
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
}}
>
{
item
.
reward
.
subtitle
}
<
/Text
>
<
/View
>
<
View
>
<
Text
style
=
{{
textAlign
:
'right'
,
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
}}
>
Expired
<
/Text
>
<
Text
style
=
{{
textAlign
:
'right'
,
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
}}
>
{
item
.
expire_time
}
<
/Text
>
<
/View
>
<
/View
>
<
/View
>
<
/View
>
<
/Card
>
<
/Card
>
<
/View
>
<
/TouchableOpacity
>
))
)
:
(
<
View
style
=
{{
justifyContent
:
'center'
,
alignItems
:
'center'
,
height
:
100
}}
>
<
Text
style
=
{{
textAlign
:
'left'
,
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
,
color
:
'grey'
}}
>
No
E
-
Voucher
Available
<
/Text
>
<
/View
>
<
/View
>
<
/TouchableOpacity
>
)
))
}
}
<
TouchableOpacity
onPress
=
{()
=>
this
.
props
.
navigation
.
navigate
(
'Reward History'
)}
>
<
TouchableOpacity
onPress
=
{()
=>
this
.
props
.
navigation
.
navigate
(
'Reward History'
)}
>
<
Text
style
=
{{
textAlign
:
'center'
,
color
:
'#CFB368'
,
fontSize
:
12
,
fontFamily
:
'Gotham-Black'
}}
>
REDEEM
E
-
VOUCHER
HISTORY
<
/Text
>
<
Text
style
=
{{
textAlign
:
'center'
,
color
:
'#CFB368'
,
fontSize
:
12
,
fontFamily
:
'Gotham-Black'
}}
>
REDEEM
E
-
VOUCHER
HISTORY
<
/Text
>
<
/TouchableOpacity
>
<
/TouchableOpacity
>
<
View
style
=
{{
height
:
15
}}
/
>
<
View
style
=
{{
height
:
15
}}
/
>
<
/ScrollView
>
<
/ScrollView
>
<
/View
>
<
/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