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
335a7946
Commit
335a7946
authored
May 08, 2020
by
Afid
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
ssh://repo.cs.co.id:2222/wahyu/bahanoprek
parents
9a70f352
0cb5cf69
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
45 additions
and
7 deletions
+45
-7
Item.js
view/Item.js
+12
-2
ItemShopingCart.js
view/ItemShopingCart.js
+14
-3
MenuSelection.js
view/MenuSelection.js
+12
-1
ShoppingCart.js
view/ShoppingCart.js
+7
-1
No files found.
view/Item.js
View file @
335a7946
...
...
@@ -5,8 +5,18 @@ import ActionType from '../redux/globalActionType';
class
Item
extends
React
.
Component
{
handleChangeQuantity
=
(
item
,
quantity
)
=>
{
this
.
props
.
changeQuantity
({
item
:
item
,
quantity
:
quantity
})
handleChangeQuantity
=
(
item
,
qty
)
=>
{
this
.
props
.
onChange
()
const
order_item
=
{
id
:
item
.
id
,
code
:
item
.
code
,
name
:
item
.
name
,
description
:
item
.
description
,
note
:
'jangan garing'
,
image
:
item
.
image
,
price
:
parseInt
(
item
.
price
),
}
this
.
props
.
changeQuantity
({
item
:
order_item
,
quantity
:
qty
})
}
render
()
{
...
...
view/ItemShopingCart.js
View file @
335a7946
...
...
@@ -6,12 +6,23 @@ import ActionType from '../redux/globalActionType';
class
ItemShoping
extends
React
.
Component
{
handleChangeQuantity
=
(
item
,
quantity
)
=>
{
console
.
log
(
'CHange Quantity Shopping CHart : '
+
JSON
.
stringify
(
item
))
console
.
log
(
'new quantity : '
+
quantity
)
this
.
props
.
changeQuantity
({
item
:
item
,
quantity
:
quantity
})
// console.log('CHange Quantity Shopping CHart : ' + JSON.stringify(item))
// console.log('new quantity : ' + quantity)
this
.
props
.
onChange
()
const
order_item
=
{
id
:
item
.
id
,
code
:
item
.
code
,
name
:
item
.
name
,
description
:
item
.
description
,
note
:
'jangan garing'
,
image
:
item
.
image
,
price
:
parseInt
(
item
.
price
),
}
this
.
props
.
changeQuantity
({
item
:
order_item
,
quantity
:
quantity
})
}
render
()
{
const
{
item
}
=
this
.
props
// console.log(this.props)
return
(
<
View
style
=
{{
flex
:
1
,
margin
:
10
}}
key
=
{
item
.
id
}
>
...
...
view/MenuSelection.js
View file @
335a7946
...
...
@@ -245,6 +245,11 @@ class MenuSelection extends React.Component {
}
}
onChange
(
params
){
console
.
log
(
params
);
}
handleMin
(
item
,
index
)
{
const
list_order_item
=
this
.
props
.
order_item
;
let
is_xist
=
list_order_item
.
find
(
row
=>
row
.
id
==
item
.
id
)
...
...
@@ -294,6 +299,7 @@ class MenuSelection extends React.Component {
item
=
{
item
}
handleAdd
=
{()
=>
this
.
handleAdd
(
item
,
index
)}
handleMin
=
{()
=>
this
.
handleMin
(
item
,
index
)}
onChange
=
{()
=>
this
.
onChange
(
item
,
index
)}
/
>
)}
keyExtractor
=
{
item
=>
item
.
id
}
...
...
@@ -307,7 +313,10 @@ class MenuSelection extends React.Component {
<
View
style
=
{{
flexDirection
:
'row'
,
}}
>
<
Text
style
=
{{
fontSize
:
12
,
margin
:
10
}}
>
Price
Estimation
/
Item
{
this
.
props
.
order_quantity
}
<
/Text
>
<
Text
style
=
{{
fontSize
:
12
,
margin
:
10
}}
>
Ongkir
{
this
.
props
.
grabamount
}
<
/Text
>
{
this
.
props
.
type_pickup
==
true
?
(
null
)
:
(
<
Text
style
=
{{
fontSize
:
12
,
margin
:
10
}}
>
Ongkir
{
this
.
props
.
grabamount
}
<
/Text
>
)}
<
Text
style
=
{{
fontSize
:
20
,
margin
:
10
,
marginBottom
:
10
}}
>
Rp
.
{
this
.
props
.
order_total
}
<
/Text
>
<
/View
>
...
...
@@ -348,6 +357,7 @@ const styles = StyleSheet.create({
const
mapStateToProps
=
(
state
)
=>
{
return
{
type_pickup
:
state
.
type_pickup
,
session_id
:
state
.
session_id
,
grabamount
:
state
.
grabamount
,
outlet_id
:
state
.
outlet_id
,
...
...
@@ -387,6 +397,7 @@ const mapDispatchToProps = (dispacth) => {
name_outlet
:
OutletChange
.
name_outlet
,
}
}),
}
}
...
...
view/ShoppingCart.js
View file @
335a7946
...
...
@@ -332,7 +332,13 @@ class ShoppingCart extends React.Component {
onChange
(){
this
.
setState
({
checkedBalance
:
false
,
checkedPoint
:
false
,
checkedBalancePoint
:
false
,
pointsused
:
0
,
balanceused
:
0
})
}
checkOut
()
{
...
...
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