Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
7
7-Eleven
Overview
Overview
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
高淑倩
7-Eleven
Commits
6dc3a2d5
Commit
6dc3a2d5
authored
Sep 16, 2019
by
高淑倩
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
coupon
parent
657118ac
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
7 deletions
+10
-7
selectCoupon.js
src/component/selectCoupon/selectCoupon.js
+2
-1
confirmOrder.js
src/pages/confirmOrder/confirmOrder.js
+8
-6
No files found.
src/component/selectCoupon/selectCoupon.js
View file @
6dc3a2d5
...
...
@@ -54,7 +54,7 @@ Component({
// 1 抵用券 2 折扣券
const
{
id
,
index
,
type
}
=
e
.
currentTarget
.
dataset
const
{
couponList
}
=
this
.
data
console
.
log
(
'type---1 抵用券 2 折扣券 '
,
id
,
index
,
type
)
couponList
.
forEach
(
item
=>
{
item
.
checked
=
false
})
...
...
@@ -62,6 +62,7 @@ Component({
let
params
=
{
type
,
id
,
faceAmount
:
''
}
if
(
type
==
1
){
...
...
src/pages/confirmOrder/confirmOrder.js
View file @
6dc3a2d5
...
...
@@ -65,22 +65,23 @@ wxService.page({
this
.
getAddressList
()
},
updateCoupon
(
e
)
{
console
.
log
(
'e'
,
e
.
detail
)
// faceAmount 抵用多少钱(分) 1 抵用券 2 折扣券
const
{
faceAmount
,
type
}
=
e
.
detail
const
{
faceAmount
,
type
,
id
}
=
e
.
detail
const
{
orderPrice
}
=
this
.
data
console
.
log
(
'id'
,
id
)
if
(
type
==
1
)
{
this
.
setData
({
couponId
:
id
,
haveCoupon
:
true
,
currentCoupon
:
`
${
faceAmount
/
100
}
`
currentCoupon
:
`
${
faceAmount
/
100
}
元
`
})
}
else
if
(
type
==
2
)
{
let
discounPrice
=
(
faceAmount
/
100
)
*
(
orderPrice
)
let
spread
=
Math
.
round
(
orderPrice
-
discounPrice
)
this
.
setData
({
couponId
:
id
,
haveCoupon
:
true
,
currentCoupon
:
`
${
spread
}
`
currentCoupon
:
`
${
spread
}
折
`
})
}
// 实付款
...
...
@@ -89,8 +90,9 @@ wxService.page({
setPayPrice
()
{
const
{
currentCoupon
,
orderPrice
}
=
this
.
data
let
orderCoupon
=
parseFloat
(
currentCoupon
)
console
.
log
(
'orderPrice - orderCoupon'
,
orderPrice
-
orderCoupon
)
this
.
setData
({
orderPrice
:
Math
.
round
(
orderPrice
-
current
Coupon
)
orderPrice
:
Math
.
round
(
orderPrice
-
order
Coupon
)
})
},
formSubmit
(
e
)
{
...
...
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