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
26b1db78
Commit
26b1db78
authored
Jun 02, 2020
by
Trisno
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update use balance
parent
729e7c9a
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
379 additions
and
52 deletions
+379
-52
Auth.js
view/Auth.js
+15
-3
RedeemCode.js
view/RedeemCode.js
+73
-17
UseBalance.js
view/UseBalance.js
+291
-32
No files found.
view/Auth.js
View file @
26b1db78
...
...
@@ -437,7 +437,7 @@ class Auth extends React.Component {
},
title
:
'RATING ORDER'
}}
/
>
<
Stack
.
Screen
name
=
"UseBalance"
component
=
{
UseBalance
}
<
Stack
.
Screen
name
=
"UseBalance"
component
=
{
UseBalance
}
options
=
{{
headerStyle
:
{
backgroundColor
:
'#CFB368'
},
headerTitleContainerStyle
:
{
alignContent
:
'center'
},
...
...
@@ -452,7 +452,7 @@ class Auth extends React.Component {
},
title
:
'USE BALANCE'
}}
/
>
<
Stack
.
Screen
name
=
"PaymentCode"
component
=
{
PaymentCode
}
<
Stack
.
Screen
name
=
"PaymentCode"
component
=
{
PaymentCode
}
options
=
{{
headerStyle
:
{
backgroundColor
:
'#CFB368'
},
headerTitleContainerStyle
:
{
alignContent
:
'center'
},
...
...
@@ -523,7 +523,19 @@ class Auth extends React.Component {
{
/* <Stack.Screen name="Card Activation" component={CardActivation} /> */
}
<
Stack
.
Screen
name
=
"Confirm Mobile"
component
=
{
ConfirmMobile
}
/
>
<
Stack
.
Screen
name
=
"Balance"
component
=
{
Balance
}
/
>
<
Stack
.
Screen
name
=
"Redeem Code"
component
=
{
RedeemCode
}
/
>
<
Stack
.
Screen
name
=
"Redeem Code"
component
=
{
RedeemCode
}
options
=
{{
headerStyle
:
{
backgroundColor
:
"#CFB368"
},
headerBackTitleStyle
:
{
color
:
'white'
},
headerTintColor
:
'#fff'
,
headerTitleAlign
:
'center'
,
headerTitleStyle
:
{
fontFamily
:
'Gotham-Black'
,
color
:
'white'
,
fontSize
:
20
,
},
title
:
'REDEEM CODE'
}}
/
>
<
Stack
.
Screen
name
=
"Transaction History"
component
=
{
TransactionHistory
}
options
=
{{
headerStyle
:
{
backgroundColor
:
"#CFB368"
},
...
...
view/RedeemCode.js
View file @
26b1db78
import
React
from
'react'
;
import
{
View
,
Text
,
TextInput
,
StyleSheet
,
Button
}
from
'react-native'
;
import
{
View
,
Text
,
TextInput
,
StyleSheet
,
Button
,
TouchableOpacity
,
Alert
,
}
from
'react-native'
;
import
{
connect
}
from
'react-redux'
;
import
Axios
from
'axios'
;
class
RedeemCode
extends
React
.
Component
{
constructor
(
props
)
{
super
(
props
);
this
.
state
=
{
}
}
cancel
()
{
let
params
=
{
session_id
:
this
.
props
.
session_id
,
}
Axios
.
post
(
'https://excelsocrm.ravintoladev.com/crm/v2/point/refund'
,
params
).
then
(
res
=>
{
console
.
log
(
res
.
data
)
Alert
.
alert
(
''
,
'Berhasil dibatalkan'
)
this
.
props
.
navigation
.
navigate
(
'Home'
,
{
screen
:
'HOME'
});
}).
catch
(
error
=>
{
let
response
=
error
.
response
.
data
if
(
response
.
code
===
"EMPTY_PIN"
)
{
Alert
.
alert
(
'Error'
,
response
.
msg
)
}
else
{
let
response
=
error
.
response
.
data
;
Alert
.
alert
(
''
,
response
.
msg
);
}
})
}
export
default
class
RedeemCode
extends
React
.
Component
{
render
()
{
console
.
log
(
this
.
props
)
return
(
<
View
style
=
{
styles
.
container
}
>
<
View
style
=
{
styles
.
header
}
>
{
/*
<View style={styles.header}>
<Text style={{ textAlign: 'center', fontSize: 25 }}>Payment Code</Text>
<
/View
>
<
View
>
<
Text
style
=
{{
font
Size
:
25
,
textAlign
:
'center'
}}
>
XY2313
<
/Text
>
<
View
style
=
{{
borderWidth
:
1
,
marginRight
:
20
,
marginLeft
:
20
}}
><
/View
>
</View>
*/
}
<
View
style
=
{{
marginTop
:
50
}}
>
<
Text
style
=
{{
font
Family
:
'Gotham-Black'
,
color
:
'#838383'
,
fontSize
:
26
,
textAlign
:
'center'
}}
>
{
this
.
props
.
route
.
params
.
redeemCode
}
<
/Text
>
<
View
style
=
{{
borderWidth
:
1
,
marginRight
:
20
,
marginLeft
:
20
,
borderColor
:
'#838383'
}}
><
/View
>
<
/View
>
<
View
style
=
{
styles
.
body
}
>
<
View
style
=
{
styles
.
current_balance
}
>
<
View
style
=
{{
flex
:
1
,
margin
:
10
}}
>
<
Text
style
=
{{
fontSize
:
20
}}
>
Current
Balance
<
/Text
>
<
Text
style
=
{{
fontSize
:
20
,
fontFamily
:
'Gotham-Black'
,
color
:
'#838383'
}}
>
Balance
<
/Text
>
<
/View
>
<
View
style
=
{{
flex
:
1
,
margin
:
10
}}
>
<
Text
style
=
{{
fontSize
:
20
}}
>
xxxxxxxxxxx
<
/Text
>
<
Text
style
=
{{
fontSize
:
20
,
fontFamily
:
'Gotham-Black'
,
color
:
'#838383'
}}
>
{
this
.
props
.
route
.
params
.
balanceUsed
}
<
/Text
>
<
/View
>
<
/View
>
<
View
style
=
{
styles
.
redeem
}
>
<
View
style
=
{
styles
.
current_balance
}
>
<
View
style
=
{{
flex
:
1
,
margin
:
10
}}
>
<
Text
style
=
{{
fontSize
:
20
,
fontFamily
:
'Gotham-Black'
,
color
:
'#838383'
}}
>
Points
<
/Text
>
<
/View
>
<
View
style
=
{{
flex
:
1
,
margin
:
10
}}
>
<
Text
style
=
{{
fontSize
:
20
,
fontFamily
:
'Gotham-Black'
,
color
:
'#838383'
}}
>
{
this
.
props
.
route
.
params
.
pointUsed
}
<
/Text
>
<
/View
>
<
/View
>
{
/* <View style={styles.redeem}>
<View style={{ flex: 1, margin: 10 }}>
<Text style={{ fontSize: 20 }} >Time</Text>
</View>
<View style={{ flex: 1, margin: 10 }}>
<Text style={{ fontSize: 20 }}>0:30</Text>
</View>
<
/View
>
<
View
style
=
{
styles
.
button
}
>
<
Button
title
=
"Cancel Payment"
color
=
"red"
/>
<
/View
>
</View> */
}
<
TouchableOpacity
onPress
=
{()
=>
this
.
cancel
()}
>
<
View
style
=
{
styles
.
button
}
>
<
Text
style
=
{{
color
:
'white'
,
fontSize
:
16
,
fontFamily
:
'Gotham-Black'
}}
>
Cancel
Payment
<
/Text
>
<
/View
>
<
/TouchableOpacity
>
<
/View
>
<
/View
>
)
...
...
@@ -69,9 +112,22 @@ const styles = StyleSheet.create({
button
:
{
height
:
50
,
margin
:
10
,
backgroundColor
:
'#d34343'
,
height
:
40
,
marginTop
:
25
,
marginHorizontal
:
20
,
borderRadius
:
10
,
paddingVertical
:
5
,
alignItems
:
'center'
,
justifyContent
:
'center'
},
})
const
mapStateToProps
=
(
state
)
=>
{
return
{
session_id
:
state
.
session_id
,
}
}
})
\ No newline at end of file
export
default
connect
(
mapStateToProps
)(
RedeemCode
);
\ No newline at end of file
view/UseBalance.js
View file @
26b1db78
This diff is collapsed.
Click to expand it.
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