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
8b89561d
Commit
8b89561d
authored
May 12, 2020
by
Trisno
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
ssh://repo.cs.co.id:2222/wahyu/bahanoprek
parents
68fc5794
f5b33cc3
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
497 additions
and
22 deletions
+497
-22
app.json
app.json
+1
-1
Auth.js
view/Auth.js
+4
-12
Home.js
view/Home.js
+1
-1
Outlets.js
view/Outlets.js
+367
-0
RewardDetail.js
view/RewardDetail.js
+1
-1
RewardHistory.js
view/RewardHistory.js
+116
-0
RewardSelect.js
view/RewardSelect.js
+7
-7
No files found.
app.json
View file @
8b89561d
{
{
"expo"
:
{
"expo"
:
{
"name"
:
"Excelso_update v1.12.05.2020"
,
"name"
:
"Excelso_update v1.
Sore_
12.05.2020"
,
"slug"
:
"excelso-pro"
,
"slug"
:
"excelso-pro"
,
"privacy"
:
"public"
,
"privacy"
:
"public"
,
"sdkVersion"
:
"36.0.0"
,
"sdkVersion"
:
"36.0.0"
,
...
...
view/Auth.js
View file @
8b89561d
...
@@ -48,22 +48,12 @@ import OrderDetail from './OrderDetail';
...
@@ -48,22 +48,12 @@ import OrderDetail from './OrderDetail';
import
RewardsList
from
'./RewardsList'
;
import
RewardsList
from
'./RewardsList'
;
import
RewardDetail
from
'./RewardDetail'
;
import
RewardDetail
from
'./RewardDetail'
;
import
RewardSelect
from
'./RewardSelect'
;
import
RewardSelect
from
'./RewardSelect'
;
import
Outlets
from
'./Outlets'
;
import
RewardHistory
from
'./RewardHistory'
;
enableScreens
();
enableScreens
();
function
Outlets
()
{
return
(
<
View
style
=
{{
flex
:
1
,
justifyContent
:
'center'
,
alignItems
:
'center'
}}
>
<
Text
>
Outlets
!
<
/Text
>
<
/View
>
)
}
const
Tab
=
createBottomTabNavigator
();
const
Tab
=
createBottomTabNavigator
();
function
HomePage
({
navigation
})
{
function
HomePage
({
navigation
})
{
...
@@ -161,7 +151,9 @@ class Auth extends React.Component {
...
@@ -161,7 +151,9 @@ class Auth extends React.Component {
<
Stack
.
Screen
name
=
"Card Info"
component
=
{
CardInfo
}
/
>
<
Stack
.
Screen
name
=
"Card Info"
component
=
{
CardInfo
}
/
>
<
Stack
.
Screen
name
=
"Shopping Cart"
component
=
{
ShoppingCart
}
/
>
<
Stack
.
Screen
name
=
"Shopping Cart"
component
=
{
ShoppingCart
}
/
>
<
Stack
.
Screen
name
=
"Order History"
component
=
{
OrderHistory
}
/
>
<
Stack
.
Screen
name
=
"Order History"
component
=
{
OrderHistory
}
/
>
<
Stack
.
Screen
name
=
"Reward History"
component
=
{
RewardHistory
}
/
>
<
Stack
.
Screen
name
=
"Order Detail"
component
=
{
OrderDetail
}
options
=
{({
navigation
,
route
})
=>
({
headerLeft
:
props
=>
<
HeaderBackButton
{...
props
}
onPress
=
{()
=>
navigation
.
navigate
(
'Home'
,{
screen
:
'ORDER'
})}
/>
,
<
Stack
.
Screen
name
=
"Order Detail"
component
=
{
OrderDetail
}
options
=
{({
navigation
,
route
})
=>
({
headerLeft
:
props
=>
<
HeaderBackButton
{...
props
}
onPress
=
{()
=>
navigation
.
navigate
(
'Home'
,{
screen
:
'ORDER'
})}
/>
,
})}
/
>
})}
/
>
<
/
>
<
/
>
...
...
view/Home.js
View file @
8b89561d
...
@@ -294,7 +294,7 @@ class Home extends React.Component {
...
@@ -294,7 +294,7 @@ class Home extends React.Component {
<
TouchableOpacity
style
=
{
styles
.
submitUpgradePemium
}
activeOpacity
=
{.
5
}
onPress
=
{
this
.
onPress
}
>
<
TouchableOpacity
style
=
{
styles
.
submitUpgradePemium
}
activeOpacity
=
{.
5
}
onPress
=
{
this
.
onPress
}
>
<
Text
style
=
{{
textAlign
:
'center'
,
bottom
:
5
,
color
:
'white'
}}
>
TOP
BALANCE
<
/Text
>
<
Text
style
=
{{
textAlign
:
'center'
,
bottom
:
5
,
color
:
'white'
}}
>
TOP
BALANCE
<
/Text
>
<
/TouchableOpacity
>
<
/TouchableOpacity
>
<
Text
>
12
May
2019
<
/Text
>
<
Text
>
sore
12
May
2019
<
/Text
>
<
View
style
=
{{
height
:
60
}}
><
/View
>
<
View
style
=
{{
height
:
60
}}
><
/View
>
<
/View
>
<
/View
>
<
/View
>
<
/View
>
...
...
view/Outlets.js
View file @
8b89561d
This diff is collapsed.
Click to expand it.
view/RewardDetail.js
View file @
8b89561d
...
@@ -88,7 +88,7 @@ class RewardDetail extends React.Component {
...
@@ -88,7 +88,7 @@ class RewardDetail extends React.Component {
}
}
useDVoucher
()
{
useDVoucher
()
{
this
.
props
.
navigation
.
navigate
(
'
Order Detail
'
)
this
.
props
.
navigation
.
navigate
(
'
Reward History
'
)
}
}
...
...
view/RewardHistory.js
0 → 100644
View file @
8b89561d
import
React
from
'react'
;
import
{
View
,
Text
,
Image
,
StyleSheet
,
ScrollView
,
Alert
,
TouchableOpacity
}
from
'react-native'
;
import
{
Card
}
from
'react-native-shadow-cards'
import
{
connect
}
from
'react-redux'
;
import
Axios
from
'axios'
;
import
moment
from
'moment'
class
RewardHistory
extends
React
.
Component
{
constructor
(
props
)
{
super
(
props
)
this
.
state
=
{
rewardsList
:
[]
}
}
componentDidMount
()
{
this
.
getRewardsList
()
this
.
_unsubscribe
=
this
.
props
.
navigation
.
addListener
(
'focus'
,
()
=>
{
this
.
getRewardsList
()
});
}
componentWillUnmount
()
{
this
.
_unsubscribe
()
}
getRewardsList
()
{
let
params
=
{
session_id
:
this
.
props
.
session_id
}
Axios
.
post
(
'https://excelsocrm.ravintoladev.com/crm/v2/reward/history'
,
params
).
then
(
res
=>
{
let
data
=
res
.
data
.
rewards
// console.log(data)
data
.
map
((
item
,
key
)
=>
{
// console.log(item.expire_time)
item
.
expire_time
=
moment
(
item
.
expire_time
).
format
(
"DD MMMM YYYY"
)
item
.
used_time
=
moment
(
item
.
used_time
).
format
(
"DD MMMM YYYY"
)
})
// console.log(data)
this
.
setState
({
rewardsList
:
data
})
}).
catch
(
error
=>
{
let
response
=
error
.
response
.
data
;
Alert
.
alert
(
response
.
status
,
response
.
msg
);
})
}
render
()
{
return
(
<
View
style
=
{
styles
.
container
}
>
<
ScrollView
style
=
{
styles
.
body
}
>
{
this
.
state
.
rewardsList
.
map
((
item
,
key
)
=>
(
<
TouchableOpacity
key
=
{
key
}
onPress
=
{()
=>
this
.
props
.
navigation
.
navigate
(
'Reward Detail'
,
{
rewardId
:
item
.
id
})}
>
<
View
style
=
{{
alignItems
:
'center'
}}
>
<
Card
style
=
{{
padding
:
5
,
margin
:
10
}}
>
<
View
>
<
Image
source
=
{{
uri
:
item
.
reward
.
title_image
}}
resizeMethod
=
"resize"
resizeMode
=
'cover'
style
=
{{
height
:
150
,
width
:
'100%'
}}
/
>
<
/View
>
<
View
style
=
{{
flexDirection
:
'row'
,
justifyContent
:
'space-between'
,
padding
:
10
}}
>
<
View
>
<
Text
style
=
{{
fontWeight
:
'bold'
,
textAlign
:
'left'
}}
>
{
item
.
reward
.
title
}
<
/Text
>
<
Text
style
=
{{
textAlign
:
'left'
}}
>
{
item
.
reward
.
subtitle
}
<
/Text
>
<
/View
>
<
View
>
<
Text
style
=
{{
textAlign
:
'right'
}}
>
Digunakan
:
<
/Text
>
<
Text
style
=
{{
textAlign
:
'right'
}}
>
{
item
.
used_time
}
<
/Text
>
<
/View
>
<
/View
>
<
/Card
>
<
/View
>
<
/TouchableOpacity
>
))
}
<
/ScrollView
>
<
/View
>
)
}
}
const
styles
=
StyleSheet
.
create
({
container
:
{
flex
:
1
,
backgroundColor
:
'white'
,
},
header
:
{
flex
:
0.1
,
backgroundColor
:
'#ccb46c'
,
justifyContent
:
'center'
},
body
:
{
flex
:
3
,
},
list_detail_order
:
{
flex
:
1
,
margin
:
20
,
borderWidth
:
1
,
}
})
const
mapStateToProps
=
(
state
)
=>
{
return
{
session_id
:
state
.
session_id
,
}
}
export
default
connect
(
mapStateToProps
)(
RewardHistory
);
\ No newline at end of file
view/RewardSelect.js
View file @
8b89561d
...
@@ -96,17 +96,17 @@ class RewardSelect extends React.Component {
...
@@ -96,17 +96,17 @@ class RewardSelect extends React.Component {
<
View
>
<
View
>
<
Image
source
=
{{
uri
:
item
.
reward
.
title_image
}}
<
Image
source
=
{{
uri
:
item
.
reward
.
title_image
}}
resizeMethod
=
"resize"
resizeMethod
=
"resize"
resizeMode
=
'
cover
'
resizeMode
=
'
stretch
'
style
=
{{
height
:
150
,
width
:
'100%'
}}
/
>
style
=
{{
height
:
150
,
width
:
430
}}
/
>
<
/View
>
<
/View
>
<
View
style
=
{{
flexDirection
:
'row'
,
justifyContent
:
'space-between'
,
padding
:
10
}}
>
<
View
style
=
{{
flexDirection
:
'row'
,
justifyContent
:
'space-between'
,
padding
:
10
}}
>
<
View
>
<
View
>
<
Text
style
=
{{
fontWeight
:
'bold'
,
textAlign
:
'left'
}}
>
{
item
.
reward
.
title
}
<
/Text
>
<
Text
style
=
{{
fontWeight
:
'bold'
}}
>
{
item
.
reward
.
title
}
<
/Text
>
<
Text
style
=
{{
textAlign
:
'left'
}}
>
{
item
.
reward
.
subtitle
}
<
/Text
>
<
Text
>
{
item
.
reward
.
subtitle
}
<
/Text
>
<
/View
>
<
/View
>
<
View
>
<
View
>
<
Text
style
=
{{
textAlign
:
'right'
}}
>
Expired
<
/Text
>
<
Text
style
=
{{
textAlign
:
'right'
}}
>
Expired
<
/Text
>
<
Text
style
=
{{
textAlign
:
'right'
}}
>
{
item
.
expire_time
}
<
/Text
>
<
Text
style
=
{{
textAlign
:
'right'
}}
>
{
item
.
expire_time
}
<
/Text
>
<
/View
>
<
/View
>
<
/View
>
<
/View
>
<
/Card
>
<
/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