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
39aa0048
Commit
39aa0048
authored
Aug 05, 2020
by
Trisno
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
debug metode pembayaran
parent
021bd1f6
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
86 additions
and
35 deletions
+86
-35
ShoppingCart.js
view/ShoppingCart.js
+86
-35
No files found.
view/ShoppingCart.js
View file @
39aa0048
...
@@ -62,7 +62,7 @@ class ShoppingCart extends React.Component {
...
@@ -62,7 +62,7 @@ class ShoppingCart extends React.Component {
let
params
=
this
.
props
.
route
.
params
;
let
params
=
this
.
props
.
route
.
params
;
if
(
params
!=
undefined
)
{
if
(
params
!=
undefined
)
{
if
(
params
.
outlet_change
!=
undefined
&&
params
.
outlet_change
)
{
if
(
params
.
outlet_change
!=
undefined
&&
params
.
outlet_change
)
{
Axios
.
post
(
this
.
props
.
BASE_URL
+
'crm/v2/menu/get_list'
,
{
Axios
.
post
(
this
.
props
.
BASE_URL
+
'crm/v2/menu/get_list'
,
{
outlet_id
:
params
.
outlet_id
outlet_id
:
params
.
outlet_id
}).
then
(
res
=>
{
}).
then
(
res
=>
{
let
data
=
res
.
data
.
data
let
data
=
res
.
data
.
data
...
@@ -276,6 +276,7 @@ class ShoppingCart extends React.Component {
...
@@ -276,6 +276,7 @@ class ShoppingCart extends React.Component {
}
}
}
else
if
(
val
==
'point'
)
{
}
else
if
(
val
==
'point'
)
{
if
(
this
.
props
.
type_pickup
==
true
)
{
if
(
this
.
props
.
type_pickup
==
true
)
{
if
(
this
.
props
.
value_voucher
==
''
)
{
this
.
setState
({
this
.
setState
({
checkedBalance
:
false
,
checkedBalance
:
false
,
checkedPoint
:
true
,
checkedPoint
:
true
,
...
@@ -284,6 +285,16 @@ class ShoppingCart extends React.Component {
...
@@ -284,6 +285,16 @@ class ShoppingCart extends React.Component {
balanceused
:
0
balanceused
:
0
})
})
}
else
{
}
else
{
this
.
setState
({
checkedBalance
:
false
,
checkedPoint
:
true
,
checkedBalancePoint
:
false
,
pointsused
:
Math
.
max
(
0
,
this
.
props
.
order_total
-
this
.
props
.
voucher
.
reward
.
value
),
balanceused
:
0
})
}
}
else
{
if
(
this
.
props
.
value_voucher
==
''
)
{
this
.
setState
({
this
.
setState
({
checkedBalance
:
false
,
checkedBalance
:
false
,
checkedPoint
:
true
,
checkedPoint
:
true
,
...
@@ -291,6 +302,15 @@ class ShoppingCart extends React.Component {
...
@@ -291,6 +302,15 @@ class ShoppingCart extends React.Component {
pointsused
:
this
.
props
.
order_total
+
this
.
props
.
grabamount
,
pointsused
:
this
.
props
.
order_total
+
this
.
props
.
grabamount
,
balanceused
:
0
balanceused
:
0
})
})
}
else
{
this
.
setState
({
checkedBalance
:
false
,
checkedPoint
:
true
,
checkedBalancePoint
:
false
,
pointsused
:
Math
.
max
(
0
,
this
.
props
.
order_total
-
this
.
props
.
voucher
.
reward
.
value
+
this
.
props
.
grabamount
),
balanceused
:
0
})
}
}
}
}
else
{
}
else
{
this
.
setState
({
this
.
setState
({
...
@@ -300,6 +320,7 @@ class ShoppingCart extends React.Component {
...
@@ -300,6 +320,7 @@ class ShoppingCart extends React.Component {
})
})
if
(
this
.
props
.
type_pickup
==
true
)
{
if
(
this
.
props
.
type_pickup
==
true
)
{
if
(
this
.
props
.
value_voucher
==
''
)
{
if
(
this
.
state
.
kasproPoint
-
this
.
props
.
order_total
>=
-
1
)
{
if
(
this
.
state
.
kasproPoint
-
this
.
props
.
order_total
>=
-
1
)
{
this
.
setState
({
this
.
setState
({
pointsused
:
this
.
props
.
order_total
,
pointsused
:
this
.
props
.
order_total
,
...
@@ -312,6 +333,23 @@ class ShoppingCart extends React.Component {
...
@@ -312,6 +333,23 @@ class ShoppingCart extends React.Component {
})
})
}
}
}
else
{
}
else
{
////////////// JIKA KASPRO POINT TIDAK HABIS DIKURANG TOTAL SETELAH DIKURANGI VOUCHER //////////////////
if
(
this
.
state
.
kasproPoint
-
(
parseInt
(
this
.
props
.
order_total
)
-
parseInt
(
this
.
props
.
voucher
.
reward
.
value
))
>=
-
1
)
{
this
.
setState
({
pointsused
:
Math
.
max
(
0
,
this
.
props
.
order_total
-
this
.
props
.
voucher
.
reward
.
value
),
balanceused
:
0
})
}
/////////// JIKA KASPRO POINT KURANG DARI TOTAL SETELAH DIKURANGI VOUCHER/////////
else
{
this
.
setState
({
balanceused
:
(
parseInt
(
this
.
props
.
order_total
)
-
parseInt
(
this
.
props
.
voucher
.
reward
.
value
))
-
parseInt
(
this
.
state
.
kasproPoint
),
pointsused
:
this
.
state
.
kasproPoint
})
}
}
}
else
{
if
(
this
.
props
.
value_voucher
==
''
)
{
if
(
this
.
state
.
kasproPoint
-
(
this
.
props
.
order_total
+
this
.
props
.
grabamount
)
>=
-
1
)
{
if
(
this
.
state
.
kasproPoint
-
(
this
.
props
.
order_total
+
this
.
props
.
grabamount
)
>=
-
1
)
{
this
.
setState
({
this
.
setState
({
pointsused
:
this
.
props
.
order_total
+
this
.
props
.
grabamount
,
pointsused
:
this
.
props
.
order_total
+
this
.
props
.
grabamount
,
...
@@ -323,6 +361,19 @@ class ShoppingCart extends React.Component {
...
@@ -323,6 +361,19 @@ class ShoppingCart extends React.Component {
pointsused
:
this
.
state
.
kasproPoint
pointsused
:
this
.
state
.
kasproPoint
})
})
}
}
}
else
{
if
(
this
.
state
.
kasproPoint
-
((
parseInt
(
this
.
props
.
order_total
)
-
parseInt
(
this
.
props
.
voucher
.
reward
.
value
))
+
this
.
props
.
grabamount
)
>=
-
1
)
{
this
.
setState
({
pointsused
:
this
.
props
.
order_total
+
this
.
props
.
grabamount
,
balanceused
:
0
})
}
else
{
this
.
setState
({
balanceused
:
(
this
.
props
.
order_total
+
this
.
props
.
grabamount
)
-
this
.
state
.
kasproPoint
,
pointsused
:
this
.
state
.
kasproPoint
})
}
}
}
}
}
}
}
}
...
@@ -336,7 +387,7 @@ class ShoppingCart extends React.Component {
...
@@ -336,7 +387,7 @@ class ShoppingCart extends React.Component {
// console.log("INI PRAMETER NYA : " + JSON.stringify(params))
// console.log("INI PRAMETER NYA : " + JSON.stringify(params))
Axios
.
post
(
this
.
props
.
BASE_URL
+
'crm/v2/delivery/rate'
,
params
).
then
(
res
=>
{
Axios
.
post
(
this
.
props
.
BASE_URL
+
'crm/v2/delivery/rate'
,
params
).
then
(
res
=>
{
this
.
setState
({
this
.
setState
({
grabamount
:
res
.
data
.
data
.
amount
,
grabamount
:
res
.
data
.
data
.
amount
,
...
@@ -405,7 +456,7 @@ class ShoppingCart extends React.Component {
...
@@ -405,7 +456,7 @@ class ShoppingCart extends React.Component {
session_id
:
this
.
props
.
session_id
,
session_id
:
this
.
props
.
session_id
,
}
}
Axios
.
post
(
this
.
props
.
BASE_URL
+
'crm/v2/member/get_profile'
,
params
).
then
(
res
=>
{
Axios
.
post
(
this
.
props
.
BASE_URL
+
'crm/v2/member/get_profile'
,
params
).
then
(
res
=>
{
const
{
kaspro_balance
,
kaspro_point
}
=
res
.
data
const
{
kaspro_balance
,
kaspro_point
}
=
res
.
data
this
.
setState
({
this
.
setState
({
kasproBalance
:
kaspro_balance
.
replace
(
/,/g
,
''
),
kasproBalance
:
kaspro_balance
.
replace
(
/,/g
,
''
),
...
...
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