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
eb244595
Commit
eb244595
authored
Jun 04, 2020
by
Wahyu Adjie Prasetyo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add notes
parent
cb49347b
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
34 additions
and
14 deletions
+34
-14
globalReducer.js
redux/globalReducer.js
+1
-3
Item.js
view/Item.js
+0
-5
ItemShopingCart.js
view/ItemShopingCart.js
+31
-5
MenuConfirmation.js
view/MenuConfirmation.js
+2
-1
No files found.
redux/globalReducer.js
View file @
eb244595
...
@@ -707,13 +707,12 @@ const rootReducer = (state = globalState, action) => {
...
@@ -707,13 +707,12 @@ const rootReducer = (state = globalState, action) => {
case
ActionType
.
SET_EDIT_NOTE
:
{
case
ActionType
.
SET_EDIT_NOTE
:
{
const
update
=
action
.
data
.
item
;
const
update
=
action
.
data
.
item
;
updated_data
=
[]
updated_data
=
[]
for
(
let
i
=
0
;
i
<
state
.
order_item
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
state
.
order_item
.
length
;
i
++
)
{
const
old_data
=
state
.
order_item
[
i
];
const
old_data
=
state
.
order_item
[
i
];
const
data
=
old_data
;
const
data
=
old_data
;
// dicari dulu
yu
object mana yg mau diupdate
// dicari dulu object mana yg mau diupdate
if
(
old_data
.
id
==
update
.
id
)
{
if
(
old_data
.
id
==
update
.
id
)
{
// kalo ketemu update data notenya
// kalo ketemu update data notenya
data
.
note
=
update
.
note
data
.
note
=
update
.
note
...
@@ -729,7 +728,6 @@ const rootReducer = (state = globalState, action) => {
...
@@ -729,7 +728,6 @@ const rootReducer = (state = globalState, action) => {
order_item
:
updated_data
,
order_item
:
updated_data
,
}
}
}
}
default
:
default
:
...
...
view/Item.js
View file @
eb244595
...
@@ -46,12 +46,7 @@ class Item extends React.Component {
...
@@ -46,12 +46,7 @@ class Item extends React.Component {
handleEdit
=
(
item
)
=>
{
handleEdit
=
(
item
)
=>
{
const
order_item
=
{
const
order_item
=
{
id
:
item
.
id
,
id
:
item
.
id
,
code
:
item
.
code
,
name
:
item
.
name
,
description
:
item
.
description
,
note
:
this
.
state
.
note
,
note
:
this
.
state
.
note
,
image
:
item
.
image
,
price
:
parseInt
(
item
.
price
),
}
}
this
.
props
.
setNotes
({
item
:
order_item
})
this
.
props
.
setNotes
({
item
:
order_item
})
...
...
view/ItemShopingCart.js
View file @
eb244595
...
@@ -12,7 +12,8 @@ class ItemShoping extends React.Component {
...
@@ -12,7 +12,8 @@ class ItemShoping extends React.Component {
this
.
state
=
{
this
.
state
=
{
value
:
0
,
value
:
0
,
modalVisible
:
false
,
modalVisible
:
false
,
description
:
''
description
:
''
,
note
:
''
}
}
}
}
handleChangeQuantity
=
(
item
,
quantity
)
=>
{
handleChangeQuantity
=
(
item
,
quantity
)
=>
{
...
@@ -28,7 +29,7 @@ class ItemShoping extends React.Component {
...
@@ -28,7 +29,7 @@ class ItemShoping extends React.Component {
code
:
item
.
code
,
code
:
item
.
code
,
name
:
item
.
name
,
name
:
item
.
name
,
description
:
item
.
description
,
description
:
item
.
description
,
note
:
item
.
note
,
note
:
this
.
state
.
note
,
image
:
item
.
image
,
image
:
item
.
image
,
price
:
parseInt
(
item
.
price
),
price
:
parseInt
(
item
.
price
),
}
}
...
@@ -41,6 +42,18 @@ class ItemShoping extends React.Component {
...
@@ -41,6 +42,18 @@ class ItemShoping extends React.Component {
})
})
}
}
handleEdit
=
(
item
)
=>
{
const
order_item
=
{
id
:
item
.
id
,
note
:
this
.
state
.
note
,
}
this
.
props
.
setNotes
({
item
:
order_item
})
this
.
setState
({
modalVisible
:
false
})
}
render
()
{
render
()
{
const
{
item
}
=
this
.
props
const
{
item
}
=
this
.
props
// console.log(this.props)
// console.log(this.props)
...
@@ -62,16 +75,23 @@ class ItemShoping extends React.Component {
...
@@ -62,16 +75,23 @@ class ItemShoping extends React.Component {
<
View
style
=
{{
margin
:
10
}}
>
<
View
style
=
{{
margin
:
10
}}
>
<
TextInput
<
TextInput
style
=
{
styles
.
textInput
}
style
=
{
styles
.
textInput
}
onChangeText
=
{(
description
)
=>
this
.
setState
({
description
})}
onChangeText
=
{(
note
)
=>
this
.
setState
({
note
})}
value
=
{
this
.
state
.
description
}
value
=
{
this
.
state
.
note
}
textAlign
=
'center'
textAlign
=
'center'
/>
/>
<
/View
>
<
/View
>
<
TouchableOpacity
onPress
=
{()
=>
this
.
setState
({
modalVisible
:
false
})}
>
<
View
style
=
{{
flexDirection
:
'row'
}}
>
<
TouchableOpacity
style
=
{{
margin
:
5
}}
onPress
=
{()
=>
this
.
handleEdit
(
item
)
}
>
<
View
style
=
{
styles
.
button
}
>
<
View
style
=
{
styles
.
button
}
>
<
Text
style
=
{{
color
:
'white'
,
fontWeight
:
'bold'
,
fontSize
:
16
}}
>
CONFIRM
<
/Text
>
<
Text
style
=
{{
color
:
'white'
,
fontWeight
:
'bold'
,
fontSize
:
16
}}
>
CONFIRM
<
/Text
>
<
/View
>
<
/View
>
<
/TouchableOpacity
>
<
/TouchableOpacity
>
<
TouchableOpacity
style
=
{{
margin
:
5
}}
onPress
=
{()
=>
this
.
setState
({
modalVisible
:
false
})}
>
<
View
style
=
{
styles
.
button
}
>
<
Text
style
=
{{
color
:
'white'
,
fontWeight
:
'bold'
,
fontSize
:
16
}}
>
CANCEL
<
/Text
>
<
/View
>
<
/TouchableOpacity
>
<
/View
>
<
/View
>
<
/View
>
<
/View
>
<
/View
>
...
@@ -234,6 +254,12 @@ const mapDispatchToProps = (dispacth) => {
...
@@ -234,6 +254,12 @@ const mapDispatchToProps = (dispacth) => {
new_quantity
:
params
.
quantity
new_quantity
:
params
.
quantity
}
}
}),
}),
setNotes
:
(
params
)
=>
dispacth
({
type
:
ActionType
.
SET_EDIT_NOTE
,
data
:
{
item
:
params
.
item
,
}
}),
}
}
}
}
...
...
view/MenuConfirmation.js
View file @
eb244595
...
@@ -27,7 +27,7 @@ class MenuConfirmation extends React.Component {
...
@@ -27,7 +27,7 @@ class MenuConfirmation extends React.Component {
componentDidMount
()
{
componentDidMount
()
{
// console.log(" DESTINASI : "+ this.props.grabdestination)
// console.log(" DESTINASI : "+ this.props.grabdestination)
//
console.log("ONGKIR"+ this.props.grabamount)
console
.
log
(
"ONGKIR"
+
this
.
props
.
grabamount
)
// console.log("drop off"+this.props.grabdropoff)
// console.log("drop off"+this.props.grabdropoff)
// console.log("pickup"+this.props.grabpickup)
// console.log("pickup"+this.props.grabpickup)
// console.log("type" +this.props.grabtype)
// console.log("type" +this.props.grabtype)
...
@@ -189,6 +189,7 @@ class MenuConfirmation extends React.Component {
...
@@ -189,6 +189,7 @@ class MenuConfirmation extends React.Component {
// session(response, navigation)
// session(response, navigation)
console
.
log
(
"INI ERROR : "
+
JSON
.
stringify
(
error
)
)
console
.
log
(
"INI ERROR : "
+
JSON
.
stringify
(
error
)
)
Alert
.
alert
(
error
.
response
.
msg
);
Alert
.
alert
(
error
.
response
.
msg
);
Alert
.
alert
(
error
)
this
.
setState
({
this
.
setState
({
spinner
:
false
,
spinner
:
false
,
})
})
...
...
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