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
e5ab7e7b
Commit
e5ab7e7b
authored
Jun 17, 2020
by
Wahyu Adjie Prasetyo
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
ssh://repo.cs.co.id:2222/wahyu/bahanoprek
parents
0ae635bc
6766c621
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
53 additions
and
29 deletions
+53
-29
CardActivation.js
view/CardActivation.js
+27
-18
UpgradePremium.js
view/UpgradePremium.js
+26
-11
No files found.
view/CardActivation.js
View file @
e5ab7e7b
import
React
from
'react'
;
import
{
View
,
Text
,
TextInput
,
StyleSheet
,
Button
,
Alert
,
TouchableOpacity
}
from
'react-native'
;
import
{
View
,
Text
,
TextInput
,
StyleSheet
,
Button
,
ScrollView
,
Alert
,
TouchableOpacity
}
from
'react-native'
;
import
{
connect
}
from
'react-redux'
;
import
Axios
from
'axios'
;
import
ActionType
from
'../redux/globalActionType'
;
...
...
@@ -96,28 +96,37 @@ class CardActivation extends React.Component {
token
:
this
.
state
.
token
}
Axios
.
post
(
'https://excelsocrm.ravintoladev.com/crm/v2/card/activate'
,
params
).
then
(
res
=>
{
Alert
.
alert
(
"Kartu anda berhasil di aktifkan"
);
this
.
setState
({
spinner
:
false
,
})
this
.
props
.
navigation
.
reset
({
index
:
0
,
routes
:
[{
name
:
'Home'
}],
})
Alert
.
alert
(
""
,
"Kartu anda berhasil di aktifkan"
,
[
{
text
:
"OK"
,
onPress
:
()
=>
{
this
.
setState
({
spinner
:
false
})
this
.
props
.
navigation
.
reset
({
index
:
0
,
routes
:
[{
name
:
'Home'
}],
})
}
}
],
);
}).
catch
(
error
=>
{
this
.
setState
({
spinner
:
false
,
})
let
response
=
error
.
response
.
data
;
Alert
.
alert
(
''
,
response
.
msg
);
Alert
.
alert
(
''
,
response
.
msg
,
[
{
text
:
"OK"
,
onPress
:
()
=>
this
.
setState
({
spinner
:
false
})
}
],
);
})
}
render
()
{
return
(
<
View
style
=
{
styles
.
container
}
>
<
Scroll
View
style
=
{
styles
.
container
}
>
<
Spinner
visible
=
{
this
.
state
.
spinner
}
textContent
=
{
'Loading...'
}
...
...
@@ -153,7 +162,7 @@ class CardActivation extends React.Component {
this
.
state
.
timer
===
0
?
(
<
TouchableOpacity
onPress
=
{()
=>
this
.
ResendToken
()}
>
<
View
style
=
{{
height
:
40
,
borderRadius
:
20
,
backgroundColor
:
'#CFB368'
,
margin
:
20
,
justifyContent
:
'center'
}}
>
<
Text
style
=
{{
fontFamily
:
'Gotham-Black'
,
color
:
'white'
,
fontSize
:
20
,
textAlign
:
'center'
,
margin
:
15
}}
>
Resend
Token
<
/Text
>
<
Text
style
=
{{
fontFamily
:
'Gotham-Black'
,
color
:
'white'
,
fontSize
:
20
,
textAlign
:
'center'
}}
>
Resend
Token
<
/Text
>
<
/View
>
<
/TouchableOpacity
>
)
:
(
null
)}
...
...
@@ -166,7 +175,7 @@ class CardActivation extends React.Component {
onChangeText
=
{
card_number
=>
this
.
setState
({
card_number
})}
value
=
{
this
.
state
.
card_number
}
keyboardType
=
'numeric'
/>
/>
<
/View
>
<
/View
>
<
View
style
=
{
styles
.
field_email
}
>
...
...
@@ -188,7 +197,7 @@ class CardActivation extends React.Component {
<
/TouchableOpacity
>
<
/View
>
<
/View
>
<
/View
>
<
/
Scroll
View
>
)
}
}
...
...
view/UpgradePremium.js
View file @
e5ab7e7b
...
...
@@ -21,8 +21,14 @@ import {
}
from
'react-native'
import
MyStatusBar
from
'./MyStatusBar'
;
const
jobs
=
[
"Pilih"
,
"Siswa"
,
"Mahasiswa"
,
"Karyawan"
,
"Pengusaha"
,
"Lainnya"
]
const
jobs
=
[
"Pilih"
,
"Siswa"
,
"Mahasiswa"
,
"Karyawan"
,
"Pengusaha"
,
"Lainnya"
];
const
_jobs
=
[
{
label
:
"Siswa"
,
value
:
"Siswa"
},
{
label
:
"Mahasiswa"
,
value
:
"Mahasiswa"
},
{
label
:
"Karyawan"
,
value
:
"Karyawan"
},
{
label
:
"Pengusaha"
,
value
:
"Pengusaha"
},
{
label
:
"Lainnya"
,
value
:
"Lainnya"
}
];
class
UpgradePremium
extends
React
.
Component
{
constructor
(
props
)
{
super
(
props
)
...
...
@@ -298,16 +304,25 @@ class UpgradePremium extends React.Component {
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Black'
,
color
:
'#CFB368'
,
textAlign
:
'center'
}}
>
Pekerjaan
<
/Text
>
<
/View
>
<
View
style
=
{{
marginHorizontal
:
40
,
borderColor
:
'gray'
,
borderWidth
:
1
,
borderRadius
:
10
,
top
:
10
}}
>
<
Picker
mode
=
"dropdown"
selectedValue
=
{
this
.
state
.
pekerjaan
}
style
=
{{
height
:
40
,
width
:
'100%'
}}
onValueChange
=
{(
itemValue
,
itemIndex
)
=>
this
.
setState
({
pekerjaan
:
itemValue
})}
>
{
jobs
.
map
((
itemValue
,
itemIndex
)
=>
{
return
(
<
Picker
.
Item
label
=
{
itemValue
}
value
=
{
itemValue
}
key
=
{
itemIndex
}
/>
)
})}
{
Platform
.
OS
===
'ios'
?
(
<
RNPickerSelect
onValueChange
=
{(
value
)
=>
this
.
setState
({
pekerjaan
:
value
})}
items
=
{
_jobs
}
placeholder
=
{{
label
:
'-- Select --'
}}
style
=
{{
inputIOSContainer
:
{
paddingVertical
:
10
,
alignItems
:
'center'
}}}
/
>
)
:
(
<
Picker
mode
=
"dropdown"
selectedValue
=
{
this
.
state
.
pekerjaan
}
style
=
{{
height
:
40
,
width
:
'100%'
}}
onValueChange
=
{(
itemValue
,
itemIndex
)
=>
this
.
setState
({
pekerjaan
:
itemValue
})}
>
{
jobs
.
map
((
itemValue
,
itemIndex
)
=>
{
return
(
<
Picker
.
Item
label
=
{
itemValue
}
value
=
{
itemValue
}
key
=
{
itemIndex
}
/>
)
})}
<
/Picker
>
)}
<
/Picker
>
<
/View
>
<
View
style
=
{
styles
.
textLabel
,
{
top
:
20
}}
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Black'
,
color
:
'#CFB368'
,
textAlign
:
'center'
}}
>
KTP
<
/Text
>
...
...
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