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
c494cd05
Commit
c494cd05
authored
Jun 25, 2020
by
Trisno
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update jenis transaksi dine in
parent
dbbc3b2f
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
157 additions
and
85 deletions
+157
-85
OrderDetail.js
view/OrderDetail.js
+157
-85
No files found.
view/OrderDetail.js
View file @
c494cd05
...
...
@@ -92,7 +92,7 @@ class OrderDetail extends React.Component {
reason
:
"Cancelled By User"
}
// console.log(params)
Axios
.
post
(
this
.
props
.
BASE_URL
+
'crm/v2/transaction/cancel'
,
params
).
then
(
res
=>
{
Axios
.
post
(
this
.
props
.
BASE_URL
+
'crm/v2/transaction/cancel'
,
params
).
then
(
res
=>
{
let
respon
=
res
.
data
.
status
Alert
.
alert
(
respon
,
'Order was canceled'
)
this
.
props
.
navigation
.
navigate
(
'Home'
,
{
screen
:
'ORDER'
});
...
...
@@ -112,7 +112,7 @@ class OrderDetail extends React.Component {
transaction_id
:
this
.
props
.
route
.
params
.
idTrans
}
// console.log("PARAMETER : " + JSON.stringify(params))
Axios
.
post
(
this
.
props
.
BASE_URL
+
'crm/v2/transaction/detail'
,
params
).
then
(
res
=>
{
Axios
.
post
(
this
.
props
.
BASE_URL
+
'crm/v2/transaction/detail'
,
params
).
then
(
res
=>
{
let
data
=
res
.
data
// console.log(data)
if
(
data
.
trans_status_display
==
'On Queue'
)
{
...
...
@@ -153,6 +153,7 @@ class OrderDetail extends React.Component {
cancelled_reason
:
data
.
cancelled_reason
})
console
.
log
(
this
.
state
.
detail_trans
)
}).
catch
(
error
=>
{
let
response
=
error
.
response
.
data
;
Alert
.
alert
(
error
,
response
.
msg
);
...
...
@@ -243,39 +244,49 @@ class OrderDetail extends React.Component {
{
this
.
state
.
detail_trans
.
trans_type
_display
==
'Pick Up'
?
(
this
.
state
.
detail_trans
.
trans_type
==
1
?
(
<
View
style
=
{{
flex
:
1
,
flexDirection
:
'row'
,
borderBottomWidth
:
1
,
borderColor
:
'grey'
,
marginHorizontal
:
10
,
padding
:
10
}}
>
<
View
style
=
{{
flex
:
0.1
,
justifyContent
:
'center'
}}
>
<
FontAwesome
name
=
"map-marker"
size
=
{
24
}
color
=
"#d34343"
/>
<
/View
>
{
this
.
state
.
detail_trans
.
trans_type
_display
==
'Pick Up'
?
(
this
.
state
.
detail_trans
.
trans_type
==
1
?
(
<
View
style
=
{{
flex
:
0.6
,
justifyContent
:
'center'
}}
>
<
Text
style
=
{{
fontSize
:
14
,
fontFamily
:
'Gotham-Black'
,
color
:
'grey'
}}
>
{
this
.
state
.
detail_trans
.
outlet
}
<
/Text
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
,
color
:
'grey'
}}
>
{
this
.
state
.
detail_trans
.
outlet_address
}
<
/Text
>
<
/View
>
)
:
(
)
:
this
.
state
.
detail_trans
.
trans_type
==
2
?
(
<
View
style
=
{{
flex
:
0.6
,
justifyContent
:
'center'
}}
>
<
Text
style
=
{{
fontSize
:
14
,
fontFamily
:
'Gotham-Black'
,
color
:
'grey'
}}
>
{
this
.
state
.
detail_trans
.
recipient_address_name
}
<
/Text
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
,
color
:
'grey'
}}
>
{
this
.
state
.
detail_trans
.
recipient_address
}
<
/Text
>
<
/View
>
)
:
(
<
View
style
=
{{
flex
:
0.6
,
justifyContent
:
'center'
}}
>
<
Text
style
=
{{
fontSize
:
14
,
fontFamily
:
'Gotham-Black'
,
color
:
'grey'
}}
>
{
this
.
state
.
detail_trans
.
outlet
}
<
/Text
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
,
color
:
'grey'
}}
>
{
this
.
state
.
detail_trans
.
outlet_address
}
<
/Text
>
<
/View
>
)
}
{
this
.
state
.
detail_trans
.
trans_type
_display
==
'Pick Up'
?
(
this
.
state
.
detail_trans
.
trans_type
==
1
?
(
<
View
style
=
{{
flex
:
0.3
,
justifyContent
:
'center'
}}
>
<
Text
style
=
{{
textAlign
:
'right'
,
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
,
color
:
'grey'
}}
>
{
i18n
.
t
(
'pickup'
)}
<
/Text
>
<
/View
>
)
:
(
)
:
this
.
state
.
detail_trans
.
trans_type
==
2
?
(
<
View
style
=
{{
flex
:
0.3
,
justifyContent
:
'center'
}}
>
<
Text
style
=
{{
textAlign
:
'right'
,
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
,
color
:
'grey'
}}
>
{
i18n
.
t
(
'delivery'
)}
<
/Text
>
<
/View
>
)
:
(
<
View
style
=
{{
flex
:
0.3
,
justifyContent
:
'center'
}}
>
<
Text
style
=
{{
textAlign
:
'right'
,
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
,
color
:
'grey'
}}
>
DINE
IN
<
/Text
>
<
/View
>
)
}
<
/View
>
)
:
(
)
:
this
.
state
.
detail_trans
.
trans_type
==
2
?
(
<
View
style
=
{{
flex
:
2
}}
>
<
View
style
=
{{
flex
:
1
,
flexDirection
:
'row'
,
borderColor
:
'grey'
,
marginHorizontal
:
10
,
padding
:
10
}}
>
...
...
@@ -361,7 +372,50 @@ class OrderDetail extends React.Component {
}
<
/View
>
<
/View
>
)
:
(
<
View
style
=
{{
flex
:
1
,
flexDirection
:
'row'
,
borderBottomWidth
:
1
,
borderColor
:
'grey'
,
marginHorizontal
:
10
,
padding
:
10
}}
>
<
View
style
=
{{
flex
:
0.1
,
justifyContent
:
'center'
}}
>
<
FontAwesome
name
=
"map-marker"
size
=
{
24
}
color
=
"#d34343"
/>
<
/View
>
{
this
.
state
.
detail_trans
.
trans_type
==
1
?
(
<
View
style
=
{{
flex
:
0.6
,
justifyContent
:
'center'
}}
>
<
Text
style
=
{{
fontSize
:
14
,
fontFamily
:
'Gotham-Black'
,
color
:
'grey'
}}
>
{
this
.
state
.
detail_trans
.
outlet
}
<
/Text
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
,
color
:
'grey'
}}
>
{
this
.
state
.
detail_trans
.
outlet_address
}
<
/Text
>
<
/View
>
)
:
this
.
state
.
detail_trans
.
trans_type
==
2
?
(
<
View
style
=
{{
flex
:
0.6
,
justifyContent
:
'center'
}}
>
<
Text
style
=
{{
fontSize
:
14
,
fontFamily
:
'Gotham-Black'
,
color
:
'grey'
}}
>
{
this
.
state
.
detail_trans
.
recipient_address_name
}
<
/Text
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
,
color
:
'grey'
}}
>
{
this
.
state
.
detail_trans
.
recipient_address
}
<
/Text
>
<
/View
>
)
:
(
<
View
style
=
{{
flex
:
0.6
,
justifyContent
:
'center'
}}
>
<
Text
style
=
{{
fontSize
:
14
,
fontFamily
:
'Gotham-Black'
,
color
:
'grey'
}}
>
{
this
.
state
.
detail_trans
.
outlet
}
<
/Text
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
,
color
:
'grey'
}}
>
{
this
.
state
.
detail_trans
.
outlet_address
}
<
/Text
>
<
/View
>
)
}
{
this
.
state
.
detail_trans
.
trans_type
==
1
?
(
<
View
style
=
{{
flex
:
0.3
,
justifyContent
:
'center'
}}
>
<
Text
style
=
{{
textAlign
:
'right'
,
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
,
color
:
'grey'
}}
>
{
i18n
.
t
(
'pickup'
)}
<
/Text
>
<
/View
>
)
:
this
.
state
.
detail_trans
.
trans_type
==
2
?
(
<
View
style
=
{{
flex
:
0.3
,
justifyContent
:
'center'
}}
>
<
Text
style
=
{{
textAlign
:
'right'
,
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
,
color
:
'grey'
}}
>
{
i18n
.
t
(
'delivery'
)}
<
/Text
>
<
/View
>
)
:
(
<
View
style
=
{{
flex
:
0.3
,
justifyContent
:
'center'
}}
>
<
Text
style
=
{{
textAlign
:
'right'
,
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
,
color
:
'grey'
}}
>
DINE
IN
<
/Text
>
<
/View
>
)
}
<
/View
>
)
}
...
...
@@ -455,16 +509,34 @@ class OrderDetail extends React.Component {
<
/View
>
<
View
style
=
{{
flex
:
0.5
,
marginVertical
:
5
,
alignItems
:
'flex-end'
,
marginRight
:
10
}}
>
{
/* <Text style={{ fontSize: 12, fontFamily: 'Gotham-Light' }}>{this.state.detail_trans.point_booked}</Text> */
}
<
NumberFormat
decimalScale
=
{
0
}
value
=
{
this
.
state
.
detail_trans
.
point_booked
}
renderText
=
{
value
=>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
,
color
:
'grey'
}}
>
Rp
.
{
value
}
<
/Text>} displayType={'text'} thousandSeparator={true} prefix={''} /
>
<
NumberFormat
decimalScale
=
{
0
}
value
=
{
this
.
state
.
detail_trans
.
kaspro_point_reduce
}
renderText
=
{
value
=>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
,
color
:
'grey'
}}
>
Rp
.
{
value
}
<
/Text>} displayType={'text'} thousandSeparator={true} prefix={''} /
>
<
/View
>
<
/View
>
{
/* Non Balance untuk Dine In */
}
{
this
.
state
.
detail_trans
.
trans_type
==
3
?
(
<
View
style
=
{{
flex
:
1
,
flexDirection
:
'row'
,
justifyContent
:
'space-between'
,
marginHorizontal
:
10
}}
>
<
View
style
=
{{
flex
:
0.5
,
marginLeft
:
20
,
marginVertical
:
5
}}
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
,
color
:
'grey'
}}
>
Non
Balance
<
/Text
>
<
/View
>
<
View
style
=
{{
flex
:
0.5
,
marginVertical
:
5
,
alignItems
:
'flex-end'
,
marginRight
:
10
}}
>
{
/* <Text style={{ fontSize: 12, fontFamily: 'Gotham-Light' }}>{this.state.detail_trans.point_booked}</Text> */
}
<
NumberFormat
decimalScale
=
{
0
}
value
=
{
parseInt
(
this
.
state
.
detail_trans
.
trans_total
)
-
(
parseInt
(
this
.
state
.
detail_trans
.
point_reduce
)
+
parseInt
(
this
.
state
.
detail_trans
.
kaspro_point_reduce
))}
renderText
=
{
value
=>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
,
color
:
'grey'
}}
>
Rp
.
{
value
}
<
/Text>} displayType={'text'} thousandSeparator={true} prefix={''} /
>
<
/View
>
<
/View
>
)
:
null
}
<
View
style
=
{{
marginTop
:
5
,
borderTopWidth
:
1
,
borderColor
:
'grey'
,
marginHorizontal
:
10
,
flexDirection
:
'row'
,
justifyContent
:
'space-between'
,
flex
:
1
}}
>
<
View
style
=
{{
flex
:
0.5
,
marginLeft
:
10
,
marginVertical
:
5
}}
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
,
color
:
'grey'
}}
>
{
i18n
.
t
(
'price'
)}
<
/Text
>
<
/View
>
<
View
style
=
{{
flex
:
0.5
,
marginVertical
:
5
,
alignItems
:
'flex-end'
,
marginRight
:
10
}}
>
{
/* <Text style={{ fontSize: 12, fontFamily: 'Gotham-Light', textAlign: 'right' }}>{this.state.detail_trans.trans_subtotal}</Text> */
}
<
NumberFormat
decimalScale
=
{
0
}
value
=
{
this
.
state
.
detail_trans
.
trans_
sub
total
}
renderText
=
{
value
=>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
,
color
:
'grey'
,
textAlign
:
'right'
}}
>
Rp
.
{
value
}
<
/Text>} displayType={'text'} thousandSeparator={true} prefix={''} /
>
<
NumberFormat
decimalScale
=
{
0
}
value
=
{
this
.
state
.
detail_trans
.
trans_total
}
renderText
=
{
value
=>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
,
color
:
'grey'
,
textAlign
:
'right'
}}
>
Rp
.
{
value
}
<
/Text>} displayType={'text'} thousandSeparator={true} prefix={''} /
>
<
/View
>
<
/View
>
{
...
...
@@ -512,7 +584,7 @@ class OrderDetail extends React.Component {
<
/View
>
<
View
style
=
{{
flex
:
0.5
,
marginVertical
:
5
,
alignItems
:
'flex-end'
,
marginRight
:
10
}}
>
{
/* <Text style={{ fontSize: 20, fontFamily: 'Gotham-Black', textAlign: 'right', color: '#CFB368' }}>{this.state.detail_trans.trans_total}</Text> */
}
<
NumberFormat
decimalScale
=
{
0
}
value
=
{
this
.
state
.
detail_trans
.
point_reduce
}
renderText
=
{
value
=>
<
Text
style
=
{{
fontSize
:
20
,
fontFamily
:
'Gotham-Black'
,
textAlign
:
'right'
,
color
:
'#CFB368'
}}
>
Rp
.
{
value
}
<
/Text>} displayType={'text'} thousandSeparator={true} prefix={''} /
>
<
NumberFormat
decimalScale
=
{
0
}
value
=
{
this
.
state
.
detail_trans
.
trans_total
}
renderText
=
{
value
=>
<
Text
style
=
{{
fontSize
:
20
,
fontFamily
:
'Gotham-Black'
,
textAlign
:
'right'
,
color
:
'#CFB368'
}}
>
Rp
.
{
value
}
<
/Text>} displayType={'text'} thousandSeparator={true} prefix={''} /
>
<
/View
>
<
/View
>
...
...
@@ -656,7 +728,7 @@ const mapStateToProps = (state) => {
trans_id
:
state
.
trans_id
,
lat
:
state
.
lat
,
long
:
state
.
long
,
BASE_URL
:
state
.
BASE_URL
BASE_URL
:
state
.
BASE_URL
}
}
...
...
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