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
5d180b47
Commit
5d180b47
authored
May 27, 2020
by
Trisno
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
ssh://repo.cs.co.id:2222/wahyu/bahanoprek
parents
0da47714
e0639065
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
56 additions
and
45 deletions
+56
-45
Outlets.js
view/Outlets.js
+56
-45
No files found.
view/Outlets.js
View file @
5d180b47
...
...
@@ -107,7 +107,7 @@ class Outlets extends React.Component {
}
dataOutlets
[
i
][
'full_address'
]
=
address
;
console
.
log
(
"INI YAA: "
+
JSON
.
stringify
(
dataOutlets
));
//
console.log("INI YAA: " + JSON.stringify(dataOutlets));
}
this
.
setState
({
...
...
@@ -143,7 +143,7 @@ class Outlets extends React.Component {
}
}
console
.
log
(
"ISI DATANYA : "
+
JSON
.
stringify
(
data_city
))
//
console.log("ISI DATANYA : " + JSON.stringify(data_city))
this
.
setState
({
data_outlet
:
data_city
...
...
@@ -173,9 +173,9 @@ class Outlets extends React.Component {
data_name
:
outletName
})
console
.
log
(
"INI ADALAH RESPON : + "
+
JSON
.
stringify
(
res
))
//
console.log("INI ADALAH RESPON : + " + JSON.stringify(res))
console
.
log
(
"INI DATANYA NAME : "
+
outletName
)
//
console.log("INI DATANYA NAME : " + outletName)
}).
catch
(
error
=>
{
const
{
navigation
}
=
this
.
props
let
response
=
error
.
response
.
data
...
...
@@ -226,34 +226,36 @@ class Outlets extends React.Component {
RenderItem
=
({
item
})
=>
{
return
(
<
View
style
=
{{
flexDirection
:
'row'
,
flex
:
6
}}
>
<
View
style
=
{
styles
.
list_addrees
}
>
<
Text
style
=
{{
fontFamily
:
'Gotham-Black'
,
color
:
'#ccb46c'
,
fontSize
:
18
,
margin
:
5
}}
>
{
item
.
name
}
<
/Text
>
<
Text
style
=
{{
fontFamily
:
'Gotham-Light'
,
color
:
'#b1b1b2'
,
fontSize
:
12
,
margin
:
5
}}
>
{
item
.
full_address
}
<
/Text
>
<
Text
style
=
{{
fontFamily
:
'Gotham-Light'
,
margin
:
5
,
color
:
'#aeaead'
}}
>
{
item
.
distance
}
KM
<
View
style
=
{{
flexDirection
:
'row'
,
flex
:
1
,
marginRight
:
10
,
marginLeft
:
10
,
marginBottom
:
10
}}
>
<
View
style
=
{
styles
.
content_list
}
>
<
View
style
=
{
styles
.
list_addrees
}
>
<
Text
style
=
{{
fontFamily
:
'Gotham-Black'
,
color
:
'#ccb46c'
,
fontSize
:
18
,
margin
:
1
}}
>
{
item
.
name
}
<
/Text
>
<
Text
style
=
{{
flexWrap
:
'wrap'
,
fontFamily
:
'Gotham-Light'
,
color
:
'#b1b1b2'
}}
>
{
item
.
full_address
}
<
/Text
>
<
Text
style
=
{{
fontFamily
:
'Gotham-Light'
,
color
:
'#aeaead'
}}
>
{
item
.
distance
}
KM
<
/Text
>
<
/View
>
<
View
style
=
{{
flex
:
4
,
flexDirection
:
'row'
}}
>
<
View
style
=
{{
flex
:
2
,
top
:
20
}}
>
<
TouchableOpacity
onPress
=
{()
=>
{
Linking
.
openURL
(
'tel:'
+
item
.
phone
)
}}
>
<
Icon
name
=
'ios-call'
type
=
'ionicon'
color
=
'grey'
size
=
{
30
}
/
>
<
/TouchableOpacity
>
<
/View
>
<
View
style
=
{{
flex
:
2
,
top
:
20
}}
>
<
TouchableOpacity
onPress
=
{()
=>
Linking
.
openURL
(
'https://www.google.com/maps/dir/?api=1&destination='
+
item
.
lat
+
' '
+
item
.
long
)}
>
<
Icon
name
=
'ios-navigate'
type
=
'ionicon'
color
=
'grey'
size
=
{
30
}
/
>
<
/TouchableOpacity
>
<
View
style
=
{{
flex
:
2
,
flexDirection
:
'row'
}}
>
<
View
style
=
{{
margin
:
5
}}
>
<
TouchableOpacity
onPress
=
{()
=>
{
Linking
.
openURL
(
'tel:'
+
item
.
phone
)
}}
>
<
Icon
name
=
'ios-call'
type
=
'ionicon'
color
=
'grey'
size
=
{
38
}
/
>
<
/TouchableOpacity
>
<
/View
>
<
View
style
=
{{
margin
:
5
}}
>
<
TouchableOpacity
onPress
=
{()
=>
Linking
.
openURL
(
'https://www.google.com/maps/dir/?api=1&destination='
+
item
.
lat
+
' '
+
item
.
long
)}
>
<
Icon
name
=
'ios-navigate'
type
=
'ionicon'
color
=
'grey'
size
=
{
38
}
/
>
<
/TouchableOpacity
>
<
/View
>
<
/View
>
<
/View
>
<
/View
>
...
...
@@ -263,13 +265,13 @@ class Outlets extends React.Component {
return
(
<
View
style
=
{
styles
.
container
}
>
<
Spinner
{
/*
<Spinner
visible={this.state.spinner}
textContent={'Loading...'}
textStyle={styles.spinnerTextStyle}
/
>
/>
*/
}
<
View
style
=
{{
flex
:
1
}}
>
<
MapView
style
=
{{
flex
:
1
}}
<
MapView
style
=
{{
flex
:
1
,
marginRight
:
10
,
marginLeft
:
10
}}
region
=
{{
latitude
:
this
.
state
.
my_lat
,
longitude
:
this
.
state
.
my_long
,
...
...
@@ -292,18 +294,23 @@ class Outlets extends React.Component {
<
/MapView
>
<
/View
>
<
View
style
=
{{
height
:
50
,
flexDirection
:
'row'
}}
>
<
View
style
=
{{
flex
:
1
}}
><
/View
>
<
View
style
=
{{
flex
:
1
}}
>
<
RNPickerSelect
placeholder
=
{{
label
:
'Select Area'
,
value
:
null
}}
onValueChange
=
{(
label
)
=>
this
.
filterData
(
label
)}
items
=
{
this
.
state
.
data_outlet
}
/
>
<
/View
>
<
View
style
=
{{
height
:
50
,
flexDirection
:
'row'
}}
>
<
View
style
=
{{
flex
:
1
}}
><
/View
>
<
View
style
=
{{
flex
:
1
}}
>
<
RNPickerSelect
placeholder
=
{{
label
:
'Select Area'
,
value
:
null
}}
onValueChange
=
{(
label
)
=>
this
.
filterData
(
label
)}
items
=
{
this
.
state
.
data_outlet
}
/
>
<
/View
>
<
/View
>
{
/* <View style={{ height:50, flex: 1, flexDirection: 'row' }}>
<View style={{flex:1}}>
</View>
</View> */
}
<
View
style
=
{
styles
.
body
}
>
<
FlatList
data
=
{
_
.
orderBy
(
this
.
state
.
dataOutlets
,
[
'distance'
],
[
'asc'
])}
...
...
@@ -325,6 +332,7 @@ const styles = StyleSheet.create({
container
:
{
flex
:
1
,
backgroundColor
:
'white'
,
},
header
:
{
...
...
@@ -336,13 +344,16 @@ const styles = StyleSheet.create({
},
list_addrees
:
{
flex
:
6
,
margin
:
20
,
},
searchbar
:
{
flex
:
1
,
justifyContent
:
'center'
,
margin
:
10
,
},
content_list
:{
flex
:
1
,
flexDirection
:
'row'
,
}
})
...
...
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