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
835a7a79
Commit
835a7a79
authored
Jun 04, 2020
by
Trisno
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
benerin metode pembayaran use balance
parent
167e71a7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
42 deletions
+44
-42
UseBalance.js
view/UseBalance.js
+44
-42
No files found.
view/UseBalance.js
View file @
835a7a79
...
@@ -42,7 +42,7 @@ class UseBalance extends React.Component {
...
@@ -42,7 +42,7 @@ class UseBalance extends React.Component {
}
}
Axios
.
post
(
'https://excelsocrm.ravintoladev.com/crm/v2/member/get_profile'
,
params
).
then
(
res
=>
{
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 res ' + JSON.stringify(res.data))
const
dataCard
=
res
.
data
const
dataCard
=
res
.
data
...
@@ -61,13 +61,13 @@ class UseBalance extends React.Component {
...
@@ -61,13 +61,13 @@ class UseBalance extends React.Component {
// // Buat Debug
// // Buat Debug
// this.setState({
// this.setState({
// current_balance: '
10
,000',
// current_balance: '
5
,000',
// kaspro_point: '0',
// kaspro_point: '
10,00
0',
// kasproBalance: '
10
,000'.replace(/,/g, ''),
// kasproBalance: '
5
,000'.replace(/,/g, ''),
// kasproPoint: '0'.replace(/,/g, '')
// kasproPoint: '
10,00
0'.replace(/,/g, '')
// })
// })
console
.
log
(
"INI SESSION "
+
this
.
props
.
session_id
)
//
console.log("INI SESSION " + this.props.session_id)
// console.log(this.state.kasproPoint)
// console.log(this.state.kasproPoint)
}).
catch
(
error
=>
{
}).
catch
(
error
=>
{
// console.log('ini error ' + error)
// console.log('ini error ' + error)
...
@@ -168,7 +168,7 @@ class UseBalance extends React.Component {
...
@@ -168,7 +168,7 @@ class UseBalance extends React.Component {
session_id
:
this
.
props
.
session_id
,
session_id
:
this
.
props
.
session_id
,
pin
:
this
.
state
.
pin
,
pin
:
this
.
state
.
pin
,
balance
:
0
,
balance
:
0
,
point
:
this
.
state
.
input_redeem
point
:
parseInt
(
this
.
state
.
input_redeem
)
}
}
console
.
log
(
params
)
console
.
log
(
params
)
...
@@ -209,7 +209,7 @@ class UseBalance extends React.Component {
...
@@ -209,7 +209,7 @@ class UseBalance extends React.Component {
session_id
:
this
.
props
.
session_id
,
session_id
:
this
.
props
.
session_id
,
pin
:
this
.
state
.
pin
,
pin
:
this
.
state
.
pin
,
balance
:
parseInt
(
this
.
state
.
input_redeem
)
-
parseInt
(
this
.
state
.
kasproPoint
),
balance
:
parseInt
(
this
.
state
.
input_redeem
)
-
parseInt
(
this
.
state
.
kasproPoint
),
point
:
this
.
state
.
kasproPoint
point
:
parseInt
(
this
.
state
.
kasproPoint
)
}
}
console
.
log
(
params
)
console
.
log
(
params
)
...
@@ -244,7 +244,7 @@ class UseBalance extends React.Component {
...
@@ -244,7 +244,7 @@ class UseBalance extends React.Component {
session_id
:
this
.
props
.
session_id
,
session_id
:
this
.
props
.
session_id
,
pin
:
this
.
state
.
pin
,
pin
:
this
.
state
.
pin
,
balance
:
0
,
balance
:
0
,
point
:
this
.
state
.
input_redeem
point
:
parseInt
(
this
.
state
.
input_redeem
)
}
}
console
.
log
(
params
)
console
.
log
(
params
)
...
@@ -281,7 +281,9 @@ class UseBalance extends React.Component {
...
@@ -281,7 +281,9 @@ class UseBalance extends React.Component {
}
}
render
()
{
render
()
{
console
.
log
(
parseInt
(
this
.
state
.
kasproPoint
)
-
parseInt
(
this
.
state
.
input_redeem
))
// console.log(parseInt(this.state.kasproPoint) - parseInt(this.state.input_redeem))
// console.log(this.state.kasproBalance)
// console.log(this.state.kasproPoint)
return
(
return
(
<
ScrollView
style
=
{
styles
.
container
}
>
<
ScrollView
style
=
{
styles
.
container
}
>
<
Modal
animationType
=
"slide"
<
Modal
animationType
=
"slide"
...
@@ -349,7 +351,7 @@ class UseBalance extends React.Component {
...
@@ -349,7 +351,7 @@ class UseBalance extends React.Component {
<
View
style
=
{{
alignItems
:
'center'
}}
>
<
View
style
=
{{
alignItems
:
'center'
}}
>
{
{
this
.
state
.
input_redeem
==
0
?
(
this
.
state
.
input_redeem
==
0
||
parseInt
(
this
.
state
.
input_redeem
)
>
parseInt
(
this
.
state
.
kasproBalance
)
?
(
<
Card
style
=
{{
margin
:
5
,
padding
:
10
,
backgroundColor
:
'gray'
}}
>
<
Card
style
=
{{
margin
:
5
,
padding
:
10
,
backgroundColor
:
'gray'
}}
>
<
View
style
=
{{
flexDirection
:
'row'
,
justifyContent
:
'space-between'
,
alignItems
:
'center'
}}
>
<
View
style
=
{{
flexDirection
:
'row'
,
justifyContent
:
'space-between'
,
alignItems
:
'center'
}}
>
<
View
>
<
View
>
...
@@ -387,7 +389,7 @@ class UseBalance extends React.Component {
...
@@ -387,7 +389,7 @@ class UseBalance extends React.Component {
<
/View
>
<
/View
>
<
View
style
=
{{
alignItems
:
'center'
}}
>
<
View
style
=
{{
alignItems
:
'center'
}}
>
{
{
this
.
state
.
input_redeem
==
0
?
(
this
.
state
.
input_redeem
==
0
||
parseInt
(
this
.
state
.
input_redeem
)
>
parseInt
(
this
.
state
.
kasproPoint
)
?
(
<
Card
style
=
{{
margin
:
5
,
padding
:
10
,
backgroundColor
:
'gray'
}}
>
<
Card
style
=
{{
margin
:
5
,
padding
:
10
,
backgroundColor
:
'gray'
}}
>
<
View
style
=
{{
flexDirection
:
'row'
,
justifyContent
:
'space-between'
,
alignItems
:
'center'
}}
>
<
View
style
=
{{
flexDirection
:
'row'
,
justifyContent
:
'space-between'
,
alignItems
:
'center'
}}
>
<
View
>
<
View
>
...
@@ -426,40 +428,40 @@ class UseBalance extends React.Component {
...
@@ -426,40 +428,40 @@ class UseBalance extends React.Component {
<
/View
>
<
/View
>
<
View
style
=
{{
alignItems
:
'center'
}}
>
<
View
style
=
{{
alignItems
:
'center'
}}
>
{
{
this
.
state
.
input_redeem
!=
0
?
(
this
.
state
.
input_redeem
==
0
||
parseInt
(
this
.
state
.
input_redeem
)
>
parseInt
(
this
.
state
.
kasproPoint
)
+
parseInt
(
this
.
state
.
kasproBalance
)
?
(
<
TouchableOpacity
onPress
=
{()
=>
{
<
Card
style
=
{{
margin
:
5
,
padding
:
10
,
backgroundColor
:
'gray'
}}
>
this
.
checkedSelection
(
'balancepoint'
)
<
View
style
=
{{
flexDirection
:
'row'
,
justifyContent
:
'space-between'
,
alignItems
:
'center'
}}
>
}}
>
<
View
>
<
Card
style
=
{{
margin
:
5
,
padding
:
10
}}
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Black'
,
color
:
'white'
}}
>
EXCELSO
BALANCE
+
POINTS
<
/Text
>
<
View
style
=
{{
flexDirection
:
'row'
,
justifyContent
:
'space-between'
,
alignItems
:
'center'
}}
>
<
/View
>
<
View
>
<
View
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Black'
,
color
:
'grey'
}}
>
EXCELSO
BALANCE
+
POINTS
<
/Text
>
<
FontAwesome
name
=
'circle-o'
size
=
{
30
}
color
=
{
'#ccb46c'
}
/
>
<
/View
>
<
View
>
<
CheckBox
onClick
=
{()
=>
{
this
.
checkedSelection
(
'balancepoint'
)
}}
isChecked
=
{
this
.
state
.
checkedBalancePoint
}
checkedImage
=
{
<
FontAwesome
name
=
'check-circle'
size
=
{
30
}
color
=
{
'#ccb46c'
}
/>
}
unCheckedImage
=
{
<
FontAwesome
name
=
'circle-o'
size
=
{
30
}
color
=
{
'#ccb46c'
}
/>
}
/>
<
/View
>
<
/View
>
<
/View
>
<
/
Card
>
<
/
View
>
<
/
TouchableOpacity
>
<
/
Card
>
)
:
(
)
:
(
<
Card
style
=
{{
margin
:
5
,
padding
:
10
,
backgroundColor
:
'gray'
}}
>
<
TouchableOpacity
onPress
=
{()
=>
{
<
View
style
=
{{
flexDirection
:
'row'
,
justifyContent
:
'space-between'
,
alignItems
:
'center'
}}
>
this
.
checkedSelection
(
'balancepoint'
)
<
View
>
}}
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Black'
,
color
:
'white'
}}
>
EXCELSO
BALANCE
+
POINTS
<
/Text
>
<
Card
style
=
{{
margin
:
5
,
padding
:
10
}}
>
<
/View
>
<
View
style
=
{{
flexDirection
:
'row'
,
justifyContent
:
'space-between'
,
alignItems
:
'center'
}}
>
<
View
>
<
View
>
<
FontAwesome
name
=
'circle-o'
size
=
{
30
}
color
=
{
'#ccb46c'
}
/
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Black'
,
color
:
'grey'
}}
>
EXCELSO
BALANCE
+
POINTS
<
/Text
>
<
/View
>
<
View
>
<
CheckBox
onClick
=
{()
=>
{
this
.
checkedSelection
(
'balancepoint'
)
}}
isChecked
=
{
this
.
state
.
checkedBalancePoint
}
checkedImage
=
{
<
FontAwesome
name
=
'check-circle'
size
=
{
30
}
color
=
{
'#ccb46c'
}
/>
}
unCheckedImage
=
{
<
FontAwesome
name
=
'circle-o'
size
=
{
30
}
color
=
{
'#ccb46c'
}
/>
}
/>
<
/View
>
<
/View
>
<
/View
>
<
/
View
>
<
/
Card
>
<
/
Card
>
<
/
TouchableOpacity
>
)
)
}
}
...
...
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