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
f2d56bfe
Commit
f2d56bfe
authored
May 12, 2020
by
Wahyu Adjie Prasetyo
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
ssh://repo.cs.co.id:2222/wahyu/bahanoprek
parents
a74daa9e
0f3a3559
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
16 deletions
+44
-16
RewardSelect.js
view/RewardSelect.js
+42
-14
RewardsList.js
view/RewardsList.js
+2
-2
No files found.
view/RewardSelect.js
View file @
f2d56bfe
...
...
@@ -4,12 +4,14 @@ import { Card } from 'react-native-shadow-cards'
import
{
connect
}
from
'react-redux'
;
import
Axios
from
'axios'
;
import
moment
from
'moment'
import
ActionType
from
'../redux/globalActionType'
;
class
RewardSelect
extends
React
.
Component
{
constructor
(
props
)
{
super
(
props
)
this
.
state
=
{
rewardsList
:
[]
rewardsList
:
[],
selectedReward
:
[]
}
}
...
...
@@ -25,12 +27,38 @@ class RewardSelect extends React.Component {
this
.
_unsubscribe
()
}
handleSelect
(
item
){
console
.
log
(
item
)
console
.
log
(
this
.
props
.
voucher
)
console
.
log
(
this
.
props
.
value_voucher
)
// useVoucher() {
// let voucherProps = {
// value_voucher: this.state.value,
// voucher: this.state.code
// }
// this.props.setVoucher(voucherProps);
// this.props.navigation.navigate('Home', { screen: 'MENU' })
// }
handleSelect
(
item
)
{
let
params
=
{
session_id
:
this
.
props
.
session_id
,
reward_id
:
item
.
id
}
Axios
.
post
(
'https://excelsocrm.ravintoladev.com/crm/v2/reward/get_detail'
,
params
).
then
(
res
=>
{
// console.log(res.data.reward)
let
detail
=
res
.
data
.
reward
.
reward
let
voucherProps
=
{
value_voucher
:
detail
,
voucher
:
detail
}
// console.log(voucherProps)
this
.
props
.
setVoucher
(
voucherProps
);
// this.props.navigation.navigate('Home', { screen: 'MENU' })
// console.log(this.props.voucher)
// console.log(this.props.value_voucher)
this
.
props
.
navigation
.
goBack
()
})
}
getRewardsList
()
{
let
params
=
{
session_id
:
this
.
props
.
session_id
...
...
@@ -38,7 +66,7 @@ class RewardSelect extends React.Component {
Axios
.
post
(
'https://excelsocrm.ravintoladev.com/crm/v2/reward/get_list'
,
params
).
then
(
res
=>
{
let
data
=
res
.
data
.
rewards
// console.log(data)
data
.
map
((
item
,
key
)
=>
{
data
.
map
((
item
,
key
)
=>
{
// console.log(item.expire_time)
item
.
expire_time
=
moment
(
item
.
expire_time
).
format
(
"DD MMMM YYYY"
)
})
...
...
@@ -67,18 +95,18 @@ class RewardSelect extends React.Component {
<
Card
style
=
{{
padding
:
5
,
margin
:
10
}}
>
<
View
>
<
Image
source
=
{{
uri
:
item
.
reward
.
title_image
}}
resizeMethod
=
"
scal
e"
resizeMethod
=
"
resiz
e"
resizeMode
=
'stretch'
style
=
{{
height
:
150
,
width
:
430
}}
/
>
<
/View
>
<
View
style
=
{{
flexDirection
:
'row'
,
justifyContent
:
'space-between'
,
padding
:
10
}}
>
<
View
style
=
{{
flexDirection
:
'row'
,
justifyContent
:
'space-between'
,
padding
:
10
}}
>
<
View
>
<
Text
>
{
item
.
reward
.
title
}
<
/Text
>
<
Text
style
=
{{
fontWeight
:
'bold'
}}
>
{
item
.
reward
.
title
}
<
/Text
>
<
Text
>
{
item
.
reward
.
subtitle
}
<
/Text
>
<
/View
>
<
View
>
<
Text
style
=
{{
textAlign
:
'right'
}}
>
Expired
<
/Text
>
<
Text
style
=
{{
textAlign
:
'right'
}}
>
{
item
.
expire_time
}
<
/Text
>
<
Text
style
=
{{
textAlign
:
'right'
}}
>
Expired
<
/Text
>
<
Text
style
=
{{
textAlign
:
'right'
}}
>
{
item
.
expire_time
}
<
/Text
>
<
/View
>
<
/View
>
<
/Card
>
...
...
@@ -142,4 +170,4 @@ const mapDispatchToProps = (dispacth) => {
}
export
default
connect
(
mapStateToProps
,
mapDispatchToProps
)(
RewardSelect
);
\ No newline at end of file
export
default
connect
(
mapStateToProps
,
mapDispatchToProps
)(
RewardSelect
);
\ No newline at end of file
view/RewardsList.js
View file @
f2d56bfe
...
...
@@ -61,13 +61,13 @@ class RewardsList extends React.Component {
<
Card
style
=
{{
padding
:
5
,
margin
:
10
}}
>
<
View
>
<
Image
source
=
{{
uri
:
item
.
reward
.
title_image
}}
resizeMethod
=
"
scal
e"
resizeMethod
=
"
resiz
e"
resizeMode
=
'stretch'
style
=
{{
height
:
150
,
width
:
430
}}
/
>
<
/View
>
<
View
style
=
{{
flexDirection
:
'row'
,
justifyContent
:
'space-between'
,
padding
:
10
}}
>
<
View
>
<
Text
>
{
item
.
reward
.
title
}
<
/Text
>
<
Text
style
=
{{
fontWeight
:
'bold'
}}
>
{
item
.
reward
.
title
}
<
/Text
>
<
Text
>
{
item
.
reward
.
subtitle
}
<
/Text
>
<
/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