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
8ceb9290
Commit
8ceb9290
authored
Sep 25, 2020
by
Wahyu Adjie Prasetyo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
benerin delivery address
parent
ad94f5ca
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
35 deletions
+34
-35
DeliveryAddrees.js
view/DeliveryAddrees.js
+34
-35
No files found.
view/DeliveryAddrees.js
View file @
8ceb9290
...
...
@@ -130,7 +130,7 @@ class DeliveryAddrees extends React.Component {
}).
catch
(
error
=>
{
let
response
=
error
.
response
.
data
;
Alert
.
alert
(
''
,
response
.
msg
);
Alert
.
alert
(
''
,
response
.
msg
);
})
}
...
...
@@ -181,8 +181,6 @@ class DeliveryAddrees extends React.Component {
Axios
.
post
(
this
.
props
.
BASE_URL
+
'crm/v2/delivery/rate'
,
params
).
then
(
res
=>
{
let
setGrabProps
=
{
// grabdestination: this.state.grabdestination,
// grabamount: this.state.grabamount,
grabamount
:
res
.
data
.
data
.
amount
}
...
...
@@ -269,25 +267,14 @@ class DeliveryAddrees extends React.Component {
// MULAI DISINI PEMANGGILAN API DI MULAI, KALAU BERHASIL SET VALUE VOUCHER NYA DAN SPINER DIMATIKAN, KALAU GAGAL CABUT SESSION VOUCHER DAN SPINNER DI MATIKAN
Axios
.
post
(
this
.
props
.
BASE_URL
+
'crm/v2/reward/get_value'
,
params
).
then
(
res
=>
{
if
(
this
.
state
.
state_add_remove_voucher
==
true
)
{
this
.
setState
({
state_add_remove_voucher
:
false
})
this
.
props
.
removeVoucher
()
}
else
{
let
voucherProps
=
{
value_voucher
:
res
.
data
.
reward
,
voucher
:
res
.
data
.
reward
}
this
.
props
.
setVoucher
(
voucherProps
);
}
this
.
setState
({
spinner
:
false
,
})
}).
catch
(
error
=>
{
try
{
let
response
=
error
.
response
.
data
...
...
@@ -298,7 +285,10 @@ class DeliveryAddrees extends React.Component {
// FUNGSI REDUX UNTUK HAPUS VOUCHER
this
.
props
.
removeVoucher
()
}
catch
(
error
)
{
Alert
.
alert
(
""
,
error
.
toString
())
Alert
.
alert
(
"Error : "
,
error
.
toString
())
this
.
setState
({
spinner
:
false
,
})
}
})
}
...
...
@@ -348,9 +338,9 @@ class DeliveryAddrees extends React.Component {
<
/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
}}
>
<
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
>
...
...
@@ -375,7 +365,7 @@ class DeliveryAddrees extends React.Component {
onChangeText
=
{
text
=>
this
.
filterData
(
text
)}
onClear
=
{
text
=>
this
.
filterData
(
''
)}
caretHidden
=
{
this
.
state
.
caretHidden
}
onFocus
=
{()
=>
this
.
setState
({
caretHidden
:
false
})}
onFocus
=
{()
=>
this
.
setState
({
caretHidden
:
false
})}
value
=
{
this
.
state
.
search
}
><
/TextInput
>
<
/View
>
<
View
style
=
{{
flex
:
1
,
margin
:
5
}}
>
...
...
@@ -532,6 +522,15 @@ const mapDispatchToProps = (dispacth) => {
removeVoucher
:
()
=>
dispacth
({
type
:
ActionType
.
REMOVE_VOUCHER
}),
setVoucher
:
(
voucherProps
)
=>
dispacth
({
type
:
ActionType
.
SET_VOUCHER
,
data
:
{
voucher
:
voucherProps
.
voucher
,
value_voucher
:
voucherProps
.
value_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