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
f05fa621
Commit
f05fa621
authored
Oct 07, 2020
by
Wahyu Adjie Prasetyo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nambah fitur edit alamat
parent
7cd27c8d
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
134 additions
and
28 deletions
+134
-28
globalActionType.js
redux/globalActionType.js
+1
-0
globalReducer.js
redux/globalReducer.js
+9
-1
AddreesDetail.js
view/AddreesDetail.js
+86
-24
DeliveryAddrees.js
view/DeliveryAddrees.js
+38
-3
No files found.
redux/globalActionType.js
View file @
f05fa621
...
...
@@ -51,6 +51,7 @@ const ActionType = {
SET_ACCOUNT_NUMBER
:
'SET_ACCOUNT_NUMBER'
,
SET_MEMBER
:
'SET_MEMBER'
,
SET_INBOX
:
'SET_INBOX'
,
SET_EDIT_ADDRESS
:
'SET_EDIT_ADDRESS'
}
export
default
ActionType
;
\ No newline at end of file
redux/globalReducer.js
View file @
f05fa621
...
...
@@ -100,7 +100,8 @@ const globalState = {
old_balance_claimed
:
true
,
set_inbox
:
''
,
email_confirm
:
false
email_confirm
:
false
,
edit_address
:
false
,
}
...
...
@@ -163,6 +164,13 @@ const rootReducer = (state = globalState, action) => {
pointused
:
action
.
data
.
pointused
,
}
}
case
ActionType
.
SET_EDIT_ADDRESS
:
{
return
{
...
state
,
edit_address
:
action
.
data
.
edit_address
,
}
}
case
ActionType
.
SET_PAGE
:
{
return
{
...
state
,
...
...
view/AddreesDetail.js
View file @
f05fa621
This diff is collapsed.
Click to expand it.
view/DeliveryAddrees.js
View file @
f05fa621
...
...
@@ -54,6 +54,7 @@ class DeliveryAddrees extends React.Component {
}
Axios
.
post
(
this
.
props
.
BASE_URL
+
'crm/v2/member/get_address'
,
params
).
then
(
res
=>
{
const
dataAlamat
=
res
.
data
.
data
;
// console.log("INI DATA :" + JSON.stringify(dataAlamat))
let
address
=
[]
for
(
let
i
=
0
;
i
<
dataAlamat
.
length
;
i
++
)
{
...
...
@@ -73,6 +74,8 @@ class DeliveryAddrees extends React.Component {
data_alamat
.
push
(
b
)
})
// console.log(this.state.data)
}).
catch
(
error
=>
{
let
response
=
error
.
response
.
data
;
...
...
@@ -135,7 +138,16 @@ class DeliveryAddrees extends React.Component {
}
addAdreess
()
{
this
.
props
.
navigation
.
navigate
(
'Address Detail'
,
{
'data'
:
'sample'
,
onChangeAddress
:
this
.
onChangeAddress
})
this
.
props
.
navigation
.
navigate
(
'Address Detail'
,
{
data_address
:
""
,
'data'
:
'sample'
,
onChangeAddress
:
this
.
onChangeAddress
})
}
EditAdreess
(
data_address
)
{
this
.
props
.
navigation
.
navigate
(
'Address Detail'
,
{
data_address
:
data_address
,
'data'
:
'sample'
,
onChangeAddress
:
this
.
onChangeAddress
})
let
setDataEditAddress
=
{
edit_address
:
true
}
this
.
props
.
editAddress
(
setDataEditAddress
);
}
...
...
@@ -327,8 +339,8 @@ class DeliveryAddrees extends React.Component {
uncheckedColor
=
"#ccb46c"
/>
<
/View
>
<
View
>
<
Text
style
=
{{
textAlign
:
'center'
,
color
:
'#ccb46c'
,
fontFamily
:
'Gotham-Light'
,
marginRight
:
20
}}
>
{
i18n
.
t
(
'selectaddress'
)}
<
/Text
>
<
View
style
=
{{
flex
:
3
}}
>
<
Text
style
=
{{
textAlign
:
'center'
,
color
:
'#ccb46c'
,
fontFamily
:
'Gotham-Light'
,
marginRight
:
5
}}
>
{
i18n
.
t
(
'selectaddress'
)}
<
/Text
>
<
/View
>
<
/View
>
<
View
style
=
{{
flex
:
3
,
justifyContent
:
'center'
}}
>
...
...
@@ -339,12 +351,27 @@ class DeliveryAddrees extends React.Component {
<
/View
>
<
/TouchableOpacity
>
<
/View
>
<
View
style
=
{{
flex
:
1
}}
>
<
TouchableOpacity
style
=
{{
flexDirection
:
'row'
,
justifyContent
:
"center"
}}
onPress
=
{()
=>
this
.
EditAdreess
(
item
)}
>
<
View
style
=
{{
alignSelf
:
'flex-end'
,
marginTop
:
20
}}
>
{
/* <EvilIcons name="pencil" size={40} color="#ccb46c" /> */
}
<
/View
>
<
/TouchableOpacity
>
<
/View
>
<
View
style
=
{{
flex
:
1
}}
>
<
TouchableOpacity
style
=
{{
flexDirection
:
'row'
,
justifyContent
:
"center"
}}
onPress
=
{()
=>
this
.
EditAdreess
(
item
)}
>
<
View
style
=
{{
alignSelf
:
"center"
,
marginTop
:
20
}}
>
<
EvilIcons
name
=
"pencil"
size
=
{
40
}
color
=
"#ccb46c"
/>
<
/View
>
<
/TouchableOpacity
>
<
/View
>
<
View
style
=
{{
flex
:
1
}}
>
<
TouchableOpacity
style
=
{{
flex
:
1
,
flexDirection
:
'row'
,
justifyContent
:
"center"
}}
onPress
=
{()
=>
this
.
handleDeleteAddress
(
item
.
id
)}
>
<
View
style
=
{{
alignSelf
:
"center"
,
marginTop
:
20
}}
>
<
EvilIcons
name
=
"trash"
size
=
{
40
}
color
=
"#ccb46c"
/>
<
/View
>
<
/TouchableOpacity
>
<
/View
>
<
/View
>
<
/View
>
...
...
@@ -380,6 +407,7 @@ class DeliveryAddrees extends React.Component {
<
/View
>
<
/TouchableOpacity
>
<
/View
>
<
View
style
=
{
styles
.
listAddress
}
>
{
this
.
state
.
indicator
==
true
?
(
<
ActivityIndicator
size
=
"large"
color
=
"#c9af6d"
/>
...
...
@@ -495,6 +523,13 @@ const mapDispatchToProps = (dispacth) => {
}
}),
editAddress
:
(
setDataEditAddress
)
=>
dispacth
({
type
:
ActionType
.
SET_EDIT_ADDRESS
,
data
:
{
edit_address
:
setDataEditAddress
.
edit_address
}
}),
setGrab
:
(
setGrabProps
)
=>
dispacth
({
type
:
ActionType
.
SET_GRAB
,
data
:
{
...
...
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