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
e443f3d5
Commit
e443f3d5
authored
May 11, 2020
by
Trisno
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
ssh://repo.cs.co.id:2222/wahyu/bahanoprek
parents
87466357
58fe8ad6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
229 additions
and
704 deletions
+229
-704
app.json
app.json
+1
-1
package-lock.json
package-lock.json
+65
-679
package.json
package.json
+2
-1
globalActionType.js
redux/globalActionType.js
+3
-2
globalReducer.js
redux/globalReducer.js
+23
-1
Home.js
view/Home.js
+20
-1
Item.js
view/Item.js
+1
-1
RewardDetail.js
view/RewardDetail.js
+110
-16
ShoppingCart.js
view/ShoppingCart.js
+4
-0
TopUpInfo.js
view/TopUpInfo.js
+0
-2
No files found.
app.json
View file @
e443f3d5
{
{
"expo"
:
{
"expo"
:
{
"name"
:
"Excelso_update v1.
08
.05.2020"
,
"name"
:
"Excelso_update v1.
11
.05.2020"
,
"slug"
:
"excelso-pro"
,
"slug"
:
"excelso-pro"
,
"privacy"
:
"public"
,
"privacy"
:
"public"
,
"sdkVersion"
:
"36.0.0"
,
"sdkVersion"
:
"36.0.0"
,
...
...
package-lock.json
View file @
e443f3d5
This diff is collapsed.
Click to expand it.
package.json
View file @
e443f3d5
...
@@ -33,6 +33,7 @@
...
@@ -33,6 +33,7 @@
"
react
"
:
"~16.9.0"
,
"
react
"
:
"~16.9.0"
,
"
react-currency-format
"
:
"^1.0.0"
,
"
react-currency-format
"
:
"^1.0.0"
,
"
react-dom
"
:
"~16.9.0"
,
"
react-dom
"
:
"~16.9.0"
,
"
react-htmltext
"
:
"^0.40.2"
,
"
react-material-ui-form-validator
"
:
"^2.0.10"
,
"
react-material-ui-form-validator
"
:
"^2.0.10"
,
"
react-native
"
:
"
https://github.com/expo/react-native/archive/sdk-36.0.0.tar.gz
"
,
"
react-native
"
:
"
https://github.com/expo/react-native/archive/sdk-36.0.0.tar.gz
"
,
"
react-native-check-box
"
:
"^2.1.7"
,
"
react-native-check-box
"
:
"^2.1.7"
,
...
@@ -62,7 +63,7 @@
...
@@ -62,7 +63,7 @@
"
react-native-view-pager
"
:
"^0.2.3"
,
"
react-native-view-pager
"
:
"^0.2.3"
,
"
react-native-view-shot
"
:
"3.0.2"
,
"
react-native-view-shot
"
:
"3.0.2"
,
"
react-native-web
"
:
"~0.11.7"
,
"
react-native-web
"
:
"~0.11.7"
,
"
react-native-webview
"
:
"^
9.0.1
"
,
"
react-native-webview
"
:
"^
7.4.3
"
,
"
react-navigation
"
:
"^4.2.2"
,
"
react-navigation
"
:
"^4.2.2"
,
"
react-redux
"
:
"^7.2.0"
,
"
react-redux
"
:
"^7.2.0"
,
"
react-redux-i18n
"
:
"^1.9.3"
,
"
react-redux-i18n
"
:
"^1.9.3"
,
...
...
redux/globalActionType.js
View file @
e443f3d5
...
@@ -34,9 +34,10 @@ const ActionType = {
...
@@ -34,9 +34,10 @@ const ActionType = {
SET_ORDER_FINISH
:
'SET_ORDER_FINISH'
,
SET_ORDER_FINISH
:
'SET_ORDER_FINISH'
,
UPDATE_MENU
:
'UPDATE_MENU'
,
UPDATE_MENU
:
'UPDATE_MENU'
,
CHANGE_QUANTITY
:
'CHANGE_QUANTITY'
,
CHANGE_QUANTITY
:
'CHANGE_QUANTITY'
,
SET_CORDINAT
:
'SET_CORDINAT'
,
SET_TRANS_ID
:
'SET_TRANS_ID'
,
SET_TRANS_ID
:
'SET_TRANS_ID'
,
CHANGE_TO_CHART
:
'CHANGE_TO_CHART'
CHANGE_TO_CHART
:
'CHANGE_TO_CHART'
,
SET_VOUCHER
:
'SET_VOUCHER'
}
}
export
default
ActionType
;
export
default
ActionType
;
\ No newline at end of file
redux/globalReducer.js
View file @
e443f3d5
...
@@ -76,7 +76,13 @@ const globalState = {
...
@@ -76,7 +76,13 @@ const globalState = {
balanceUsed
:
''
,
balanceUsed
:
''
,
pointused
:
''
,
pointused
:
''
,
trans_id
:
''
trans_id
:
''
,
lat
:
''
,
long
:
''
,
voucher
:[],
value_voucher
:
''
}
}
...
@@ -234,6 +240,14 @@ const rootReducer = (state = globalState, action) => {
...
@@ -234,6 +240,14 @@ const rootReducer = (state = globalState, action) => {
selfie
:
false
selfie
:
false
}
}
}
}
case
ActionType
.
SET_VOUCHER
:
{
return
{
...
state
,
voucher
:
action
.
data
.
voucher
,
value_voucher
:
action
.
data
.
value_voucher
}
}
case
ActionType
.
SET_CHANGE_IMAGE_SELFI
:
{
case
ActionType
.
SET_CHANGE_IMAGE_SELFI
:
{
return
{
return
{
...
state
,
...
state
,
...
@@ -247,6 +261,14 @@ const rootReducer = (state = globalState, action) => {
...
@@ -247,6 +261,14 @@ const rootReducer = (state = globalState, action) => {
}
}
}
}
case
ActionType
.
SET_CORDINAT
:
{
return
{
...
state
,
lat
:
action
.
data
.
lat
,
long
:
action
.
data
.
long
}
}
case
ActionType
.
SET_CHANGE_OUTLET
:
{
case
ActionType
.
SET_CHANGE_OUTLET
:
{
return
{
return
{
...
state
,
...
state
,
...
...
view/Home.js
View file @
e443f3d5
...
@@ -34,6 +34,7 @@ class Home extends React.Component {
...
@@ -34,6 +34,7 @@ class Home extends React.Component {
this
.
_account
();
this
.
_account
();
this
.
_getPermissions
()
this
.
_getPermissions
()
this
.
_renderCarousell
()
this
.
_renderCarousell
()
console
.
log
(
"INI LAT : "
+
this
.
props
.
lat
)
this
.
_unsubscribe
=
this
.
props
.
navigation
.
addListener
(
'focus'
,
()
=>
{
this
.
_unsubscribe
=
this
.
props
.
navigation
.
addListener
(
'focus'
,
()
=>
{
this
.
setState
({
this
.
setState
({
...
@@ -72,11 +73,20 @@ class Home extends React.Component {
...
@@ -72,11 +73,20 @@ class Home extends React.Component {
let
latitude
=
location
.
coords
.
latitude
;
let
latitude
=
location
.
coords
.
latitude
;
let
longitude
=
location
.
coords
.
longitude
;
let
longitude
=
location
.
coords
.
longitude
;
this
.
setState
({
this
.
setState
({
my_lat
:
latitude
,
my_lat
:
latitude
,
my_long
:
longitude
my_long
:
longitude
})
})
let
cordinate
=
{
lat
:
this
.
state
.
my_lat
,
long
:
this
.
state
.
my_long
,
}
this
.
props
.
setCordinatProps
(
cordinate
);
this
.
_getOutletClosest
();
this
.
_getOutletClosest
();
}
}
...
@@ -284,7 +294,7 @@ class Home extends React.Component {
...
@@ -284,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
>
8
May
2019
<
/Text
>
<
Text
>
11
May
2019
<
/Text
>
<
View
style
=
{{
height
:
60
}}
><
/View
>
<
View
style
=
{{
height
:
60
}}
><
/View
>
<
/View
>
<
/View
>
<
/View
>
<
/View
>
...
@@ -385,6 +395,13 @@ const mapDispatchToProps = (dispacth) => {
...
@@ -385,6 +395,13 @@ const mapDispatchToProps = (dispacth) => {
}
}
}),
}),
setCordinatProps
:
(
cordinate
)
=>
dispacth
({
type
:
ActionType
.
SET_CORDINAT
,
data
:
{
lat
:
cordinate
.
lat
,
long
:
cordinate
.
long
,
}
}),
}
}
}
}
...
@@ -407,6 +424,8 @@ const mapStateToProps = (state) => {
...
@@ -407,6 +424,8 @@ const mapStateToProps = (state) => {
proses
:
state
.
proses
,
proses
:
state
.
proses
,
pageEmailConfirmation
:
state
.
pageEmailConfirmation
,
pageEmailConfirmation
:
state
.
pageEmailConfirmation
,
language
:
state
.
language
,
language
:
state
.
language
,
lat
:
state
.
lat
,
long
:
state
.
long
,
}
}
}
}
...
...
view/Item.js
View file @
e443f3d5
...
@@ -15,7 +15,7 @@ class Item extends React.Component {
...
@@ -15,7 +15,7 @@ class Item extends React.Component {
handleChangeQuantity
=
(
item
,
qty
)
=>
{
handleChangeQuantity
=
(
item
,
qty
)
=>
{
if
(
qty
==
''
)
{
if
(
qty
==
''
)
{
qty
=
0
item
.
qty
=
0
}
else
{
}
else
{
const
order_item
=
{
const
order_item
=
{
...
...
view/RewardDetail.js
View file @
e443f3d5
...
@@ -7,6 +7,8 @@ import Axios from 'axios';
...
@@ -7,6 +7,8 @@ import Axios from 'axios';
import
session
from
'../function/session'
;
import
session
from
'../function/session'
;
import
HTML
from
'react-native-render-html'
;
import
HTML
from
'react-native-render-html'
;
import
{
WebView
}
from
'react-native-webview'
;
import
{
WebView
}
from
'react-native-webview'
;
import
ActionType
from
'../redux/globalActionType'
;
import
moment
from
'moment'
;
class
RewardDetail
extends
React
.
Component
{
class
RewardDetail
extends
React
.
Component
{
constructor
(
props
)
{
constructor
(
props
)
{
...
@@ -15,8 +17,12 @@ class RewardDetail extends React.Component {
...
@@ -15,8 +17,12 @@ class RewardDetail extends React.Component {
image
:
''
,
image
:
''
,
title
:
''
,
title
:
''
,
subtitle
:
''
,
subtitle
:
''
,
deskripsi
:
""
,
content
:
""
,
expire
:
''
expire
:
''
,
code
:
''
,
used
:
''
,
dateNow
:
''
,
value
:
''
,
}
}
}
}
...
@@ -30,41 +36,111 @@ class RewardDetail extends React.Component {
...
@@ -30,41 +36,111 @@ class RewardDetail extends React.Component {
session_id
:
this
.
props
.
session_id
,
session_id
:
this
.
props
.
session_id
,
reward_id
:
this
.
props
.
route
.
params
.
rewardId
reward_id
:
this
.
props
.
route
.
params
.
rewardId
}
}
console
.
log
(
params
);
Axios
.
post
(
'https://excelsocrm.ravintoladev.com/crm/v2/reward/get_detail'
,
params
).
then
(
res
=>
{
Axios
.
post
(
'https://excelsocrm.ravintoladev.com/crm/v2/reward/get_detail'
,
params
).
then
(
res
=>
{
this
.
setState
({
this
.
setState
({
image
:
res
.
data
.
reward
.
reward
.
content_image
,
image
:
res
.
data
.
reward
.
reward
.
content_image
,
title
:
res
.
data
.
reward
.
reward
.
title
,
title
:
res
.
data
.
reward
.
reward
.
title
,
subtitle
:
res
.
data
.
reward
.
reward
.
subtitle
,
subtitle
:
res
.
data
.
reward
.
reward
.
subtitle
,
deskripsi
:
res
.
data
.
reward
.
reward
.
content
,
content
:
res
.
data
.
reward
.
reward
.
content
,
expire
:
res
.
data
.
reward
.
expire_time
,
expire
:
res
.
data
.
reward
.
expire_time
,
code
:
res
.
data
.
reward
.
verification_number
,
used
:
res
.
data
.
reward
.
used
,
value
:
res
.
data
.
reward
.
reward
.
value
,
})
})
// console.log("INI TITLE : " + JSON.stringify())
// console.log("INI SUBTITILE : " + JSON.stringify())
console
.
log
(
"INI IMAGE : "
+
JSON
.
stringify
())
let
date
=
new
Date
(
this
.
state
.
expire
);
// console.log("INI DESKRIPSI : " + JSON.stringify(res.data.reward.reward.subtitle))
let
year
=
date
.
getFullYear
();
let
month
=
date
.
getMonth
()
+
1
;
let
dt
=
date
.
getDate
();
if
(
dt
<
10
)
{
dt
=
'0'
+
dt
;
}
if
(
month
<
10
)
{
month
=
'0'
+
month
;
}
let
hasil
=
year
+
'-'
+
month
+
'-'
+
dt
;
this
.
setState
({
expire
:
hasil
,
})
})
})
}
}
useVoucher
()
{
let
params
=
{
session_id
:
this
.
props
.
session_id
,
reward_id
:
this
.
props
.
route
.
params
.
rewardId
,
lat
:
this
.
props
.
lat
,
long
:
this
.
props
.
long
}
Axios
.
post
(
'https://excelsocrm.ravintoladev.com/crm/v2/reward/use_reward'
,
params
).
then
(
res
=>
{
let
voucherProps
=
{
value_voucher
:
this
.
state
.
value
,
voucher
:
this
.
state
.
code
}
this
.
props
.
setVoucher
(
voucherProps
);
Alert
.
alert
(
''
,
res
.
data
.
message
,
[
{
text
:
'OK'
,
onPress
:
()
=>
this
.
props
.
navigation
.
navigate
(
'Home'
,
{
screen
:
'MENU'
})
}
]
)
}).
catch
(
error
=>
{
let
response
=
error
.
response
.
data
;
Alert
.
alert
(
''
,
response
.
msg
,
[
{
text
:
'OK'
}
]
)
})
}
useDVoucher
()
{
this
.
props
.
navigation
.
navigate
(
'Order Detail'
)
}
render
()
{
render
()
{
const
deskripsi
=
this
.
state
.
deskripsi
const
deskripsi
=
this
.
state
.
deskripsi
return
(
return
(
<
View
style
=
{
styles
.
container
}
>
<
View
style
=
{
styles
.
container
}
>
<
ScrollView
style
=
{
styles
.
body
}
>
<
ScrollView
style
=
{
styles
.
body
}
>
<
View
style
=
{
styles
.
body
}
>
<
View
style
=
{
styles
.
body
}
>
{
/* <View style={styles.images}> */
}
<
Image
style
=
{{
height
:
250
,
width
:
'100%'
}}
source
=
{
this
.
state
.
image
?
{
uri
:
this
.
state
.
image
}
:
null
}
/
>
<
Image
style
=
{{
height
:
250
,
width
:
'100%'
}}
source
=
{
this
.
state
.
image
?
{
uri
:
this
.
state
.
image
}
:
null
}
/
>
{
/* </View> */
}
<
View
style
=
{{
height
:
70
,
flex
:
1
,
backgroundColor
:
'#03989E'
,
top
:
-
60
,
marginRight
:
10
,
marginLeft
:
10
}}
>
<
View
style
=
{{
margin
:
20
}}
>
<
Text
style
=
{{
margin
:
5
}}
>
Voucher
code
:
<
/Text
>
<
HTML
html
=
{
this
.
state
.
deskripsi
}
/
>
<
Text
style
=
{{
fontSize
:
30
,
textAlign
:
'center'
,
fontWeight
:
'bold'
,
bottom
:
5
}}
>
{
this
.
state
.
code
}
<
/Text
>
<
/View
>
<
/View
>
<
View
style
=
{{
margin
:
10
}}
>
<
View
style
=
{{
height
:
70
,
flex
:
1
,
backgroundColor
:
'black'
,
top
:
-
70
,
marginRight
:
10
,
marginLeft
:
10
}}
>
<
Button
title
=
"Validate"
/>
<
Text
style
=
{{
margin
:
5
,
color
:
'white'
}}
>
Expired
Date
:
<
/Text
>
<
Text
style
=
{{
fontSize
:
30
,
textAlign
:
'center'
,
fontWeight
:
'bold'
,
bottom
:
5
,
color
:
'white'
}}
>
{
this
.
state
.
expire
}
<
/Text
>
<
/View
>
<
/View
>
<
/View
>
<
/View
>
<
View
style
=
{{
flex
:
1
,
top
:
-
60
,
margin
:
10
}}
>
{
this
.
state
.
used
==
0
?
(
<
Button
title
=
"USE VOUCHER"
onPress
=
{()
=>
this
.
useVoucher
()}
><
/Button
>
)
:
this
.
state
.
expire
>=
Date
.
now
()
?
(
<
Button
title
=
"EXPIRED"
><
/Button>
)
:
(
<
Button
title
=
"USED"
onPress
=
{()
=>
this
.
props
.
navigation
.
navigate
(
'Menu Select'
)()}
><
/Button>
)
}
<
HTML
html
=
{
this
.
state
.
title
}
/
>
<
HTML
html
=
{
this
.
state
.
content
}
/
>
<
/View
>
<
/ScrollView
>
<
/ScrollView
>
<
/View
>
<
/View
>
)
)
...
@@ -96,12 +172,30 @@ const styles = StyleSheet.create({
...
@@ -96,12 +172,30 @@ const styles = StyleSheet.create({
})
})
const
mapDispatchToProps
=
(
dispacth
)
=>
{
return
{
setVoucher
:
(
voucherProps
)
=>
dispacth
({
type
:
ActionType
.
SET_VOUCHER
,
data
:
{
voucher
:
voucherProps
.
voucher
,
value_voucher
:
voucherProps
.
value_voucher
,
}
}),
}
}
const
mapStateToProps
=
(
state
)
=>
{
const
mapStateToProps
=
(
state
)
=>
{
return
{
return
{
session_id
:
state
.
session_id
,
session_id
:
state
.
session_id
,
lat
:
state
.
lat
,
long
:
state
.
long
,
}
}
}
}
export
default
connect
(
mapStateToProps
)(
RewardDetail
);
export
default
connect
(
mapStateToProps
,
mapDispatchToProps
)(
RewardDetail
);
\ No newline at end of file
\ No newline at end of file
view/ShoppingCart.js
View file @
e443f3d5
...
@@ -43,6 +43,8 @@ class ShoppingCart extends React.Component {
...
@@ -43,6 +43,8 @@ class ShoppingCart extends React.Component {
componentDidMount
()
{
componentDidMount
()
{
console
.
log
(
'INI VOUCHER : '
+
this
.
props
.
voucher
)
console
.
log
(
'INI VALUE : '
+
this
.
props
.
value_voucher
)
if
(
!
this
.
props
.
type_pickup
)
{
if
(
!
this
.
props
.
type_pickup
)
{
this
.
getRate
()
this
.
getRate
()
}
}
...
@@ -854,6 +856,8 @@ const mapDispatchToProps = (dispacth) => {
...
@@ -854,6 +856,8 @@ const mapDispatchToProps = (dispacth) => {
const
mapStateToProps
=
(
state
)
=>
{
const
mapStateToProps
=
(
state
)
=>
{
return
{
return
{
type_pickup
:
state
.
type_pickup
,
type_pickup
:
state
.
type_pickup
,
value_voucher
:
state
.
value_voucher
,
voucher
:
state
.
voucher
,
session_id
:
state
.
session_id
,
session_id
:
state
.
session_id
,
outlet_id
:
state
.
outlet_id
,
outlet_id
:
state
.
outlet_id
,
name_outlet
:
state
.
name_outlet
,
name_outlet
:
state
.
name_outlet
,
...
...
view/TopUpInfo.js
View file @
e443f3d5
...
@@ -16,8 +16,6 @@ import Axios from 'axios';
...
@@ -16,8 +16,6 @@ import Axios from 'axios';
import
HTML
from
'react-native-render-html'
;
import
HTML
from
'react-native-render-html'
;
export
default
class
TopUpInfo
extends
React
.
Component
{
export
default
class
TopUpInfo
extends
React
.
Component
{
constructor
(
props
){
constructor
(
props
){
super
(
props
);
super
(
props
);
...
...
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