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
28c2ce01
Commit
28c2ce01
authored
May 22, 2020
by
Trisno
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tampil 'no data' di trans history
parent
73aeb818
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
52 additions
and
40 deletions
+52
-40
OrderHistory.js
view/OrderHistory.js
+24
-18
TransactionHistory.js
view/TransactionHistory.js
+28
-22
No files found.
view/OrderHistory.js
View file @
28c2ce01
...
...
@@ -69,29 +69,35 @@ class OrderHistory extends React.Component {
<
/View
>
<
ScrollView
style
=
{
styles
.
body
}
>
{
this
.
state
.
indicator
==
true
?
(
<
ActivityIndicator
style
=
{{
justifyContent
:
"center"
}}
size
=
"large"
color
=
"#c9af6d"
/>
)
:
this
.
state
.
order_list
.
map
((
item
,
key
)
=>
(
<
TouchableOpacity
key
=
{
key
}
onPress
=
{()
=>
this
.
props
.
navigation
.
navigate
(
'Order Detail'
,
{
idTrans
:
item
.
id
})}
>
<
View
style
=
{{
marginTop
:
5
}}
key
=
{
key
}
>
<
View
style
=
{{
flex
:
2
,
height
:
120
,
margin
:
5
,
borderRadius
:
5
,
borderWidth
:
1
,
flexDirection
:
'row'
}}
>
<
View
style
=
{{
justifyContent
:
'center'
,
margin
:
10
}}
>
<
Text
style
=
{{
fontFamily
:
'Gotham-Black'
,
color
:
'grey'
,
fontSize
:
12
,
margin
:
2
}}
>
{
item
.
outlet
}
<
/Text
>
<
Text
style
=
{{
fontFamily
:
'Gotham-Light'
,
color
:
'grey'
,
fontSize
:
12
,
margin
:
2
}}
>
{
moment
(
item
.
trans_time
).
format
(
"DD MMMM YYYY, hh:mm A"
)}
<
/Text
>
<
Text
style
=
{{
fontFamily
:
'Gotham-Black'
,
color
:
'#c9af6d'
,
fontSize
:
12
,
margin
:
2
}}
>
{
item
.
trans_type_display
}
<
/Text
>
<
TouchableOpacity
onPress
=
{()
=>
this
.
props
.
navigation
.
navigate
(
'Order Detail'
,
{
idTrans
:
item
.
id
})}
>
<
View
style
=
{{
height
:
40
,
borderRadius
:
10
,
backgroundColor
:
'#CFB368'
,
justifyContent
:
'center'
}}
>
<
Text
style
=
{{
fontFamily
:
'Gotham-Black'
,
color
:
'white'
,
fontSize
:
12
,
textAlign
:
'center'
,
margin
:
15
}}
>
Lihat
Detail
Pemesanan
<
/Text
>
this
.
state
.
order_list
.
length
?
(
this
.
state
.
order_list
.
map
((
item
,
key
)
=>
(
<
TouchableOpacity
key
=
{
key
}
onPress
=
{()
=>
this
.
props
.
navigation
.
navigate
(
'Order Detail'
,
{
idTrans
:
item
.
id
})}
>
<
View
style
=
{{
marginTop
:
5
}}
key
=
{
key
}
>
<
View
style
=
{{
flex
:
2
,
height
:
120
,
margin
:
5
,
borderRadius
:
5
,
borderWidth
:
1
,
flexDirection
:
'row'
}}
>
<
View
style
=
{{
justifyContent
:
'center'
,
margin
:
10
}}
>
<
Text
style
=
{{
fontFamily
:
'Gotham-Black'
,
color
:
'grey'
,
fontSize
:
12
,
margin
:
2
}}
>
{
item
.
outlet
}
<
/Text
>
<
Text
style
=
{{
fontFamily
:
'Gotham-Light'
,
color
:
'grey'
,
fontSize
:
12
,
margin
:
2
}}
>
{
moment
(
item
.
trans_time
).
format
(
"DD MMMM YYYY, hh:mm A"
)}
<
/Text
>
<
Text
style
=
{{
fontFamily
:
'Gotham-Black'
,
color
:
'#c9af6d'
,
fontSize
:
12
,
margin
:
2
}}
>
{
item
.
trans_type_display
}
<
/Text
>
<
TouchableOpacity
onPress
=
{()
=>
this
.
props
.
navigation
.
navigate
(
'Order Detail'
,
{
idTrans
:
item
.
id
})}
>
<
View
style
=
{{
height
:
40
,
borderRadius
:
10
,
backgroundColor
:
'#CFB368'
,
justifyContent
:
'center'
}}
>
<
Text
style
=
{{
fontFamily
:
'Gotham-Black'
,
color
:
'white'
,
fontSize
:
12
,
textAlign
:
'center'
,
margin
:
15
}}
>
Lihat
Detail
Pemesanan
<
/Text
>
<
/View
>
<
/TouchableOpacity
>
<
/View
>
<
View
style
=
{{
justifyContent
:
'center'
,
marginVertical
:
5
,
marginLeft
:
20
,
borderLeftWidth
:
1
,
borderColor
:
'grey'
}}
>
<
View
style
=
{{
margin
:
30
}}
>
<
Text
style
=
{{
fontFamily
:
'Gotham-Black'
,
color
:
'#c9af6d'
,
fontSize
:
12
,
margin
:
2
}}
>
{
item
.
trans_status_display
}
<
/Text
>
<
/View
>
<
/TouchableOpacity
>
<
/View
>
<
View
style
=
{{
justifyContent
:
'center'
,
marginVertical
:
5
,
marginLeft
:
20
,
borderLeftWidth
:
1
,
borderColor
:
'grey'
}}
>
<
View
style
=
{{
margin
:
30
}}
>
<
Text
style
=
{{
fontFamily
:
'Gotham-Black'
,
color
:
'#c9af6d'
,
fontSize
:
12
,
margin
:
2
}}
>
{
item
.
trans_status_display
}
<
/Text
>
<
/View
>
<
/View
>
<
/View
>
<
/TouchableOpacity
>
))
)
:
(
<
View
style
=
{{
justifyContent
:
'center'
,
alignItems
:
'center'
,
height
:
100
}}
>
<
Text
style
=
{{
textAlign
:
'left'
,
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
,
color
:
'grey'
}}
>
No
Order
History
<
/Text
>
<
/View
>
<
/TouchableOpacity
>
))
)
}
<
/ScrollView
>
<
/View
>
...
...
view/TransactionHistory.js
View file @
28c2ce01
...
...
@@ -27,7 +27,7 @@ class TransactionHistory extends React.Component {
this
.
setState
({
history_list
:
data
})
}).
catch
(
error
=>
{
let
response
=
error
.
response
.
data
;
Alert
.
alert
(
response
.
msg
);
...
...
@@ -39,32 +39,38 @@ class TransactionHistory extends React.Component {
<
View
style
=
{
styles
.
container
}
>
<
ScrollView
style
=
{
styles
.
body
}
>
{
this
.
state
.
history_list
.
map
((
item
)
=>
(
this
.
state
.
history_list
.
length
?
(
this
.
state
.
history_list
.
map
((
item
)
=>
(
item
.
transactions
.
map
((
i
,
k
)
=>
(
<
TouchableOpacity
key
=
{
k
}
onPress
=
{()
=>
this
.
props
.
navigation
.
navigate
(
'Transaction Detail'
,
{
idTrans
:
i
.
id
})}
>
<
View
style
=
{{
marginTop
:
5
}}
key
=
{
k
}
>
<
View
style
=
{{
flex
:
2
,
height
:
120
,
margin
:
5
,
borderRadius
:
5
,
borderWidth
:
1
,
flexDirection
:
'row'
}}
>
<
View
style
=
{{
justifyContent
:
'center'
,
margin
:
10
}}
>
<
Text
style
=
{{
fontFamily
:
'Gotham-Black'
,
color
:
'grey'
,
fontSize
:
12
,
margin
:
2
}}
>
{
i
.
outlet
}
<
/Text
>
<
Text
style
=
{{
fontFamily
:
'Gotham-Light'
,
color
:
'grey'
,
fontSize
:
12
,
margin
:
2
}}
>
{
moment
(
i
.
trans_time
).
format
(
"DD MMMM YYYY, hh:mm A"
)}
<
/Text
>
<
Text
style
=
{{
fontFamily
:
'Gotham-Black'
,
color
:
'#c9af6d'
,
fontSize
:
12
,
margin
:
2
}}
>
{
i
.
trans_type_display
}
<
/Text
>
<
TouchableOpacity
onPress
=
{()
=>
this
.
props
.
navigation
.
navigate
(
'Transaction Detail'
,
{
idTrans
:
i
.
id
})}
>
<
View
style
=
{{
height
:
40
,
borderRadius
:
10
,
backgroundColor
:
'#CFB368'
,
justifyContent
:
'center'
}}
>
<
Text
style
=
{{
fontFamily
:
'Gotham-Black'
,
color
:
'white'
,
fontSize
:
12
,
textAlign
:
'center'
,
margin
:
15
}}
>
Lihat
Detail
Transaksi
<
/Text
>
item
.
transactions
.
map
((
i
,
k
)
=>
(
<
TouchableOpacity
key
=
{
k
}
onPress
=
{()
=>
this
.
props
.
navigation
.
navigate
(
'Transaction Detail'
,
{
idTrans
:
i
.
id
})}
>
<
View
style
=
{{
marginTop
:
5
}}
key
=
{
k
}
>
<
View
style
=
{{
flex
:
2
,
height
:
120
,
margin
:
5
,
borderRadius
:
5
,
borderWidth
:
1
,
flexDirection
:
'row'
}}
>
<
View
style
=
{{
justifyContent
:
'center'
,
margin
:
10
}}
>
<
Text
style
=
{{
fontFamily
:
'Gotham-Black'
,
color
:
'grey'
,
fontSize
:
12
,
margin
:
2
}}
>
{
i
.
outlet
}
<
/Text
>
<
Text
style
=
{{
fontFamily
:
'Gotham-Light'
,
color
:
'grey'
,
fontSize
:
12
,
margin
:
2
}}
>
{
moment
(
i
.
trans_time
).
format
(
"DD MMMM YYYY, hh:mm A"
)}
<
/Text
>
<
Text
style
=
{{
fontFamily
:
'Gotham-Black'
,
color
:
'#c9af6d'
,
fontSize
:
12
,
margin
:
2
}}
>
{
i
.
trans_type_display
}
<
/Text
>
<
TouchableOpacity
onPress
=
{()
=>
this
.
props
.
navigation
.
navigate
(
'Transaction Detail'
,
{
idTrans
:
i
.
id
})}
>
<
View
style
=
{{
height
:
40
,
borderRadius
:
10
,
backgroundColor
:
'#CFB368'
,
justifyContent
:
'center'
}}
>
<
Text
style
=
{{
fontFamily
:
'Gotham-Black'
,
color
:
'white'
,
fontSize
:
12
,
textAlign
:
'center'
,
margin
:
15
}}
>
Lihat
Detail
Transaksi
<
/Text
>
<
/View
>
<
/TouchableOpacity
>
<
/View
>
<
View
style
=
{{
justifyContent
:
'center'
,
marginVertical
:
5
,
marginLeft
:
20
,
borderLeftWidth
:
1
,
borderColor
:
'grey'
}}
>
<
View
style
=
{{
margin
:
30
}}
>
<
Text
style
=
{{
fontFamily
:
'Gotham-Black'
,
color
:
'#c9af6d'
,
fontSize
:
12
,
margin
:
2
}}
>
{
i
.
trans_status_display
}
<
/Text
>
<
/View
>
<
/View
>
<
/TouchableOpacity
>
<
/View
>
<
View
style
=
{{
justifyContent
:
'center'
,
marginVertical
:
5
,
marginLeft
:
20
,
borderLeftWidth
:
1
,
borderColor
:
'grey'
}}
>
<
View
style
=
{{
margin
:
30
}}
>
<
Text
style
=
{{
fontFamily
:
'Gotham-Black'
,
color
:
'#c9af6d'
,
fontSize
:
12
,
margin
:
2
}}
>
{
i
.
trans_status_display
}
<
/Text
>
<
/View
>
<
/View
>
<
/View
>
<
/View
>
<
/TouchableOpacity
>
<
/TouchableOpacity
>
))
))
))
)
:
(
<
View
style
=
{{
justifyContent
:
'center'
,
alignItems
:
'center'
,
height
:
100
}}
>
<
Text
style
=
{{
textAlign
:
'left'
,
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
,
color
:
'grey'
}}
>
No
Transaction
History
<
/Text
>
<
/View
>
)
}
<
/ScrollView
>
<
/View
>
...
...
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