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
ed8222d5
Commit
ed8222d5
authored
Jun 17, 2020
by
Fred
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix for ios
parent
cf118dab
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
55 additions
and
31 deletions
+55
-31
CardActivation.js
view/CardActivation.js
+27
-18
Home.js
view/Home.js
+2
-2
UpgradePremium.js
view/UpgradePremium.js
+26
-11
No files found.
view/CardActivation.js
View file @
ed8222d5
import
React
from
'react'
;
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
{
connect
}
from
'react-redux'
;
import
Axios
from
'axios'
;
import
Axios
from
'axios'
;
import
ActionType
from
'../redux/globalActionType'
;
import
ActionType
from
'../redux/globalActionType'
;
...
@@ -96,28 +96,37 @@ class CardActivation extends React.Component {
...
@@ -96,28 +96,37 @@ class CardActivation extends React.Component {
token
:
this
.
state
.
token
token
:
this
.
state
.
token
}
}
Axios
.
post
(
'https://excelsocrm.ravintoladev.com/crm/v2/card/activate'
,
params
).
then
(
res
=>
{
Axios
.
post
(
'https://excelsocrm.ravintoladev.com/crm/v2/card/activate'
,
params
).
then
(
res
=>
{
Alert
.
alert
(
"Kartu anda berhasil di aktifkan"
);
Alert
.
alert
(
this
.
setState
({
""
,
spinner
:
false
,
"Kartu anda berhasil di aktifkan"
,
})
[
this
.
props
.
navigation
.
reset
({
{
text
:
"OK"
,
onPress
:
()
=>
index
:
0
,
{
routes
:
[{
name
:
'Home'
}],
this
.
setState
({
spinner
:
false
})
})
this
.
props
.
navigation
.
reset
({
index
:
0
,
routes
:
[{
name
:
'Home'
}],
})
}
}
],
);
}).
catch
(
error
=>
{
}).
catch
(
error
=>
{
this
.
setState
({
spinner
:
false
,
})
let
response
=
error
.
response
.
data
;
let
response
=
error
.
response
.
data
;
Alert
.
alert
(
''
,
response
.
msg
);
Alert
.
alert
(
''
,
response
.
msg
,
[
{
text
:
"OK"
,
onPress
:
()
=>
this
.
setState
({
spinner
:
false
})
}
],
);
})
})
}
}
render
()
{
render
()
{
return
(
return
(
<
View
style
=
{
styles
.
container
}
>
<
Scroll
View
style
=
{
styles
.
container
}
>
<
Spinner
<
Spinner
visible
=
{
this
.
state
.
spinner
}
visible
=
{
this
.
state
.
spinner
}
textContent
=
{
'Loading...'
}
textContent
=
{
'Loading...'
}
...
@@ -153,7 +162,7 @@ class CardActivation extends React.Component {
...
@@ -153,7 +162,7 @@ class CardActivation extends React.Component {
this
.
state
.
timer
===
0
?
(
this
.
state
.
timer
===
0
?
(
<
TouchableOpacity
onPress
=
{()
=>
this
.
ResendToken
()}
>
<
TouchableOpacity
onPress
=
{()
=>
this
.
ResendToken
()}
>
<
View
style
=
{{
height
:
40
,
borderRadius
:
20
,
backgroundColor
:
'#CFB368'
,
margin
:
20
,
justifyContent
:
'center'
}}
>
<
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
>
<
/View
>
<
/TouchableOpacity
>
<
/TouchableOpacity
>
)
:
(
null
)}
)
:
(
null
)}
...
@@ -166,7 +175,7 @@ class CardActivation extends React.Component {
...
@@ -166,7 +175,7 @@ class CardActivation extends React.Component {
onChangeText
=
{
card_number
=>
this
.
setState
({
card_number
})}
onChangeText
=
{
card_number
=>
this
.
setState
({
card_number
})}
value
=
{
this
.
state
.
card_number
}
value
=
{
this
.
state
.
card_number
}
keyboardType
=
'numeric'
keyboardType
=
'numeric'
/>
/>
<
/View
>
<
/View
>
<
/View
>
<
/View
>
<
View
style
=
{
styles
.
field_email
}
>
<
View
style
=
{
styles
.
field_email
}
>
...
@@ -188,7 +197,7 @@ class CardActivation extends React.Component {
...
@@ -188,7 +197,7 @@ class CardActivation extends React.Component {
<
/TouchableOpacity
>
<
/TouchableOpacity
>
<
/View
>
<
/View
>
<
/View
>
<
/View
>
<
/View
>
<
/
Scroll
View
>
)
)
}
}
}
}
...
...
view/Home.js
View file @
ed8222d5
...
@@ -342,10 +342,10 @@ class Home extends React.Component {
...
@@ -342,10 +342,10 @@ class Home extends React.Component {
<Text style={{ textAlign: 'center', color: '#fff', fontWeight: 'bold' }}>{i18n.t('pickup')}</Text>
<Text style={{ textAlign: 'center', color: '#fff', fontWeight: 'bold' }}>{i18n.t('pickup')}</Text>
</TouchableOpacity> */
}
</TouchableOpacity> */
}
<
TouchableOpacity
style
=
{
styles
.
buttonDeliveryTrue
}
onPress
=
{()
=>
this
.
_delivery
()}
>
<
TouchableOpacity
style
=
{
styles
.
buttonDeliveryTrue
}
onPress
=
{()
=>
this
.
_delivery
()}
>
<
Text
style
=
{{
textAlign
:
'center'
,
color
:
'#354175'
,
fontFamily
:
'Gotham-Black'
}}
>
{
i18n
.
t
(
'
_deliver
'
)}
<
/Text
>
<
Text
style
=
{{
textAlign
:
'center'
,
color
:
'#354175'
,
fontFamily
:
'Gotham-Black'
}}
>
{
i18n
.
t
(
'
delivery
'
)}
<
/Text
>
<
/TouchableOpacity
>
<
/TouchableOpacity
>
<
TouchableOpacity
style
=
{
styles
.
buttonPickupFalse
}
onPress
=
{()
=>
this
.
_pickup
()}
>
<
TouchableOpacity
style
=
{
styles
.
buttonPickupFalse
}
onPress
=
{()
=>
this
.
_pickup
()}
>
<
Text
style
=
{{
textAlign
:
'center'
,
color
:
'#fff'
,
fontFamily
:
'Gotham-Black'
}}
>
{
i18n
.
t
(
'
_
pickup'
)}
<
/Text
>
<
Text
style
=
{{
textAlign
:
'center'
,
color
:
'#fff'
,
fontFamily
:
'Gotham-Black'
}}
>
{
i18n
.
t
(
'pickup'
)}
<
/Text
>
<
/TouchableOpacity
>
<
/TouchableOpacity
>
<
/View
>
<
/View
>
{
/* <Text style={{ textAlign: 'center', fontSize: 12, }}>
{
/* <Text style={{ textAlign: 'center', fontSize: 12, }}>
...
...
view/UpgradePremium.js
View file @
ed8222d5
...
@@ -21,8 +21,14 @@ import {
...
@@ -21,8 +21,14 @@ import {
}
from
'react-native'
}
from
'react-native'
import
MyStatusBar
from
'./MyStatusBar'
;
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
{
class
UpgradePremium
extends
React
.
Component
{
constructor
(
props
)
{
constructor
(
props
)
{
super
(
props
)
super
(
props
)
...
@@ -298,16 +304,25 @@ class UpgradePremium extends React.Component {
...
@@ -298,16 +304,25 @@ class UpgradePremium extends React.Component {
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Black'
,
color
:
'#CFB368'
,
textAlign
:
'center'
}}
>
Pekerjaan
<
/Text
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Black'
,
color
:
'#CFB368'
,
textAlign
:
'center'
}}
>
Pekerjaan
<
/Text
>
<
/View
>
<
/View
>
<
View
style
=
{{
marginHorizontal
:
40
,
borderColor
:
'gray'
,
borderWidth
:
1
,
borderRadius
:
10
,
top
:
10
}}
>
<
View
style
=
{{
marginHorizontal
:
40
,
borderColor
:
'gray'
,
borderWidth
:
1
,
borderRadius
:
10
,
top
:
10
}}
>
<
Picker
{
Platform
.
OS
===
'ios'
?
(
mode
=
"dropdown"
<
RNPickerSelect
onValueChange
=
{(
value
)
=>
this
.
setState
({
pekerjaan
:
value
})}
selectedValue
=
{
this
.
state
.
pekerjaan
}
items
=
{
_jobs
}
style
=
{{
height
:
40
,
width
:
'100%'
}}
placeholder
=
{{
label
:
'-- Select --'
}}
onValueChange
=
{(
itemValue
,
itemIndex
)
=>
this
.
setState
({
pekerjaan
:
itemValue
})}
>
style
=
{{
inputIOSContainer
:
{
paddingVertical
:
10
,
alignItems
:
'center'
}}}
{
jobs
.
map
((
itemValue
,
itemIndex
)
=>
{
/
>
return
(
<
Picker
.
Item
label
=
{
itemValue
}
value
=
{
itemValue
}
key
=
{
itemIndex
}
/>
)
)
:
(
})}
<
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
>
<
View
style
=
{
styles
.
textLabel
,
{
top
:
20
}}
>
<
View
style
=
{
styles
.
textLabel
,
{
top
:
20
}}
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Black'
,
color
:
'#CFB368'
,
textAlign
:
'center'
}}
>
KTP
<
/Text
>
<
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