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
265e5f7e
Commit
265e5f7e
authored
May 28, 2020
by
Wahyu Adjie Prasetyo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
name label redux
parent
f63a7d59
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
35 additions
and
11 deletions
+35
-11
globalActionType.js
redux/globalActionType.js
+2
-1
globalReducer.js
redux/globalReducer.js
+4
-2
AddreesDetail.js
view/AddreesDetail.js
+5
-2
DeliveryAddrees.js
view/DeliveryAddrees.js
+21
-5
ShoppingCart.js
view/ShoppingCart.js
+3
-1
No files found.
redux/globalActionType.js
View file @
265e5f7e
...
...
@@ -38,7 +38,8 @@ const ActionType = {
SET_TRANS_ID
:
'SET_TRANS_ID'
,
CHANGE_TO_CHART
:
'CHANGE_TO_CHART'
,
SET_VOUCHER
:
'SET_VOUCHER'
,
SET_EDIT_NOTE
:
'SET_EDIT_NOTE'
SET_EDIT_NOTE
:
'SET_EDIT_NOTE'
,
SET_HOME_ADDRESS
:
'SET_HOME_ADDRESS'
}
export
default
ActionType
;
\ No newline at end of file
redux/globalReducer.js
View file @
265e5f7e
...
...
@@ -82,7 +82,8 @@ const globalState = {
long
:
''
,
voucher
:
[],
value_voucher
:
''
value_voucher
:
''
,
home_address
:
''
}
...
...
@@ -286,7 +287,8 @@ const rootReducer = (state = globalState, action) => {
return
{
...
state
,
address
:
action
.
data
.
address
,
addressId
:
action
.
data
.
addressId
addressId
:
action
.
data
.
addressId
,
home_address
:
action
.
data
.
home_address
}
}
case
ActionType
.
SET_TRANS_ID
:
{
...
...
view/AddreesDetail.js
View file @
265e5f7e
...
...
@@ -9,6 +9,7 @@ import { connect } from 'react-redux';
import
Axios
from
'axios'
;
import
Spinner
from
'react-native-loading-spinner-overlay'
;
import
{
MaterialCommunityIcons
,
Ionicons
}
from
'@expo/vector-icons'
;
import
ActionType
from
'../redux/globalActionType'
;
class
AddreesDetail
extends
React
.
Component
{
...
...
@@ -134,6 +135,7 @@ class AddreesDetail extends React.Component {
this
.
setState
({
spinner
:
false
,
})
this
.
props
.
navigation
.
goBack
()
this
.
props
.
route
.
params
.
onChangeAddress
({
example
:
'wakwaw'
})
...
...
@@ -221,7 +223,7 @@ class AddreesDetail extends React.Component {
<
/View
>
<
View
style
=
{
styles
.
field_name_addrees
}
>
<
Text
style
=
{{
fontFamily
:
'Gotham-Black'
,
color
:
"#ccb46c"
,
textAlign
:
'center'
,
fontSize
:
18
}}
>
Nama
<
/Text
>
<
Text
style
=
{{
fontFamily
:
'Gotham-Black'
,
color
:
"#ccb46c"
,
textAlign
:
'center'
,
fontSize
:
18
}}
>
Label
<
/Text
>
<
TextInput
style
=
{{
height
:
40
,
borderWidth
:
1
,
padding
:
5
,
flex
:
1
,
margin
:
10
,
borderRadius
:
10
,
borderColor
:
'grey'
}}
onChangeText
=
{(
name
)
=>
this
.
setState
({
name
})}
/
>
<
/View
>
...
...
@@ -236,7 +238,7 @@ class AddreesDetail extends React.Component {
<
View
style
=
{{
margin
:
50
,
justifyContent
:
'center'
}}
>
<
TouchableOpacity
onPress
=
{()
=>
this
.
saveAddress
()}
>
<
View
style
=
{{
height
:
40
,
borderRadius
:
10
,
backgroundColor
:
'#CFB368'
,
justifyContent
:
'center'
}}
>
<
Text
style
=
{{
fontFamily
:
'Gotham-Black'
,
color
:
'white'
,
fontSize
:
16
,
textAlign
:
'center'
}}
>
+
Tambah
Alamat
<
/Text
>
<
Text
style
=
{{
fontFamily
:
'Gotham-Black'
,
color
:
'white'
,
fontSize
:
16
,
textAlign
:
'center'
}}
>
Tambah
Alamat
<
/Text
>
<
/View
>
<
/TouchableOpacity
>
<
/View
>
...
...
@@ -312,6 +314,7 @@ const mapStateToProps = (state) => {
}
}
export
default
connect
(
mapStateToProps
)(
AddreesDetail
)
// <TextInput style={{ height: 40, borderWidth: 1, padding: 5, margin: 10,borderRadius:5 }} onChangeText={(address) => this.setState({ address })} />
\ No newline at end of file
view/DeliveryAddrees.js
View file @
265e5f7e
...
...
@@ -12,6 +12,7 @@ class DeliveryAddrees extends React.Component {
constructor
(
props
)
{
super
(
props
)
this
.
state
=
{
address_name
:
[],
data
:
[],
data_before_search
:
[],
search
:
''
,
...
...
@@ -49,6 +50,14 @@ class DeliveryAddrees extends React.Component {
data
:
address
,
data_before_search
:
dataAlamat
,
})
let
data_alamat
=
[]
this
.
state
.
data
.
map
(
item
=>
{
let
b
=
item
.
name
data_alamat
.
push
(
b
)
})
}).
catch
(
error
=>
{
let
response
=
error
.
response
.
data
;
Alert
.
alert
(
...
...
@@ -132,14 +141,20 @@ class DeliveryAddrees extends React.Component {
}
onSave
(
address
,
id
)
{
onSave
(
address
,
id
,
description
)
{
console
.
log
(
"INI ALAMAT : "
+
address
)
console
.
log
(
"INI id : "
+
id
)
console
.
log
(
"INI description : "
+
description
)
let
setDataAddress
=
{
address
:
address
,
addressId
:
id
addressId
:
id
,
home_address
:
''
}
this
.
props
.
setAddress
(
setDataAddress
);
let
params
=
{
session_id
:
this
.
props
.
session_id
,
address_id
:
id
,
...
...
@@ -221,7 +236,7 @@ class DeliveryAddrees extends React.Component {
/>
<
/View
>
<
View
>
<
Text
style
=
{{
textAlign
:
'center'
,
color
:
'#ccb46c'
,
fontFamily
:
'Gotham-Light'
,
marginRight
:
20
}}
>
PILIH
<
/Text
>
<
Text
style
=
{{
textAlign
:
'center'
,
color
:
'#ccb46c'
,
fontFamily
:
'Gotham-Light'
,
marginRight
:
20
}}
>
PILIH
<
/Text
>
<
/View
>
<
/View
>
...
...
@@ -243,7 +258,7 @@ class DeliveryAddrees extends React.Component {
return
(
<
View
style
=
{
styles
.
container
}
>
<
View
style
=
{{
height
:
45
,
borderRadius
:
10
,
borderColor
:
'#ccb46c'
,
borderWidth
:
1
,
flexDirection
:
'row'
,
marginTop
:
15
,
marginLeft
:
20
,
marginRight
:
20
}}
>
<
View
style
=
{{
flex
:
1
,
top
:
5
}}
>
<
View
style
=
{{
flex
:
1
,
top
:
5
}}
>
<
MaterialCommunityIcons
name
=
"map-marker"
size
=
{
32
}
color
=
"#ccb46c"
/>
<
/View
>
<
View
style
=
{{
flex
:
6
}}
>
...
...
@@ -337,7 +352,8 @@ const mapDispatchToProps = (dispacth) => {
data
:
{
address
:
setDataAddress
.
address
,
addressId
:
setDataAddress
.
addressId
addressId
:
setDataAddress
.
addressId
,
home_address
:
setDataAddress
.
home_address
}
}),
...
...
view/ShoppingCart.js
View file @
265e5f7e
...
...
@@ -45,7 +45,7 @@ class ShoppingCart extends React.Component {
componentDidMount
()
{
// console.log(this.props.voucher
)
console
.
log
(
this
.
props
.
home_address
)
// console.log('INI VALUE : ' + this.props.value_voucher)
if
(
!
this
.
props
.
type_pickup
)
{
this
.
getRate
()
...
...
@@ -451,6 +451,7 @@ class ShoppingCart extends React.Component {
<
View
style
=
{{
margin
:
5
,
padding
:
10
}}
>
<
Text
style
=
{{
textAlign
:
'center'
,
fontFamily
:
'Gotham-Black'
,
fontSize
:
12
,
color
:
'grey'
}}
>
OUR
DRIVER
WILL
DELIVER
YOUR
ORDER
TO
<
/Text
>
<
Text
style
=
{{
textAlign
:
'center'
,
fontSize
:
12
,
top
:
5
,
fontFamily
:
'Gotham-Light'
,
color
:
'grey'
}}
>
{
this
.
props
.
address
}
<
/Text
>
<
Text
style
=
{{
textAlign
:
'center'
,
fontSize
:
12
,
top
:
5
,
fontFamily
:
'Gotham-Light'
,
color
:
'grey'
}}
>
{
this
.
props
.
home_address
}
<
/Text
>
<
/View
>
)
}
...
...
@@ -983,6 +984,7 @@ const mapDispatchToProps = (dispacth) => {
const
mapStateToProps
=
(
state
)
=>
{
return
{
home_address
:
state
.
home_address
,
type_pickup
:
state
.
type_pickup
,
value_voucher
:
state
.
value_voucher
,
voucher
:
state
.
voucher
,
...
...
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