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
b231ac43
Commit
b231ac43
authored
Oct 06, 2020
by
Trisno
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pengecekan untuk pemanggilan API get value hanya untuk reward percentage
parent
9b3d5ea8
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
42 additions
and
21 deletions
+42
-21
DeliveryAddrees.js
view/DeliveryAddrees.js
+3
-1
MenuSelection.js
view/MenuSelection.js
+14
-10
PickupName.js
view/PickupName.js
+3
-1
ShoppingCart.js
view/ShoppingCart.js
+22
-9
No files found.
view/DeliveryAddrees.js
View file @
b231ac43
...
...
@@ -201,7 +201,9 @@ class DeliveryAddrees extends React.Component {
}
if
(
this
.
props
.
value_voucher
!==
""
)
{
this
.
handleVoucherSelect
()
if
(
this
.
props
.
value_voucher
.
reward
.
type
==
'percentage'
)
{
this
.
handleVoucherSelect
()
}
}
}).
catch
(
error
=>
{
...
...
view/MenuSelection.js
View file @
b231ac43
...
...
@@ -243,15 +243,15 @@ class MenuSelection 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
=>
{
let
voucherProps
=
{
value_voucher
:
res
.
data
.
reward
,
voucher
:
res
.
data
.
reward
}
let
voucherProps
=
{
value_voucher
:
res
.
data
.
reward
,
voucher
:
res
.
data
.
reward
}
this
.
props
.
setVoucher
(
voucherProps
);
this
.
setState
({
spinner
:
false
,
})
this
.
props
.
setVoucher
(
voucherProps
);
this
.
setState
({
spinner
:
false
,
})
}).
catch
(
error
=>
{
try
{
let
response
=
error
.
response
.
data
...
...
@@ -319,7 +319,9 @@ class MenuSelection extends React.Component {
let
res
=
this
.
props
.
addToChart
(
order_item
)
if
(
this
.
props
.
value_voucher
!==
""
)
{
this
.
handleVoucherSelect
()
if
(
this
.
props
.
value_voucher
.
reward
.
type
==
'percentage'
)
{
this
.
handleVoucherSelect
()
}
}
// console.log('After add : ' + JSON.stringify(res))
...
...
@@ -378,7 +380,9 @@ class MenuSelection extends React.Component {
}
}
if
(
this
.
props
.
value_voucher
!==
""
)
{
this
.
handleVoucherSelect
()
if
(
this
.
props
.
value_voucher
.
reward
.
type
==
'percentage'
)
{
this
.
handleVoucherSelect
()
}
}
}
...
...
view/PickupName.js
View file @
b231ac43
...
...
@@ -123,7 +123,9 @@ class PickupName extends React.Component {
getOutletDetail
(
id
,
name
,
address
)
{
if
(
this
.
props
.
value_voucher
!==
""
)
{
this
.
handleVoucherSelect
()
if
(
this
.
props
.
value_voucher
.
reward
.
type
==
'percentage'
)
{
this
.
handleVoucherSelect
()
}
}
let
OutletChange
=
{
...
...
view/ShoppingCart.js
View file @
b231ac43
...
...
@@ -120,12 +120,12 @@ class ShoppingCart extends React.Component {
let
date_time_now
=
new
Date
()
let
exp_time
=
new
Date
(
this
.
props
.
value_voucher
.
expire_time
)
console
.
log
(
date_time_now
)
console
.
log
(
exp_time
)
//
console.log(date_time_now)
//
console.log(exp_time)
// console.log(date_time_now > exp_time)
// console.log(this.props.value_voucher)
if
(
date_time_now
>
exp_time
)
{
console
.
log
(
'tes kepanggil'
)
//
console.log('tes kepanggil')
this
.
props
.
removeVoucher
()
}
...
...
@@ -262,6 +262,7 @@ class ShoppingCart extends React.Component {
}
handleRemoveVoucher
()
{
// console.log(this.state.state_add_remove_voucher)
//panggil spiner
if
(
this
.
props
.
value_voucher
!==
""
)
{
this
.
handleVoucherSelect
()
...
...
@@ -269,6 +270,7 @@ class ShoppingCart extends React.Component {
state_add_remove_voucher
:
true
})
}
this
.
setState
({
checkedBalance
:
false
,
checkedPoint
:
false
,
...
...
@@ -282,7 +284,9 @@ class ShoppingCart extends React.Component {
handleAddVoucher
()
{
if
(
this
.
props
.
value_voucher
!==
""
)
{
this
.
handleVoucherSelect
()
if
(
this
.
props
.
value_voucher
.
reward
.
type
==
'percentage'
)
{
this
.
handleVoucherSelect
()
}
}
this
.
setState
({
...
...
@@ -330,7 +334,9 @@ class ShoppingCart extends React.Component {
this
.
props
.
reduceQuantityItem
(
order_item
)
if
(
this
.
props
.
value_voucher
!==
""
)
{
this
.
handleVoucherSelect
()
if
(
this
.
props
.
value_voucher
.
reward
.
type
==
'percentage'
)
{
this
.
handleVoucherSelect
()
}
}
if
(
is_xist
.
quantity
==
0
)
{
...
...
@@ -356,7 +362,9 @@ class ShoppingCart extends React.Component {
}
else
{
this
.
props
.
reduceQuantityItem
(
order_item
)
if
(
this
.
props
.
value_voucher
!==
""
)
{
this
.
handleVoucherSelect
()
if
(
this
.
props
.
value_voucher
.
reward
.
type
==
'percentage'
)
{
this
.
handleVoucherSelect
()
}
}
}
}
...
...
@@ -394,7 +402,9 @@ class ShoppingCart extends React.Component {
}
if
(
this
.
props
.
value_voucher
!==
""
)
{
this
.
handleVoucherSelect
()
if
(
this
.
props
.
value_voucher
.
reward
.
type
==
'percentage'
)
{
this
.
handleVoucherSelect
()
}
}
}
...
...
@@ -641,7 +651,9 @@ class ShoppingCart extends React.Component {
addItem
()
{
if
(
this
.
props
.
value_voucher
!==
""
)
{
this
.
handleVoucherSelect
()
if
(
this
.
props
.
value_voucher
.
reward
.
type
==
'percentage'
)
{
this
.
handleVoucherSelect
()
}
}
this
.
props
.
navigation
.
goBack
()
...
...
@@ -1014,7 +1026,8 @@ class ShoppingCart extends React.Component {
)
:
(
<
View
style
=
{{
flexDirection
:
'row'
,
justifyContent
:
'space-between'
}}
>
<
View
style
=
{{
paddingLeft
:
20
,
paddingTop
:
5
,
}}
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
,
color
:
'gray'
}}
>
{
i18n
.
t
(
'discount'
)}
<
/Text
>
{
/* <Text style={{ fontSize: 12, fontFamily: 'Gotham-Light', color: 'gray' }}>{i18n.t('discount')}</Text> */
}
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
,
color
:
'gray'
}}
>
{
this
.
props
.
voucher
.
reward
.
title
}
<
/Text
>
<
/View
>
<
View
style
=
{{
paddingRight
:
20
,
paddingTop
:
5
,
alignItems
:
'flex-end'
}}
>
<
NumberFormat
decimalScale
=
{
0
}
value
=
{
this
.
props
.
voucher
.
reward
.
value
}
renderText
=
{
value
=>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
,
color
:
'gray'
}}
>-
Rp
.
{
value
}
<
/Text>} displayType={'text'} thousandSeparator={true} prefix={''} /
>
...
...
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