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
5c79fa43
Commit
5c79fa43
authored
Jul 10, 2020
by
Wahyu Adjie Prasetyo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
transfer balance menambahkan field password
parent
4a25a8a9
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
76 additions
and
66 deletions
+76
-66
TransferBalance.js
view/TransferBalance.js
+76
-66
No files found.
view/TransferBalance.js
View file @
5c79fa43
import
React
from
'react'
;
import
React
from
'react'
;
import
{
View
,
Text
,
TextInput
,
StyleSheet
,
Button
,
Alert
,
ScrollView
,
TouchableOpacity
,
Image
}
from
'react-native'
;
import
{
View
,
Text
,
TextInput
,
StyleSheet
,
Button
,
Alert
,
ScrollView
,
TouchableOpacity
,
Image
}
from
'react-native'
;
import
Axios
from
'axios'
;
import
Axios
from
'axios'
;
import
{
connect
}
from
'react-redux'
;
import
{
connect
}
from
'react-redux'
;
import
ActionType
from
'../redux/globalActionType'
;
import
ActionType
from
'../redux/globalActionType'
;
import
MyStatusBar
from
'./MyStatusBar'
;
import
MyStatusBar
from
'./MyStatusBar'
;
import
i18n
from
'i18n-js'
;
import
i18n
from
'i18n-js'
;
import
Spinner
from
'react-native-loading-spinner-overlay'
;
class
TransferBalance
extends
React
.
Component
{
class
TransferBalance
extends
React
.
Component
{
constructor
(
props
)
{
constructor
(
props
)
{
super
(
props
);
super
(
props
);
...
@@ -19,7 +19,9 @@ class TransferBalance extends React.Component {
...
@@ -19,7 +19,9 @@ class TransferBalance extends React.Component {
destination
:
""
,
destination
:
""
,
amount
:
""
,
amount
:
""
,
reference
:
""
,
reference
:
""
,
caretHidden
:
true
,
password
:
""
,
caretHidden
:
true
,
spinner
:
false
,
}
}
}
}
...
@@ -32,7 +34,7 @@ class TransferBalance extends React.Component {
...
@@ -32,7 +34,7 @@ class TransferBalance extends React.Component {
let
params
=
{
let
params
=
{
session_id
:
this
.
props
.
session_id
session_id
:
this
.
props
.
session_id
}
}
Axios
.
post
(
this
.
props
.
BASE_URL
+
'crm/v2/member/get_profile'
,
params
).
then
(
res
=>
{
Axios
.
post
(
this
.
props
.
BASE_URL
+
'crm/v2/member/get_profile'
,
params
).
then
(
res
=>
{
let
data
=
res
.
data
let
data
=
res
.
data
// console.log('ini res nya : ' + data.kaspro_balance)
// console.log('ini res nya : ' + data.kaspro_balance)
this
.
setState
({
this
.
setState
({
...
@@ -46,86 +48,95 @@ class TransferBalance extends React.Component {
...
@@ -46,86 +48,95 @@ class TransferBalance extends React.Component {
})
})
}).
catch
(
error
=>
{
}).
catch
(
error
=>
{
let
response
=
error
.
response
.
data
;
let
response
=
error
.
response
.
data
;
// console.log(response.msg);
})
})
}
}
handleSend
()
{
handleSend
()
{
this
.
setState
({
spinner
:
true
,
})
let
params
=
{
let
params
=
{
"session_id"
:
this
.
props
.
session_id
,
"session_id"
:
this
.
props
.
session_id
,
"destination"
:
this
.
state
.
destination
,
"destination"
:
this
.
state
.
destination
,
"balance"
:
this
.
state
.
amount
,
"balance"
:
this
.
state
.
amount
,
"reference"
:
this
.
state
.
reference
"reference"
:
this
.
state
.
reference
,
"password"
:
this
.
state
.
password
}
}
// console.log(params);
// console.log(params);
Axios
.
post
(
this
.
props
.
BASE_URL
+
'crm/v2/card/transfer'
,
params
).
then
(
res
=>
{
Axios
.
post
(
this
.
props
.
BASE_URL
+
'crm/v2/card/transfer'
,
params
).
then
(
res
=>
{
// console.log('ini res ' + JSON.stringify(res.data))
// console.log('ini res ' + JSON.stringify(res.data))
Alert
.
alert
(
'Transaksi Berhasil'
)
Alert
.
alert
(
'
Sukses'
,
'
Transaksi Berhasil'
)
this
.
props
.
navigation
.
goBack
()
this
.
props
.
navigation
.
goBack
()
this
.
setState
({
spinner
:
false
,
})
}).
catch
(
error
=>
{
}).
catch
(
error
=>
{
let
response
=
error
.
response
.
data
;
let
response
=
error
.
response
.
data
;
Alert
.
alert
(
response
.
msg
);
Alert
.
alert
(
''
,
response
.
msg
);
this
.
setState
({
spinner
:
false
,
})
})
})
}
}
// handle() {
// let cardProps = {
// set_card: false
// }
// this.props.setCardactive(cardProps)
// console.log(this.props.set_card)
// }
render
()
{
render
()
{
return
(
return
(
<
View
style
=
{
styles
.
container
}
>
<
View
style
=
{
styles
.
container
}
>
<
Spinner
visible
=
{
this
.
state
.
spinner
}
textContent
=
{
'Loading...'
}
textStyle
=
{
styles
.
spinnerTextStyle
}
/
>
<
MyStatusBar
/>
<
MyStatusBar
/>
<
ScrollView
>
<
ScrollView
>
<
View
style
=
{{
flex
:
3
}}
>
<
View
style
=
{{
flex
:
3
}}
>
<
View
style
=
{{
flex
:
1
,
margin
:
20
,
top
:
20
}}
>
<
View
style
=
{{
flex
:
1
,
margin
:
20
,
top
:
20
}}
>
<
Text
style
=
{{
fontFamily
:
'Gotham-Black'
,
color
:
'#CFB368'
,
fontSize
:
20
,
textAlign
:
'center'
,
margin
:
3
}}
>
{
i18n
.
t
(
'phone'
)}
<
/Text
>
<
Text
style
=
{{
fontFamily
:
'Gotham-Black'
,
color
:
'#CFB368'
,
fontSize
:
20
,
textAlign
:
'center'
,
margin
:
3
}}
>
{
i18n
.
t
(
'phone'
)}
<
/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
}}
<
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
}}
onChangeText
=
{(
destination
)
=>
this
.
setState
({
destination
})}
onChangeText
=
{(
destination
)
=>
this
.
setState
({
destination
})}
value
=
{
this
.
state
.
destination
}
value
=
{
this
.
state
.
destination
}
keyboardType
=
'number-pad'
keyboardType
=
'number-pad'
caretHidden
=
{
this
.
state
.
caretHidden
}
caretHidden
=
{
this
.
state
.
caretHidden
}
onFocus
=
{()
=>
this
.
setState
({
caretHidden
:
false
})}
/
>
onFocus
=
{()
=>
this
.
setState
({
caretHidden
:
false
})}
/
>
<
Text
style
=
{{
fontFamily
:
'Gotham-Black'
,
color
:
'#CFB368'
,
fontSize
:
20
,
textAlign
:
'center'
,
margin
:
3
}}
>
{
i18n
.
t
(
'amount'
)}
<
/Text
>
<
Text
style
=
{{
fontFamily
:
'Gotham-Black'
,
color
:
'#CFB368'
,
fontSize
:
20
,
textAlign
:
'center'
,
margin
:
3
}}
>
{
i18n
.
t
(
'amount'
)}
<
/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
}}
<
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
}}
onChangeText
=
{(
amount
)
=>
this
.
setState
({
amount
})}
onChangeText
=
{(
amount
)
=>
this
.
setState
({
amount
})}
value
=
{
this
.
state
.
amount
}
value
=
{
this
.
state
.
amount
}
keyboardType
=
'number-pad'
keyboardType
=
'number-pad'
caretHidden
=
{
this
.
state
.
caretHidden
}
caretHidden
=
{
this
.
state
.
caretHidden
}
onFocus
=
{()
=>
this
.
setState
({
caretHidden
:
false
})}
/
>
onFocus
=
{()
=>
this
.
setState
({
caretHidden
:
false
})}
/
>
<
Text
style
=
{{
fontFamily
:
'Gotham-Black'
,
color
:
'#CFB368'
,
fontSize
:
20
,
textAlign
:
'center'
,
margin
:
3
}}
>
{
i18n
.
t
(
'currentbalance'
)}
<
/Text
>
<
Text
style
=
{{
fontFamily
:
'Gotham-Black'
,
color
:
'#CFB368'
,
fontSize
:
20
,
textAlign
:
'center'
,
margin
:
3
}}
>
{
i18n
.
t
(
'currentbalance'
)}
<
/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
}}
<
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
}}
onChangeText
=
{(
no_tlp
)
=>
this
.
setState
({
no_tlp
})}
editable
=
{
false
}
editable
=
{
false
}
caretHidden
=
{
this
.
state
.
caretHidden
}
caretHidden
=
{
this
.
state
.
caretHidden
}
onFocus
=
{()
=>
this
.
setState
({
caretHidden
:
false
})}
>
onFocus
=
{()
=>
this
.
setState
({
caretHidden
:
false
})}
>
{
this
.
state
.
balance
}
{
this
.
state
.
balance
}
<
/TextInput
>
<
/TextInput
>
<
Text
style
=
{{
fontFamily
:
'Gotham-Black'
,
color
:
'#CFB368'
,
fontSize
:
20
,
textAlign
:
'center'
,
margin
:
3
}}
>
{
i18n
.
t
(
'password'
)}
<
/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
}}
onChangeText
=
{(
password
)
=>
this
.
setState
({
password
})}
editable
=
{
true
}
caretHidden
=
{
this
.
state
.
caretHidden
}
secureTextEntry
=
{
true
}
onFocus
=
{()
=>
this
.
setState
({
caretHidden
:
false
})}
>
<
/TextInput
>
<
Text
style
=
{{
fontFamily
:
'Gotham-Black'
,
color
:
'#CFB368'
,
fontSize
:
20
,
textAlign
:
'center'
,
margin
:
3
}}
>
{
i18n
.
t
(
'message'
)}
<
/Text
>
<
Text
style
=
{{
fontFamily
:
'Gotham-Black'
,
color
:
'#CFB368'
,
fontSize
:
20
,
textAlign
:
'center'
,
margin
:
3
}}
>
{
i18n
.
t
(
'message'
)}
<
/Text
>
<
TextInput
style
=
{{
height
:
100
,
borderWidth
:
1
,
padding
:
5
,
margin
:
10
,
borderRadius
:
10
,
borderColor
:
'grey'
,
fontFamily
:
'Gotham-Black'
,
textAlign
:
'center'
,
color
:
'grey'
,
fontWeight
:
'bold'
,
fontSize
:
20
}}
<
TextInput
style
=
{{
height
:
100
,
borderWidth
:
1
,
padding
:
5
,
margin
:
10
,
borderRadius
:
10
,
borderColor
:
'grey'
,
fontFamily
:
'Gotham-Black'
,
textAlign
:
'center'
,
color
:
'grey'
,
fontWeight
:
'bold'
,
fontSize
:
20
}}
onChangeText
=
{(
reference
)
=>
this
.
setState
({
reference
})}
onChangeText
=
{(
reference
)
=>
this
.
setState
({
reference
})}
value
=
{
this
.
state
.
reference
}
value
=
{
this
.
state
.
reference
}
caretHidden
=
{
this
.
state
.
caretHidden
}
caretHidden
=
{
this
.
state
.
caretHidden
}
onFocus
=
{()
=>
this
.
setState
({
caretHidden
:
false
})}
>
onFocus
=
{()
=>
this
.
setState
({
caretHidden
:
false
})}
>
<
/TextInput
>
<
/TextInput
>
<
/View
>
<
/View
>
<
/View
>
<
/View
>
<
View
style
=
{{
flex
:
2
}}
>
<
View
style
=
{{
flex
:
2
}}
>
<
View
style
=
{{
flex
:
1
}}
>
<
View
style
=
{{
flex
:
1
}}
>
<
View
style
=
{{
flex
:
1
,
flexDirection
:
'row'
,
top
:
10
,
margin
:
5
,
marginBottom
:
20
,
marginLeft
:
20
,
marginRight
:
20
}}
>
<
View
style
=
{{
flex
:
1
,
flexDirection
:
'row'
,
top
:
10
,
margin
:
5
,
marginBottom
:
20
,
marginLeft
:
20
,
marginRight
:
20
}}
>
<
View
style
=
{{
flex
:
1
,
margin
:
5
}}
>
<
View
style
=
{{
flex
:
1
,
margin
:
5
}}
>
<
TouchableOpacity
title
=
"Edit"
onPress
=
{()
=>
this
.
handleSend
()}
>
<
TouchableOpacity
style
=
{{
height
:
40
,
borderRadius
:
10
,
backgroundColor
:
'#CFB368'
,
marginRight
:
40
,
marginLeft
:
40
,
justifyContent
:
'center'
}}
onPress
=
{()
=>
this
.
handleSend
()}
>
<
View
style
=
{{
height
:
40
,
borderRadius
:
20
,
backgroundColor
:
'#CFB368'
,
marginRight
:
40
,
marginLeft
:
40
,
justifyContent
:
'center'
}}
>
<
Text
style
=
{{
fontFamily
:
'Gotham-Black'
,
color
:
'white'
,
fontSize
:
19
,
textAlign
:
'center'
,
margin
:
20
}}
>
{
i18n
.
t
(
'save'
)}
<
/Text
>
<
Text
style
=
{{
fontFamily
:
'Gotham-Black'
,
color
:
'white'
,
fontSize
:
19
,
textAlign
:
'center'
,
margin
:
20
}}
>
{
i18n
.
t
(
'save'
)}
<
/Text
>
<
/View
>
<
/TouchableOpacity
>
<
/TouchableOpacity
>
<
/View
>
<
/View
>
<
/View
>
<
/View
>
...
@@ -198,7 +209,6 @@ const mapStateToProps = (state) => {
...
@@ -198,7 +209,6 @@ const mapStateToProps = (state) => {
}
}
const
mapDispatchToProps
=
(
dispacth
)
=>
{
const
mapDispatchToProps
=
(
dispacth
)
=>
{
console
.
log
(
dispacth
)
return
{
return
{
setCardactive
:
(
cardProps
)
=>
dispacth
({
setCardactive
:
(
cardProps
)
=>
dispacth
({
type
:
ActionType
.
SET_CARD
,
type
:
ActionType
.
SET_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