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
3ee6baaf
Commit
3ee6baaf
authored
Apr 30, 2020
by
Trisno
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
fd26ccc5
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
199 additions
and
47 deletions
+199
-47
Auth.js
view/Auth.js
+4
-5
OrderDetail.js
view/OrderDetail.js
+117
-0
OrderHistory.js
view/OrderHistory.js
+3
-1
PickupName.js
view/PickupName.js
+29
-26
TransactionDetail.js
view/TransactionDetail.js
+42
-11
TransactionHistory.js
view/TransactionHistory.js
+4
-4
No files found.
view/Auth.js
View file @
3ee6baaf
...
...
@@ -43,10 +43,8 @@ import OutletDetail from './OutletDetails';
import
{
createBottomTabNavigator
}
from
'@react-navigation/bottom-tabs'
;
import
{
enableScreens
}
from
'react-native-screens'
;
import
MenuDetail
from
'./MenuDetail'
;
import
OrderHistory
from
'./OrderHistory'
import
{
TouchableOpacity
}
from
'react-native-gesture-handler'
;
import
{
StackActions
}
from
'@react-navigation/native'
;
import
{
NavigationActions
}
from
'react-navigation'
;
import
OrderHistory
from
'./OrderHistory'
;
import
OrderDetail
from
'./OrderDetail'
;
enableScreens
();
function
Rewards
()
{
...
...
@@ -168,10 +166,11 @@ class Auth extends React.Component {
<
Stack
.
Screen
name
=
"Menu Detail"
component
=
{
MenuDetail
}
/
>
<
Stack
.
Screen
name
=
"Pickup Name"
component
=
{
PickupName
}
options
=
{{
title
:
"PICKUP STORE"
,
headerStyle
:{
backgroundColor
:
"#ccb46c"
},
headerTitleAlign
:
'center'
,
headerTitleStyle
:{
color
:
'white'
,
fontWeight
:
'bold'
}}}
/
>
<
Stack
.
Screen
name
=
"Outlet Detail"
component
=
{
OutletDetail
}
/
>
<
Stack
.
Screen
name
=
"Menu Select"
component
=
{
MenuSelection
}
/
>
<
Stack
.
Screen
name
=
"Menu Select"
component
=
{
MenuSelection
}
options
=
{{
headerShown
:
false
}}
/
>
<
Stack
.
Screen
name
=
"Card Info"
component
=
{
CardInfo
}
/
>
<
Stack
.
Screen
name
=
"Shopping Cart"
component
=
{
ShoppingCart
}
/
>
<
Stack
.
Screen
name
=
"Order History"
component
=
{
OrderHistory
}
/
>
<
Stack
.
Screen
name
=
"Order Detail"
component
=
{
OrderDetail
}
/
>
<
/
>
)
...
...
view/OrderDetail.js
0 → 100644
View file @
3ee6baaf
import
React
from
'react'
;
import
{
View
,
Text
,
TextInput
,
StyleSheet
,
ScrollView
,
Alert
,
TouchableOpacity
}
from
'react-native'
;
import
{
Card
}
from
'react-native-shadow-cards'
import
{
connect
}
from
'react-redux'
;
import
Axios
from
'axios'
;
class
OrderDetail
extends
React
.
Component
{
constructor
(
props
)
{
super
(
props
)
this
.
state
=
{
trans_type_display
:
''
,
outlet
:
''
,
outlet_code
:
''
,
trans_status_display
:
''
,
transaction_detail
:[],
}
}
componentDidMount
()
{
this
.
getDetailTrans
()
}
getDetailTrans
()
{
let
params
=
{
session_id
:
this
.
props
.
session_id
,
transaction_id
:
this
.
props
.
route
.
params
.
idTrans
}
Axios
.
post
(
'https://excelsocrm.ravintoladev.com/crm/v2/transaction/detail'
,
params
).
then
(
res
=>
{
let
data
=
res
.
data
console
.
log
(
"INI OUTLET "
+
data
.
outlet
)
console
.
log
(
"OUTLET-CODE"
+
data
.
outlet_code
)
console
.
log
(
"TRANS-DISPLAY"
+
data
.
trans_type_display
)
this
.
setState
({
outlet
:
data
.
outlet
,
outlet_code
:
data
.
outlet_code
,
trans_status_display
:
data
.
trans_status_display
,
transaction_detail
:
data
.
transaction_detail
})
}).
catch
(
error
=>
{
let
response
=
error
.
response
.
data
;
Alert
.
alert
(
response
.
msg
);
})
}
render
()
{
// console.log(this.state.order_list)
return
(
<
View
style
=
{
styles
.
container
}
>
<
ScrollView
style
=
{
styles
.
body
}
>
<
View
>
<
Card
style
=
{{
padding
:
10
,
margin
:
10
,
alignContent
:
'center'
}}
>
<
Text
>
OUTLET
:
{
this
.
state
.
outlet
}
<
/Text
>
<
Text
>
OUTLET
CODE
:
{
this
.
state
.
outlet_code
}
<
/Text
>
<
Text
>
OUTLET
:
{
this
.
state
.
trans_status_display
}
<
/Text
>
<
/Card
>
<
Card
style
=
{{
padding
:
10
,
margin
:
10
,
alignContent
:
'center'
}}
>
{
this
.
state
.
transaction_detail
.
map
((
item
,
index
)
=>
{
return
(
<
View
key
=
{
index
}
>
<
Text
>
NAMA
ITEM
:
{
item
.
item_name
}
<
/Text
>
<
Text
>
QTY
:
{
item
.
item_quantity
}
<
/Text
>
<
Text
>
PRICE
:
{
item
.
item_price
}
<
/Text
>
<
Text
>
DISCOUNT
:
{
item
.
item_discount
}
<
/Text
>
<
View
style
=
{{
borderWidth
:
1
,
margin
:
10
}}
><
/View
>
<
Text
>
TOTAL
:
{
item
.
item_subtotal
}
<
/Text
>
<
/View
>
)
})
}
<
/Card
>
<
Card
style
=
{{
padding
:
10
,
margin
:
10
,
alignContent
:
'center'
}}
>
<
Text
>
{}
<
/Text
>
<
/Card
>
<
/View
>
<
/ScrollView
>
<
/View
>
)
}
}
const
styles
=
StyleSheet
.
create
({
container
:
{
flex
:
1
,
backgroundColor
:
'white'
,
},
header
:
{
flex
:
0.2
,
},
body
:
{
flex
:
3
,
margin
:
5
,
},
list_detail_order
:
{
flex
:
1
,
margin
:
20
,
borderWidth
:
1
,
}
})
const
mapStateToProps
=
(
state
)
=>
{
return
{
session_id
:
state
.
session_id
,
}
}
export
default
connect
(
mapStateToProps
)(
OrderDetail
);
\ No newline at end of file
view/OrderHistory.js
View file @
3ee6baaf
...
...
@@ -41,8 +41,10 @@ class OrderHistory extends React.Component {
return
(
<
View
style
=
{
styles
.
container
}
>
<
ScrollView
style
=
{
styles
.
body
}
>
{
this
.
state
.
order_list
.
map
((
item
,
key
)
=>
(
<
TouchableOpacity
key
=
{
key
}
onPress
=
{()
=>
this
.
props
.
navigation
.
navigate
(
'Order Detail'
,
{
idTrans
:
item
.
id
})}
>
<
View
key
=
{
key
}
>
<
Card
style
=
{{
padding
:
10
,
margin
:
10
,
alignContent
:
'center'
}}
>
<
Text
>
OUTLET
:
{
item
.
outlet
}
<
/Text
>
...
...
@@ -51,7 +53,7 @@ class OrderHistory extends React.Component {
<
Text
>
STATUS
:
{
item
.
trans_status_display
}
<
/Text
>
<
/Card
>
<
/View
>
<
/TouchableOpacity
>
))
}
<
/ScrollView
>
...
...
view/PickupName.js
View file @
3ee6baaf
...
...
@@ -197,7 +197,10 @@ class PickupName extends React.Component {
RenderItem
=
({
item
})
=>
{
return
(
<
View
>
<
TouchableOpacity
onPress
=
{()
=>
this
.
getOutletDetail
(
item
.
id
,
item
.
name
)}
>
<
View
style
=
{{
flexDirection
:
'row'
,
flex
:
1
}}
>
<
View
>
<
MaterialCommunityIcons
name
=
"map-marker"
size
=
{
32
}
color
=
"brown"
/>
<
/View
>
...
...
@@ -214,17 +217,17 @@ class PickupName extends React.Component {
<
/Text
>
<
/View
>
<
View
>
<
TouchableOpacity
onPress
=
{()
=>
this
.
getOutletDetail
(
item
.
id
,
item
.
name
)}
>
<
CheckBox
center
checkedIcon
=
'dot-circle-o'
uncheckedIcon
=
'circle-o'
checked
=
{
this
.
state
.
checked
}
/
>
<
/TouchableOpacity
>
<
/View
>
<
/View
>
<
/TouchableOpacity
>
<
/View
>
);
}
render
()
{
...
...
view/TransactionDetail.js
View file @
3ee6baaf
...
...
@@ -9,11 +9,18 @@ class TransactionDetail extends React.Component {
super
(
props
)
this
.
state
=
{
transDetail
:
[],
trans
D
ate
:
''
,
trans
_d
ate
:
''
,
transDiscount
:
''
,
transId
:
''
,
transTax
:
''
,
transTotal
:
''
transTotal
:
''
,
trans_type_display
:
''
,
outlet
:
''
,
outlet_code
:
''
,
trans_time
:
''
,
trans_total
:
''
,
point_reduce
:
''
,
transaction_detail
:
[]
}
}
...
...
@@ -27,18 +34,22 @@ class TransactionDetail extends React.Component {
transaction_id
:
this
.
props
.
route
.
params
.
idTrans
}
Axios
.
post
(
'https://excelsocrm.ravintoladev.com/crm/v2/transaction/detail'
,
params
).
then
(
res
=>
{
console
.
log
(
"INI DATA NYA LHOOOOO ......."
+
JSON
.
stringify
(
res
.
data
))
let
data
=
res
.
data
console
.
log
(
data
)
this
.
setState
({
trans_type_display
:
data
.
trans_type_display
,
transId
:
data
.
trans_id
,
trans
D
ate
:
data
.
trans_date
,
trans
_d
ate
:
data
.
trans_date
,
transTotal
:
data
.
trans_total
,
transDetail
:
data
.
transaction_detail
outlet
:
data
.
outlet
,
outlet_code
:
data
.
outlet_code
,
trans_time
:
data
.
trans_time
,
trans_total
:
data
.
trans_total
,
point_reduce
:
data
.
point_reduce
,
transaction_detail
:
data
.
transaction_detail
})
// console.log(this.state.history_list)
}).
catch
(
error
=>
{
let
response
=
error
.
response
.
data
;
Alert
.
alert
(
response
.
msg
);
})
}
...
...
@@ -50,11 +61,31 @@ class TransactionDetail extends React.Component {
<
/View
>
<
View
style
=
{
styles
.
body
}
>
<
Card
style
=
{{
padding
:
10
,
margin
:
10
,
alignContent
:
'center'
}}
>
<
Text
>
Jenis
Transaksi
:
{
this
.
state
.
trans
Id
}
<
/Text
>
<
Text
>
Tanggal
:
{
this
.
state
.
trans
D
ate
}
<
/Text
>
<
Text
>
Jenis
Transaksi
:
{
this
.
state
.
trans
_type_display
}
<
/Text
>
<
Text
>
Tanggal
:
{
this
.
state
.
trans
_d
ate
}
<
/Text
>
<
Text
>
Total
:
{
this
.
state
.
transTotal
}
<
/Text
>
<
Text
>
Detail
:
{
this
.
state
.
transDetail
}
<
/Text
>
<
Button
title
=
"OK"
onPress
=
{()
=>
this
.
props
.
navigation
.
goBack
()}
/
>
<
Text
>
Waktu
Transaksi
:
{
this
.
state
.
trans_time
}
<
/Text
>
<
Text
>
Poin
reduce
:
{
this
.
state
.
point_reduce
}
<
/Text
>
<
Text
>
Total
:
{
this
.
state
.
outlet_code
}
<
/Text
>
<
Text
>
Total
:
{
this
.
state
.
outlet_code
}
<
/Text
>
<
/Card
>
<
Card
style
=
{{
padding
:
10
,
margin
:
10
,
alignContent
:
'center'
}}
>
{
this
.
state
.
transaction_detail
.
map
((
item
,
index
)
=>
{
return
(
<
View
key
=
{
index
}
>
<
Text
>
NAMA
ITEM
:
{
item
.
item_name
}
<
/Text
>
<
Text
>
QTY
:
{
item
.
item_quantity
}
<
/Text
>
<
Text
>
PRICE
:
{
item
.
item_price
}
<
/Text
>
<
Text
>
DISCOUNT
:
{
item
.
item_discount
}
<
/Text
>
<
View
style
=
{{
borderWidth
:
1
,
margin
:
10
}}
><
/View
>
<
Text
>
TOTAL
:
{
item
.
item_subtotal
}
<
/Text
>
<
/View
>
)
})
}
<
/Card
>
<
/View
>
...
...
view/TransactionHistory.js
View file @
3ee6baaf
...
...
@@ -22,7 +22,7 @@ class TransactionHistory extends React.Component {
}
Axios
.
post
(
'https://excelsocrm.ravintoladev.com/crm/v2/transaction/history'
,
params
).
then
(
res
=>
{
let
data
=
res
.
data
.
transactions
//
console.log('ini datanya loh : ' + JSON.stringify(data))
console
.
log
(
'ini datanya loh : '
+
JSON
.
stringify
(
data
))
this
.
setState
({
history_list
:
data
})
...
...
@@ -43,9 +43,9 @@ class TransactionHistory extends React.Component {
item
.
transactions
.
map
((
i
,
k
)
=>
(
<
TouchableOpacity
key
=
{
k
}
onPress
=
{()
=>
this
.
props
.
navigation
.
navigate
(
'Transaction Detail'
,
{
idTrans
:
i
.
id
})}
>
<
Card
style
=
{{
padding
:
10
,
margin
:
10
,
alignContent
:
'center'
}}
>
<
Text
>
{
i
.
trans_id
}
<
/Text
>
<
Text
>
{
i
.
trans_date
}
<
/Text
>
<
Text
>
{
i
.
trans_total
}
<
/Text
>
<
Text
>
TANGGAL
:
{
i
.
trans_date
}
<
/Text
>
<
Text
>
TOTAL
:
{
i
.
trans_total
}
<
/Text
>
<
Text
>
TRANSAKSI
:
{
i
.
trans_type_display
}
<
/Text
>
<
/Card
>
<
/TouchableOpacity
>
))
...
...
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