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
7d15e57f
Commit
7d15e57f
authored
Jul 06, 2020
by
Wahyu Adjie Prasetyo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug fatal error di tab mane selection
parent
0dae9f18
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
32 deletions
+35
-32
Item.js
view/Item.js
+5
-5
MenuSelection.js
view/MenuSelection.js
+30
-27
No files found.
view/Item.js
View file @
7d15e57f
...
@@ -68,7 +68,7 @@ class Item extends React.Component {
...
@@ -68,7 +68,7 @@ class Item extends React.Component {
{
item
.
code
==
'CATEGORY'
?
(
{
item
.
code
==
'CATEGORY'
?
(
<
Text
style
=
{{
fontSize
:
15
,
color
:
'#c9af6d'
,
fontFamily
:
'Gotham-Black'
}}
>
{
item
.
name
}
<
/Text
>
<
Text
style
=
{{
fontSize
:
15
,
color
:
'#c9af6d'
,
fontFamily
:
'Gotham-Black'
}}
>
{
item
.
name
}
<
/Text
>
)
:
(
)
:
(
<
View
style
=
{{
flex
:
1
,
flexDirection
:
'row'
}}
>
<
View
style
=
{{
flex
:
1
,
flexDirection
:
'row'
,
height
:
100
}}
>
<
Modal
animationType
=
"slide"
<
Modal
animationType
=
"slide"
transparent
=
{
true
}
transparent
=
{
true
}
visible
=
{
this
.
state
.
modalVisible
}
visible
=
{
this
.
state
.
modalVisible
}
...
@@ -85,7 +85,6 @@ class Item extends React.Component {
...
@@ -85,7 +85,6 @@ class Item extends React.Component {
style
=
{
styles
.
textInput
}
style
=
{
styles
.
textInput
}
onChangeText
=
{(
notes
)
=>
this
.
setState
({
notes
})}
onChangeText
=
{(
notes
)
=>
this
.
setState
({
notes
})}
textAlign
=
'center'
textAlign
=
'center'
>
>
{
item
.
note
}
{
item
.
note
}
<
/TextInput
>
<
/TextInput
>
...
@@ -105,12 +104,13 @@ class Item extends React.Component {
...
@@ -105,12 +104,13 @@ class Item extends React.Component {
<
/View
>
<
/View
>
<
/View
>
<
/View
>
<
/Modal
>
<
/Modal
>
<
View
style
=
{{
flex
:
1
}}
>
<
View
style
=
{{
flex
:
1
,
height
:
100
}}
>
<
TouchableOpacity
onPress
=
{()
=>
this
.
props
.
navigation
.
navigate
(
'Menu Detail'
,
{
nameMenu
:
item
.
name
,
desc
:
item
.
description
,
image
:
item
.
image
})}
>
<
TouchableOpacity
onPress
=
{()
=>
this
.
props
.
navigation
.
navigate
(
'Menu Detail'
,
{
nameMenu
:
item
.
name
,
desc
:
item
.
description
,
image
:
item
.
image
})}
>
<
Image
source
=
{{
uri
:
item
.
image
}}
style
=
{{
height
:
100
,
width
:
100
,
borderRadius
:
10
,
}}
><
/Image
>
{
/* <Image source={{ uri: item.image }} style={{ height: 100, width: 100, borderRadius: 10, }}></Image> */
}
<
Image
style
=
{{
height
:
100
,
width
:
100
,
borderRadius
:
10
,
}}
source
=
{
item
.
image
?
{
uri
:
item
.
image
}
:
null
}
/
>
<
/TouchableOpacity
>
<
/TouchableOpacity
>
<
/View
>
<
/View
>
<
View
style
=
{{
flex
:
2
}}
>
<
View
style
=
{{
flex
:
1
,
height
:
100
}}
>
<
View
style
=
{{
marginLeft
:
5
,
marginRight
:
5
}}
>
<
View
style
=
{{
marginLeft
:
5
,
marginRight
:
5
}}
>
{
{
item
.
motm
?
(
item
.
motm
?
(
...
...
view/MenuSelection.js
View file @
7d15e57f
import
React
from
'react'
;
import
React
from
'react'
;
import
{
View
,
Text
,
StyleSheet
,
ScrollView
,
Platform
,
TouchableOpacity
,
Image
,
FlatList
,
Button
,
StatusBar
,
ActivityIndicator
,
Alert
,
Modal
}
from
'react-native'
;
import
{
View
,
Text
,
StyleSheet
,
ScrollView
,
Platform
,
TouchableOpacity
,
Image
,
FlatList
,
Button
,
StatusBar
,
ActivityIndicator
,
Alert
,
Modal
}
from
'react-native'
;
import
Axios
from
'axios'
;
import
Axios
from
'axios'
;
import
Item
from
'./Item'
;
import
Item
from
'./Item'
;
import
{
connect
}
from
'react-redux'
;
import
{
connect
}
from
'react-redux'
;
...
@@ -31,7 +31,7 @@ class MenuSelection extends React.Component {
...
@@ -31,7 +31,7 @@ class MenuSelection extends React.Component {
indicator
:
true
,
indicator
:
true
,
my_lat
:
0
,
my_lat
:
0
,
my_long
:
0
,
my_long
:
0
,
note
:
''
note
:
''
}
}
}
}
...
@@ -98,13 +98,13 @@ class MenuSelection extends React.Component {
...
@@ -98,13 +98,13 @@ class MenuSelection extends React.Component {
_getOutletClosest
()
{
_getOutletClosest
()
{
let
params
=
Object
.
assign
(
requestParams
,{
let
params
=
Object
.
assign
(
requestParams
,
{
session_id
:
this
.
props
.
session_id
,
session_id
:
this
.
props
.
session_id
,
lat
:
this
.
state
.
my_lat
,
lat
:
this
.
state
.
my_lat
,
long
:
this
.
state
.
my_long
long
:
this
.
state
.
my_long
})
})
// console.log(params);
// console.log(params);
Axios
.
post
(
this
.
props
.
BASE_URL
+
'crm/v2/outlet/get_closest'
,
params
).
then
((
res
)
=>
{
Axios
.
post
(
this
.
props
.
BASE_URL
+
'crm/v2/outlet/get_closest'
,
params
).
then
((
res
)
=>
{
let
outletId
=
res
.
data
.
data
.
outlet_id
let
outletId
=
res
.
data
.
data
.
outlet_id
...
@@ -126,12 +126,12 @@ class MenuSelection extends React.Component {
...
@@ -126,12 +126,12 @@ class MenuSelection extends React.Component {
}
}
getMenuList
()
{
getMenuList
()
{
let
params
=
Object
.
assign
(
requestParams
,{
let
params
=
Object
.
assign
(
requestParams
,
{
outlet_id
:
this
.
props
.
outlet_id
outlet_id
:
this
.
props
.
outlet_id
})
})
// console.log("INI YA " + params)
// console.log("INI YA " + params)
Axios
.
post
(
this
.
props
.
BASE_URL
+
'crm/v2/menu/get_list'
,
params
).
then
(
res
=>
{
Axios
.
post
(
this
.
props
.
BASE_URL
+
'crm/v2/menu/get_list'
,
params
).
then
(
res
=>
{
let
data
=
res
.
data
.
data
let
data
=
res
.
data
.
data
// console.log("INI DATANYA" + JSON.stringify(data))
// console.log("INI DATANYA" + JSON.stringify(data))
...
@@ -191,11 +191,11 @@ class MenuSelection extends React.Component {
...
@@ -191,11 +191,11 @@ class MenuSelection extends React.Component {
<
TouchableOpacity
onPress
=
{()
=>
this
.
scrollToIndex
(
item
)}
>
<
TouchableOpacity
onPress
=
{()
=>
this
.
scrollToIndex
(
item
)}
>
{
item
.
image
===
''
?
(
{
item
.
image
===
''
?
(
<
View
style
=
{{
height
:
60
,
width
:
60
,
top
:
5
}}
/
>
<
View
style
=
{{
height
:
60
,
width
:
60
,
top
:
5
}}
/
>
)
:
)
:
(
(
<
Image
style
=
{{
height
:
60
,
width
:
60
,
top
:
5
}}
source
=
{{
uri
:
item
.
image
}}
/
>
<
Image
style
=
{{
height
:
60
,
width
:
60
,
top
:
5
}}
source
=
{{
uri
:
item
.
image
}}
/
>
)
)
}
}
<
/TouchableOpacity
>
<
/TouchableOpacity
>
<
/View
>
<
/View
>
)
)
...
@@ -206,9 +206,7 @@ class MenuSelection extends React.Component {
...
@@ -206,9 +206,7 @@ class MenuSelection extends React.Component {
}
}
scrollToItem
=
()
=>
{
scrollToItem
=
()
=>
{
this
.
props
.
_scrollView
.
scrollTo
({
y
:
1
*
100
});
this
.
props
.
_scrollView
.
scrollTo
({
y
:
1
*
100
});
}
}
handleAdd
(
item
,
index
)
{
handleAdd
(
item
,
index
)
{
...
@@ -245,7 +243,7 @@ class MenuSelection extends React.Component {
...
@@ -245,7 +243,7 @@ class MenuSelection extends React.Component {
}
}
clearNegatif
(
item
,
index
)
{
clearNegatif
(
item
,
index
)
{
...
@@ -296,17 +294,17 @@ class MenuSelection extends React.Component {
...
@@ -296,17 +294,17 @@ class MenuSelection extends React.Component {
scrollToIndex
=
(
item
)
=>
{
scrollToIndex
=
(
item
)
=>
{
index
=
_
.
findIndex
(
this
.
props
.
menu_item
,
[
'name'
,
item
.
name
])
index
=
_
.
findIndex
(
this
.
props
.
menu_item
,
[
'name'
,
item
.
name
])
if
(
index
>
-
1
)
{
if
(
index
>
-
1
)
{
this
.
flatListRef
.
scrollToIndex
({
animated
:
true
,
index
:
index
});
this
.
flatListRef
.
scrollToIndex
({
animated
:
true
,
index
:
index
});
}
}
}
}
render
()
{
render
()
{
return
(
return
(
<
View
style
=
{
styles
.
container
}
>
<
View
style
=
{
styles
.
container
}
>
{
Platform
.
OS
===
'ios'
?
(
{
Platform
.
OS
===
'ios'
?
(
<
CustomIosStatusBar
color
=
'#CFB368'
/>
<
CustomIosStatusBar
color
=
'#CFB368'
/>
)
:
(
)
:
(
<
StatusBar
backgroundColor
=
'#CFB368'
/>
<
StatusBar
backgroundColor
=
'#CFB368'
/>
)}
)}
<
View
style
=
{{
flex
:
0.5
,
height
:
50
,
flexDirection
:
'row'
,
paddingTop
:
StatusBar
.
currentHeight
}}
>
<
View
style
=
{{
flex
:
0.5
,
height
:
50
,
flexDirection
:
'row'
,
paddingTop
:
StatusBar
.
currentHeight
}}
>
<
FlatList
horizontal
=
{
true
}
style
=
{{
flexDirection
:
'row'
}}
<
FlatList
horizontal
=
{
true
}
style
=
{{
flexDirection
:
'row'
}}
...
@@ -317,7 +315,7 @@ class MenuSelection extends React.Component {
...
@@ -317,7 +315,7 @@ class MenuSelection extends React.Component {
/
>
/
>
<
/View
>
<
/View
>
<
View
style
=
{{
height
:
1
,
backgroundColor
:
'grey'
,
marginRight
:
10
,
marginLeft
:
10
,
marginTop
:
5
,
}}
><
/View
>
<
View
style
=
{{
height
:
1
,
backgroundColor
:
'grey'
,
marginRight
:
10
,
marginLeft
:
10
,
marginTop
:
5
,
}}
><
/View
>
<
View
style
=
{{
flex
:
3
,
marginRight
:
10
,
marginLeft
:
10
}}
>
<
View
style
=
{{
flex
:
3
,
marginRight
:
10
,
marginLeft
:
10
}}
>
{
this
.
state
.
indicator
==
true
?
(
{
this
.
state
.
indicator
==
true
?
(
<
ActivityIndicator
style
=
{{
top
:
10
}}
size
=
"large"
color
=
"#c9af6d"
/>
<
ActivityIndicator
style
=
{{
top
:
10
}}
size
=
"large"
color
=
"#c9af6d"
/>
)
:
(
)
:
(
...
@@ -330,8 +328,14 @@ class MenuSelection extends React.Component {
...
@@ -330,8 +328,14 @@ class MenuSelection extends React.Component {
handleMin
=
{()
=>
this
.
handleMin
(
item
,
index
)}
handleMin
=
{()
=>
this
.
handleMin
(
item
,
index
)}
/
>
/
>
)}
)}
getItemLayout
=
{(
data
,
index
)
=>
(
{
length
:
100
,
offset
:
100
*
index
,
index
}
)}
keyExtractor
=
{
item
=>
item
.
id
}
keyExtractor
=
{
item
=>
item
.
id
}
ref
=
{(
ref
)
=>
{
this
.
flatListRef
=
ref
;
}}
ref
=
{(
ref
)
=>
{
this
.
flatListRef
=
ref
;
}}
initialNumToRender
=
{
5
}
maxToRenderPerBatch
=
{
10
}
windowSize
=
{
10
}
/
>
/
>
)}
)}
<
/View
>
<
/View
>
...
@@ -339,13 +343,12 @@ class MenuSelection extends React.Component {
...
@@ -339,13 +343,12 @@ class MenuSelection extends React.Component {
<
/View
>
<
/View
>
<
View
style
=
{{
height
:
1
,
backgroundColor
:
'grey'
,
marginRight
:
10
,
marginLeft
:
10
,
marginTop
:
5
,
}}
><
/View
>
<
View
style
=
{{
height
:
1
,
backgroundColor
:
'grey'
,
marginRight
:
10
,
marginLeft
:
10
,
marginTop
:
5
,
}}
><
/View
>
<
View
style
=
{{
height
:
70
}}
>
<
View
style
=
{{
height
:
70
}}
>
<
View
style
=
{{
flex
:
1
,
flexDirection
:
'row'
}}
>
<
View
style
=
{{
flex
:
1
,
flexDirection
:
'row'
}}
>
<
View
style
=
{{
flex
:
1
,
justifyContent
:
'flex-start'
}}
>
<
View
style
=
{{
flex
:
1
,
justifyContent
:
'flex-start'
}}
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Black'
,
textAlign
:
'center'
,
top
:
10
,
color
:
'#838383'
}}
>
{
this
.
props
.
order_quantity
}
Item
{
this
.
props
.
type_pickup
==
true
?
(
null
)
:
(
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Black'
,
textAlign
:
'center'
,
top
:
10
,
color
:
'#838383'
}}
>
{
this
.
props
.
order_quantity
}
Item
{
this
.
props
.
type_pickup
==
true
?
(
null
)
:
(
<
NumberFormat
decimalScale
=
{
0
}
value
=
{
this
.
props
.
grabamount
}
renderText
=
{
value
=>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
,
top
:
20
,
textAlign
:
'center'
,
color
:
'#838383'
}}
>
/ {i18n.t
(
'rateDelivery'
)
} Rp. {value}</
Text
>
}
displayType
=
{
'text'
}
thousandSeparator
=
{
true
}
prefix
=
{
''
}
/
>
<
NumberFormat
decimalScale
=
{
0
}
value
=
{
this
.
props
.
grabamount
}
renderText
=
{
value
=>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
,
top
:
20
,
textAlign
:
'center'
,
color
:
'#838383'
}}
>
/ {i18n.t
(
'rateDelivery'
)
} Rp. {value}</
Text
>
}
displayType
=
{
'text'
}
thousandSeparator
=
{
true
}
prefix
=
{
''
}
/
>
)}
<
/Text
>
)}
<
/Text
>
<
NumberFormat
decimalScale
=
{
0
}
value
=
{
this
.
props
.
order_total
}
renderText
=
{
value
=>
<
Text
style
=
{{
fontSize
:
20
,
fontFamily
:
'Gotham-Light'
,
top
:
20
,
textAlign
:
'center'
,
color
:
'#838383'
}}
>
Rp
.
{
value
}
<
/Text>} displayType={'text'} thousandSeparator={true} prefix={''} /
>
<
NumberFormat
decimalScale
=
{
0
}
value
=
{
this
.
props
.
order_total
}
renderText
=
{
value
=>
<
Text
style
=
{{
fontSize
:
20
,
fontFamily
:
'Gotham-Light'
,
top
:
20
,
textAlign
:
'center'
,
color
:
'#838383'
}}
>
Rp
.
{
value
}
<
/Text>} displayType={'text'} thousandSeparator={true} prefix={''} /
>
<
/View
>
<
/View
>
<
View
style
=
{{
flex
:
1
,
height
:
100
}}
>
<
View
style
=
{{
flex
:
1
,
height
:
100
}}
>
<
TouchableOpacity
onPress
=
{()
=>
this
.
props
.
navigation
.
navigate
(
'Shopping Cart'
)}
>
<
TouchableOpacity
onPress
=
{()
=>
this
.
props
.
navigation
.
navigate
(
'Shopping Cart'
)}
>
...
@@ -369,7 +372,7 @@ const styles = StyleSheet.create({
...
@@ -369,7 +372,7 @@ const styles = StyleSheet.create({
container
:
{
container
:
{
flex
:
1
,
flex
:
1
,
backgroundColor
:
'white'
,
backgroundColor
:
'white'
,
},
},
// shadow: {
// shadow: {
...
...
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