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
85bedb85
Commit
85bedb85
authored
Jun 03, 2020
by
Wahyu Adjie Prasetyo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
backhandler
parent
9117ecfc
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
22 deletions
+26
-22
Auth.js
view/Auth.js
+3
-2
PaymentCode.js
view/PaymentCode.js
+9
-7
RedeemCode.js
view/RedeemCode.js
+11
-11
UseBalance.js
view/UseBalance.js
+3
-2
No files found.
view/Auth.js
View file @
85bedb85
...
...
@@ -464,7 +464,8 @@ class Auth extends React.Component {
fontSize
:
20
,
color
:
'white'
,
textAlign
:
'center'
},
title
:
'PAYMENT CODE'
},
title
:
'PAYMENT CODE'
,
headerLeft
:
props
=>
<
HeaderBackButton
{...
props
}
onPress
=
{()
=>
navigation
.
navigate
(
'Home'
,
{
screen
:
'ORDER'
})}
/
>
}}
/
>
...
...
@@ -534,7 +535,7 @@ class Auth extends React.Component {
color
:
'white'
,
fontSize
:
20
,
},
title
:
'REDEEM CODE'
title
:
'REDEEM CODE'
,
}}
/
>
<
Stack
.
Screen
name
=
"Transaction History"
component
=
{
TransactionHistory
}
options
=
{{
...
...
view/PaymentCode.js
View file @
85bedb85
import
React
from
'react'
;
import
{
View
,
Text
,
TextInput
,
StyleSheet
,
Button
,
Alert
,
TouchableOpacity
,
Image
}
from
'react-native'
;
import
{
View
,
Text
,
TextInput
,
StyleSheet
,
Button
,
Alert
,
TouchableOpacity
,
Image
,
BackHandler
}
from
'react-native'
;
import
{
connect
}
from
'react-redux'
;
import
Axios
from
'axios'
;
import
ActionType
from
'../redux/globalActionType'
;
import
Spinner
from
'react-native-loading-spinner-overlay'
;
class
PaymentCode
extends
React
.
Component
{
constructor
(
props
)
{
super
(
props
);
this
.
handleBackButtonClick
=
this
.
handleBackButtonClick
.
bind
(
this
)
this
.
state
=
{
current_balance
:
''
,
kaspro_point
:
''
,
...
...
@@ -19,15 +19,17 @@ class PaymentCode extends React.Component {
componentDidMount
()
{
"INI YAAAAAAAAAAAAAAAAASSSS"
this
.
_getProfile
()
}
_getProfile
()
{
let
params
=
{
session_id
:
this
.
props
.
session_id
}
Axios
.
post
(
'https://excelsocrm.ravintoladev.com/crm/v2/member/get_profile'
,
params
).
then
(
res
=>
{
console
.
log
(
'
ini res
'
+
JSON
.
stringify
(
res
.
data
))
console
.
log
(
'
INI RESPONNYA :
'
+
JSON
.
stringify
(
res
.
data
))
const
dataCard
=
res
.
data
let
balance
=
dataCard
.
kaspro_balance
...
...
@@ -61,7 +63,7 @@ class PaymentCode extends React.Component {
}
Axios
.
post
(
'http://excelsocrm.ravintoladev.com/crm/v2/point/redeem'
,
params
).
then
(
res
=>
{
Alert
.
alert
(
''
,
'Sukses Redeem'
)
Alert
.
alert
(
''
,
'Sukses Redeem'
)
}).
catch
(
error
=>
{
let
response
=
error
.
response
.
data
;
Alert
.
alert
(
response
.
msg
);
...
...
@@ -76,8 +78,8 @@ class PaymentCode extends React.Component {
<
View
style
=
{
styles
.
container
}
>
<
View
style
=
{{
flex
:
3
}}
>
<
View
style
=
{{
flex
:
1
,
marginRight
:
30
,
marginLeft
:
30
,
top
:
50
}}
>
<
View
style
=
{{
height
:
150
,
justifyContent
:
'center'
,
alignContent
:
'center'
}}
>
<
View
style
=
{{
borderColor
:
'#838383'
,
height
:
1
,
borderWidth
:
1
,
marginLeft
:
20
,
marginRight
:
20
}}
><
/View
>
<
View
style
=
{{
height
:
150
,
justifyContent
:
'center'
,
alignContent
:
'center'
}}
>
<
View
style
=
{{
borderColor
:
'#838383'
,
height
:
1
,
borderWidth
:
1
,
marginLeft
:
20
,
marginRight
:
20
}}
><
/View
>
<
/View
>
<
Text
style
=
{{
fontFamily
:
'Gotham-Black'
,
color
:
'#CFB368'
,
fontSize
:
20
,
textAlign
:
'center'
,
margin
:
3
}}
>
Current
Balance
<
/Text
>
<
TextInput
style
=
{{
height
:
40
,
borderWidth
:
1
,
padding
:
5
,
margin
:
10
,
borderRadius
:
10
,
borderColor
:
'grey'
,
fontFamily
:
'Gotham-Black'
,
textAlign
:
'center'
,
color
:
'grey'
,
fontWeight
:
'bold'
,
fontSize
:
20
}}
...
...
view/RedeemCode.js
View file @
85bedb85
...
...
@@ -8,26 +8,26 @@ class RedeemCode extends React.Component {
constructor
(
props
)
{
super
(
props
);
this
.
handleBackButtonClick
=
this
.
handleBackButtonClick
.
bind
(
this
)
this
.
state
=
{
}
}
// componentDidMount() {
componentDidMount
()
{
BackHandler
.
addEventListener
(
'hardwareBackPress'
,
this
.
handleBackButtonClick
);
// BackHandler.addEventListener('hardwareBackPress', this.handleBackButtonClick);
// }
}
// //
componentWillUnmount() {
// //
BackHandler.removeEventListener('hardwareBackPress', this.handleBackButtonClick);
// //
}
componentWillUnmount
()
{
BackHandler
.
removeEventListener
(
'hardwareBackPress'
,
this
.
handleBackButtonClick
);
}
//
handleBackButtonClick() {
//
this.props.navigation.navigate('Home', { screen: 'HOME' });
//
return true;
//
}
handleBackButtonClick
()
{
this
.
props
.
navigation
.
navigate
(
'Home'
,
{
screen
:
'HOME'
});
return
true
;
}
cancel
()
{
let
params
=
{
...
...
view/UseBalance.js
View file @
85bedb85
...
...
@@ -59,7 +59,7 @@ class UseBalance extends React.Component {
kasproPoint
:
dataCard
.
kaspro_point
.
replace
(
/,/g
,
''
)
})
// console.log(this.state.kasproBalance
)
console
.
log
(
"INI SESSION "
+
this
.
props
.
session_id
)
// console.log(this.state.kasproPoint)
}).
catch
(
error
=>
{
// console.log('ini error ' + error)
...
...
@@ -167,6 +167,7 @@ class UseBalance extends React.Component {
Axios
.
post
(
'https://excelsocrm.ravintoladev.com/crm/v2/point/redeem'
,
params
).
then
(
res
=>
{
// console.log(res.data)
let
respon
=
res
.
data
console
.
log
(
"INI DATANYA "
+
respon
)
// Alert.alert('', 'Sukses Redeem')
let
redeemProps
=
{
in_payment
:
true
,
...
...
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