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
7201e137
Commit
7201e137
authored
Jun 03, 2020
by
Wahyu Adjie Prasetyo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
set note
parent
77065de3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
51 additions
and
26 deletions
+51
-26
globalReducer.js
redux/globalReducer.js
+21
-18
Item.js
view/Item.js
+30
-7
UseBalance.js
view/UseBalance.js
+0
-1
No files found.
redux/globalReducer.js
View file @
7201e137
...
...
@@ -83,13 +83,8 @@ const globalState = {
voucher
:
[],
value_voucher
:
''
,
home_address
:
''
,
outlet_detailadress
:
''
,
in_payment
:
false
,
redeem_code
:
''
,
balance_redeem
:
''
,
point_redeem
:
''
home_address
:
''
,
outlet_detailadress
:
''
}
...
...
@@ -285,16 +280,6 @@ const rootReducer = (state = globalState, action) => {
}
}
case
ActionType
.
SET_REEDEM
:
{
return
{
...
state
,
in_payment
:
action
.
data
.
in_payment
,
redeem_code
:
action
.
data
.
redeem_code
,
balance_redeem
:
action
.
data
.
balance_redeem
,
point_redeem
:
action
.
data
.
point_redeem
}
}
case
ActionType
.
SET_CHANGE_SHOP
:
{
return
{
...
state
...
...
@@ -638,7 +623,6 @@ const rootReducer = (state = globalState, action) => {
}
}
case
ActionType
.
CHANGE_QUANTITY
:
{
const
item
=
action
.
data
.
item
;
const
new_quantity
=
action
.
data
.
new_quantity
;
...
...
@@ -709,6 +693,25 @@ const rootReducer = (state = globalState, action) => {
}
case
ActionType
.
SET_EDIT_NOTE
:
{
const
item
=
action
.
data
.
item
;
// const new_quantity = action.data.new_quantity;
// let total = 0
let
list_item
=
[]
let
edit_qty
=
list_item
.
find
(
item
=>
item
.
id
==
item
.
note
)
console
.
log
(
"INI APA YA : "
+
edit_qty
)
// list_menu.push()
// return {
// ...state,
// order_item: list_item,
// }
}
default
:
return
state
;
}
...
...
view/Item.js
View file @
7201e137
...
...
@@ -13,7 +13,7 @@ class Item extends React.Component {
this
.
state
=
{
value
:
0
,
modalVisible
:
false
,
description
:
''
note
:
''
}
}
handleChangeQuantity
=
(
item
,
qty
)
=>
{
...
...
@@ -43,10 +43,21 @@ class Item extends React.Component {
})
}
handleEdit
()
{
const
edit_note
=
{
note
:
this
.
state
.
note
handleEdit
=
(
item
)
=>
{
const
order_item
=
{
id
:
item
.
id
,
code
:
item
.
code
,
name
:
item
.
name
,
description
:
item
.
description
,
note
:
this
.
state
.
note
,
image
:
item
.
image
,
price
:
parseInt
(
item
.
price
),
}
this
.
props
.
setNotes
({
item
:
order_item
})
this
.
setState
({
modalVisible
:
false
})
}
render
()
{
...
...
@@ -68,19 +79,25 @@ class Item extends React.Component {
<
View
style
=
{{
margin
:
10
}}
>
<
TextInput
style
=
{
styles
.
textInput
}
onChangeText
=
{(
description
)
=>
this
.
setState
({
description
})}
onChangeText
=
{(
note
)
=>
this
.
setState
({
note
})}
value
=
{
this
.
state
.
description
}
textAlign
=
'center'
/>
<
/View
>
<
TouchableOpacity
onPress
=
{()
=>
this
.
setState
({
modalVisible
:
false
})}
>
<
View
style
=
{{
flexDirection
:
'row'
}}
>
<
TouchableOpacity
style
=
{{
margin
:
5
}}
onPress
=
{()
=>
this
.
handleEdit
(
item
)
}
>
<
View
style
=
{
styles
.
button
}
>
<
Text
style
=
{{
color
:
'white'
,
fontWeight
:
'bold'
,
fontSize
:
16
}}
>
CONFIRM
<
/Text
>
<
/View
>
<
/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
>
<
/Modal
>
<
ScrollView
ref
=
{
view
=>
this
.
_scrollView
=
view
}
>
{
item
.
code
==
'CATEGORY'
?
(
...
...
@@ -243,6 +260,12 @@ const mapDispatchToProps = (dispacth) => {
new_quantity
:
params
.
quantity
}
}),
setNotes
:
(
params
)
=>
dispacth
({
type
:
ActionType
.
SET_EDIT_NOTE
,
data
:
{
item
:
params
.
item
,
}
}),
}
}
const
mapStateToProps
=
(
state
)
=>
{
...
...
view/UseBalance.js
View file @
7201e137
...
...
@@ -8,7 +8,6 @@ import { Entypo, Ionicons, MaterialCommunityIcons, MaterialIcons, AntDesign, Fon
import
ActionType
from
'../redux/globalActionType'
;
import
Spinner
from
'react-native-loading-spinner-overlay'
;
import
PinRequest
from
'./PinRequest'
import
ActionType
from
'../redux/globalActionType'
;
class
UseBalance
extends
React
.
Component
{
...
...
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