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
9c8e9df5
Commit
9c8e9df5
authored
Oct 12, 2020
by
Trisno
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix issue edit alamat tidak bisa save, dan update build 171
parent
1b94e9d7
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
602 additions
and
162 deletions
+602
-162
app.json
app.json
+1
-1
globalActionType.js
redux/globalActionType.js
+1
-2
globalReducer.js
redux/globalReducer.js
+1
-9
AddreesDetail.js
view/AddreesDetail.js
+57
-112
Auth.js
view/Auth.js
+14
-0
DeliveryAddrees.js
view/DeliveryAddrees.js
+24
-38
EditAddressDetail.js
view/EditAddressDetail.js
+504
-0
No files found.
app.json
View file @
9c8e9df5
{
{
"expo"
:
{
"expo"
:
{
"extra"
:
{
"extra"
:
{
"buildNumber"
:
"17
0
"
,
"buildNumber"
:
"17
1
"
,
"remarks"
:
""
"remarks"
:
""
},
},
...
...
redux/globalActionType.js
View file @
9c8e9df5
...
@@ -51,7 +51,6 @@ const ActionType = {
...
@@ -51,7 +51,6 @@ const ActionType = {
SET_ACCOUNT_NUMBER
:
'SET_ACCOUNT_NUMBER'
,
SET_ACCOUNT_NUMBER
:
'SET_ACCOUNT_NUMBER'
,
SET_MEMBER
:
'SET_MEMBER'
,
SET_MEMBER
:
'SET_MEMBER'
,
SET_INBOX
:
'SET_INBOX'
,
SET_INBOX
:
'SET_INBOX'
,
SET_EDIT_ADDRESS
:
'SET_EDIT_ADDRESS'
}
}
export
default
ActionType
;
export
default
ActionType
;
redux/globalReducer.js
View file @
9c8e9df5
...
@@ -100,8 +100,7 @@ const globalState = {
...
@@ -100,8 +100,7 @@ const globalState = {
old_balance_claimed
:
true
,
old_balance_claimed
:
true
,
set_inbox
:
''
,
set_inbox
:
''
,
email_confirm
:
false
,
email_confirm
:
false
edit_address
:
false
,
}
}
...
@@ -164,13 +163,6 @@ const rootReducer = (state = globalState, action) => {
...
@@ -164,13 +163,6 @@ const rootReducer = (state = globalState, action) => {
pointused
:
action
.
data
.
pointused
,
pointused
:
action
.
data
.
pointused
,
}
}
}
}
case
ActionType
.
SET_EDIT_ADDRESS
:
{
return
{
...
state
,
edit_address
:
action
.
data
.
edit_address
,
}
}
case
ActionType
.
SET_PAGE
:
{
case
ActionType
.
SET_PAGE
:
{
return
{
return
{
...
state
,
...
state
,
...
...
view/AddreesDetail.js
View file @
9c8e9df5
This diff is collapsed.
Click to expand it.
view/Auth.js
View file @
9c8e9df5
...
@@ -26,6 +26,7 @@ import DeliveryAddress from './DeliveryAddrees';
...
@@ -26,6 +26,7 @@ import DeliveryAddress from './DeliveryAddrees';
import
PickupName
from
'./PickupName'
;
import
PickupName
from
'./PickupName'
;
import
MenuConfirmation
from
'./MenuConfirmation'
;
import
MenuConfirmation
from
'./MenuConfirmation'
;
import
AddressDetail
from
'./AddreesDetail'
;
import
AddressDetail
from
'./AddreesDetail'
;
import
EditAddressDetail
from
'./EditAddressDetail'
;
import
ShoppingCart
from
'./ShoppingCart'
;
import
ShoppingCart
from
'./ShoppingCart'
;
import
TransferBalance
from
'./TransferBalance'
;
import
TransferBalance
from
'./TransferBalance'
;
import
CardInfo
from
'./CardInfo'
;
import
CardInfo
from
'./CardInfo'
;
...
@@ -521,6 +522,19 @@ class Auth extends React.Component {
...
@@ -521,6 +522,19 @@ class Auth extends React.Component {
textAlign
:
'center'
textAlign
:
'center'
},
title
:
'TAMBAH ALAMAT'
},
title
:
'TAMBAH ALAMAT'
}}
/
>
}}
/
>
<
Stack
.
Screen
name
=
"Edit Address"
component
=
{
EditAddressDetail
}
options
=
{{
headerStyle
:
{
backgroundColor
:
'#CFB368'
},
headerTitleContainerStyle
:
{
alignContent
:
'center'
},
headerTitleAlign
:
'center'
,
headerTintColor
:
'#fff'
,
headerTitleStyle
:
{
alignSelf
:
'center'
,
fontFamily
:
'Gotham-Black'
,
fontSize
:
20
,
color
:
'white'
,
textAlign
:
'center'
},
title
:
'EDIT ALAMAT'
}}
/
>
<
Stack
.
Screen
name
=
"Menu Detail"
component
=
{
MenuDetail
}
<
Stack
.
Screen
name
=
"Menu Detail"
component
=
{
MenuDetail
}
options
=
{({
route
})
=>
({
options
=
{({
route
})
=>
({
headerStyle
:
{
backgroundColor
:
'#CFB368'
},
headerStyle
:
{
backgroundColor
:
'#CFB368'
},
...
...
view/DeliveryAddrees.js
View file @
9c8e9df5
import
{
EvilIcons
,
Ionicons
,
MaterialCommunityIcons
}
from
'@expo/vector-icons'
;
import
{
EvilIcons
,
Ionicons
,
MaterialCommunityIcons
,
SimpleLineIcons
}
from
'@expo/vector-icons'
;
import
Axios
from
'axios'
;
import
Axios
from
'axios'
;
import
i18n
from
'i18n-js'
;
import
i18n
from
'i18n-js'
;
import
React
from
'react'
;
import
React
from
'react'
;
...
@@ -54,8 +54,7 @@ class DeliveryAddrees extends React.Component {
...
@@ -54,8 +54,7 @@ class DeliveryAddrees extends React.Component {
}
}
Axios
.
post
(
this
.
props
.
BASE_URL
+
'crm/v2/member/get_address'
,
params
).
then
(
res
=>
{
Axios
.
post
(
this
.
props
.
BASE_URL
+
'crm/v2/member/get_address'
,
params
).
then
(
res
=>
{
const
dataAlamat
=
res
.
data
.
data
;
const
dataAlamat
=
res
.
data
.
data
;
console
.
log
(
"INI DATA :"
+
JSON
.
stringify
(
dataAlamat
))
// console.log("INI DATA :" + JSON.stringify(dataAlamat))
let
address
=
[]
let
address
=
[]
for
(
let
i
=
0
;
i
<
dataAlamat
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
dataAlamat
.
length
;
i
++
)
{
const
element
=
dataAlamat
[
i
];
const
element
=
dataAlamat
[
i
];
...
@@ -74,8 +73,6 @@ class DeliveryAddrees extends React.Component {
...
@@ -74,8 +73,6 @@ class DeliveryAddrees extends React.Component {
data_alamat
.
push
(
b
)
data_alamat
.
push
(
b
)
})
})
// console.log(this.state.data)
}).
catch
(
error
=>
{
}).
catch
(
error
=>
{
let
response
=
error
.
response
.
data
;
let
response
=
error
.
response
.
data
;
...
@@ -86,6 +83,8 @@ class DeliveryAddrees extends React.Component {
...
@@ -86,6 +83,8 @@ class DeliveryAddrees extends React.Component {
})
})
}
}
getRate
(
address_id
)
{
getRate
(
address_id
)
{
// console.log('ADdress id : ' + address_id)
// console.log('ADdress id : ' + address_id)
...
@@ -136,15 +135,7 @@ class DeliveryAddrees extends React.Component {
...
@@ -136,15 +135,7 @@ class DeliveryAddrees extends React.Component {
}
}
addAdreess
()
{
addAdreess
()
{
this
.
props
.
navigation
.
navigate
(
'Address Detail'
,
{
data_address
:
""
,
'data'
:
'sample'
,
onChangeAddress
:
this
.
onChangeAddress
})
this
.
props
.
navigation
.
navigate
(
'Address Detail'
,
{
'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
);
}
}
...
@@ -210,7 +201,7 @@ class DeliveryAddrees extends React.Component {
...
@@ -210,7 +201,7 @@ class DeliveryAddrees extends React.Component {
}
}
if
(
this
.
props
.
value_voucher
!==
""
)
{
if
(
this
.
props
.
value_voucher
!==
""
)
{
if
(
this
.
props
.
value_voucher
.
reward
.
type
==
'percentage'
)
{
if
(
this
.
props
.
value_voucher
.
reward
.
type
==
'percentage'
)
{
this
.
handleVoucherSelect
()
this
.
handleVoucherSelect
()
}
}
}
}
...
@@ -320,6 +311,17 @@ class DeliveryAddrees extends React.Component {
...
@@ -320,6 +311,17 @@ class DeliveryAddrees extends React.Component {
);
);
}
}
handleEditAddress
(
id
,
name
,
address
,
description
,
lat
,
long
)
{
console
.
log
(
'tes'
)
console
.
log
(
id
)
console
.
log
(
name
)
console
.
log
(
address
)
console
.
log
(
description
||
'kosong'
)
console
.
log
(
lat
)
console
.
log
(
long
)
this
.
props
.
navigation
.
navigate
(
'Edit Address'
,
{
address_id
:
id
,
name
:
name
,
address
:
address
,
description
:
description
,
lat
:
lat
,
long
:
long
})
}
renderItem
=
({
item
})
=>
{
renderItem
=
({
item
})
=>
{
return
(
return
(
<
View
style
=
{
styles
.
list_addrees
}
>
<
View
style
=
{
styles
.
list_addrees
}
>
...
@@ -336,8 +338,8 @@ class DeliveryAddrees extends React.Component {
...
@@ -336,8 +338,8 @@ class DeliveryAddrees extends React.Component {
uncheckedColor
=
"#ccb46c"
uncheckedColor
=
"#ccb46c"
/>
/>
<
/View
>
<
/View
>
<
View
style
=
{{
flex
:
3
}}
>
<
View
style
=
{{
bottom
:
10
}}
>
<
Text
style
=
{{
textAlign
:
'center'
,
color
:
'#ccb46c'
,
fontFamily
:
'Gotham-Light'
,
marginRight
:
5
}}
>
{
i18n
.
t
(
'selectaddress'
)}
<
/Text
>
<
Text
style
=
{{
textAlign
:
'center'
,
color
:
'#ccb46c'
,
fontFamily
:
'Gotham-Light'
}}
>
{
i18n
.
t
(
'selectaddress'
)}
<
/Text
>
<
/View
>
<
/View
>
<
/View
>
<
/View
>
<
View
style
=
{{
flex
:
3
,
justifyContent
:
'center'
}}
>
<
View
style
=
{{
flex
:
3
,
justifyContent
:
'center'
}}
>
...
@@ -348,17 +350,10 @@ class DeliveryAddrees extends React.Component {
...
@@ -348,17 +350,10 @@ class DeliveryAddrees extends React.Component {
<
/View
>
<
/View
>
<
/TouchableOpacity
>
<
/TouchableOpacity
>
<
/View
>
<
/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
}}
>
<
View
style
=
{{
flex
:
1
}}
>
<
TouchableOpacity
style
=
{{
flex
Direction
:
'row'
,
justifyContent
:
"center"
}}
onPress
=
{()
=>
this
.
EditAdreess
(
item
)}
>
<
TouchableOpacity
style
=
{{
flex
:
1
,
flexDirection
:
'row'
,
justifyContent
:
"center"
}}
onPress
=
{()
=>
this
.
handleEditAddress
(
item
.
id
,
item
.
name
,
item
.
address
,
item
.
description
,
item
.
lat
,
item
.
long
)}
>
<
View
style
=
{{
alignSelf
:
"center"
,
marginTop
:
2
0
}}
>
<
View
style
=
{{
alignSelf
:
"center"
,
marginTop
:
2
2
,
marginLeft
:
35
}}
>
<
EvilIcons
name
=
"pencil"
size
=
{
40
}
color
=
"#ccb46c"
/>
<
SimpleLineIcons
name
=
"pencil"
size
=
{
25
}
color
=
"#ccb46c"
/>
<
/View
>
<
/View
>
<
/TouchableOpacity
>
<
/TouchableOpacity
>
<
/View
>
<
/View
>
...
@@ -368,7 +363,6 @@ class DeliveryAddrees extends React.Component {
...
@@ -368,7 +363,6 @@ class DeliveryAddrees extends React.Component {
<
EvilIcons
name
=
"trash"
size
=
{
40
}
color
=
"#ccb46c"
/>
<
EvilIcons
name
=
"trash"
size
=
{
40
}
color
=
"#ccb46c"
/>
<
/View
>
<
/View
>
<
/TouchableOpacity
>
<
/TouchableOpacity
>
<
/View
>
<
/View
>
<
/View
>
<
/View
>
<
/View
>
<
/View
>
...
@@ -404,7 +398,6 @@ class DeliveryAddrees extends React.Component {
...
@@ -404,7 +398,6 @@ class DeliveryAddrees extends React.Component {
<
/View
>
<
/View
>
<
/TouchableOpacity
>
<
/TouchableOpacity
>
<
/View
>
<
/View
>
<
View
style
=
{
styles
.
listAddress
}
>
<
View
style
=
{
styles
.
listAddress
}
>
{
this
.
state
.
indicator
==
true
?
(
{
this
.
state
.
indicator
==
true
?
(
<
ActivityIndicator
size
=
"large"
color
=
"#c9af6d"
/>
<
ActivityIndicator
size
=
"large"
color
=
"#c9af6d"
/>
...
@@ -520,13 +513,6 @@ const mapDispatchToProps = (dispacth) => {
...
@@ -520,13 +513,6 @@ const mapDispatchToProps = (dispacth) => {
}
}
}),
}),
editAddress
:
(
setDataEditAddress
)
=>
dispacth
({
type
:
ActionType
.
SET_EDIT_ADDRESS
,
data
:
{
edit_address
:
setDataEditAddress
.
edit_address
}
}),
setGrab
:
(
setGrabProps
)
=>
dispacth
({
setGrab
:
(
setGrabProps
)
=>
dispacth
({
type
:
ActionType
.
SET_GRAB
,
type
:
ActionType
.
SET_GRAB
,
data
:
{
data
:
{
...
...
view/EditAddressDetail.js
0 → 100644
View file @
9c8e9df5
This diff is collapsed.
Click to expand it.
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