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
657118ac
Commit
657118ac
authored
Sep 16, 2019
by
高淑倩
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
实付款
parent
a566706a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
48 additions
and
8 deletions
+48
-8
selectCoupon.js
src/component/selectCoupon/selectCoupon.js
+15
-1
confirmOrder.js
src/pages/confirmOrder/confirmOrder.js
+29
-5
confirmOrder.wxml
src/pages/confirmOrder/confirmOrder.wxml
+4
-2
No files found.
src/component/selectCoupon/selectCoupon.js
View file @
657118ac
...
@@ -60,10 +60,24 @@ Component({
...
@@ -60,10 +60,24 @@ Component({
})
})
couponList
[
index
].
checked
=
true
couponList
[
index
].
checked
=
true
let
params
=
{
type
,
faceAmount
:
''
}
if
(
type
==
1
){
params
.
faceAmount
=
couponList
[
index
].
couponSettingDTO
.
faceAmount
}
else
if
(
type
==
2
){
params
.
faceAmount
=
couponList
[
index
].
couponSettingDTO
.
faceAmount
}
wxService
.
nextTick
(()
=>
{
wxService
.
nextTick
(()
=>
{
this
.
triggerEvent
(
'updateCoupon'
,
couponList
[
index
].
couponDiscount
)
this
.
triggerEvent
(
'updateCoupon'
,
params
)
})
})
// wxService.nextTick(() => {
// this.triggerEvent('updateCoupon', couponList[index].couponDiscount)
// })
this
.
setData
({
this
.
setData
({
couponList
couponList
},()
=>
{
},()
=>
{
...
...
src/pages/confirmOrder/confirmOrder.js
View file @
657118ac
...
@@ -20,7 +20,8 @@ wxService.page({
...
@@ -20,7 +20,8 @@ wxService.page({
cityView
:
''
,
cityView
:
''
,
multiIndex
:
[
0
,
0
,
0
],
multiIndex
:
[
0
,
0
,
0
],
selectCityName
:
[
''
,
''
],
selectCityName
:
[
''
,
''
],
currentCoupon
:
'无可用优惠券'
currentCoupon
:
''
,
orderPrice
:
null
,
// 订单金额
},
},
/**
/**
...
@@ -63,14 +64,34 @@ wxService.page({
...
@@ -63,14 +64,34 @@ wxService.page({
// 地址列表
// 地址列表
this
.
getAddressList
()
this
.
getAddressList
()
},
},
updateCoupon
(
e
){
updateCoupon
(
e
)
{
console
.
log
(
'e'
,
e
.
detail
)
console
.
log
(
'e'
,
e
.
detail
)
if
(
e
.
detail
){
// faceAmount 抵用多少钱(分) 1 抵用券 2 折扣券
const
{
faceAmount
,
type
}
=
e
.
detail
const
{
orderPrice
}
=
this
.
data
if
(
type
==
1
)
{
this
.
setData
({
this
.
setData
({
haveCoupon
:
true
,
haveCoupon
:
true
,
currentCoupon
:
`-
${
e
.
detail
}
`
currentCoupon
:
`
${
faceAmount
/
100
}
`
})
}
else
if
(
type
==
2
)
{
let
discounPrice
=
(
faceAmount
/
100
)
*
(
orderPrice
)
let
spread
=
Math
.
round
(
orderPrice
-
discounPrice
)
this
.
setData
({
haveCoupon
:
true
,
currentCoupon
:
`
${
spread
}
`
})
})
}
}
// 实付款
this
.
setPayPrice
()
},
setPayPrice
()
{
const
{
currentCoupon
,
orderPrice
}
=
this
.
data
let
orderCoupon
=
parseFloat
(
currentCoupon
)
this
.
setData
({
orderPrice
:
Math
.
round
(
orderPrice
-
currentCoupon
)
})
},
},
formSubmit
(
e
)
{
formSubmit
(
e
)
{
const
{
goodsAddress
}
=
this
.
data
const
{
goodsAddress
}
=
this
.
data
...
@@ -230,7 +251,10 @@ wxService.page({
...
@@ -230,7 +251,10 @@ wxService.page({
const
{
result
,
data
}
=
res
.
data
const
{
result
,
data
}
=
res
.
data
if
(
result
==
0
)
{
if
(
result
==
0
)
{
wx
.
hideLoading
()
wx
.
hideLoading
()
this
.
setData
({
currentOrderList
:
data
})
this
.
setData
({
currentOrderList
:
data
,
orderPrice
:
data
.
amount
})
}
}
}
}
})
})
...
...
src/pages/confirmOrder/confirmOrder.wxml
View file @
657118ac
<!--pages/confirmOrder/confirmOrder.wxml-->
<!--pages/confirmOrder/confirmOrder.wxml-->
<wxs src="../..//wxs/utils.wxs" module="utils" />
<view class="page-confirm-order">
<view class="page-confirm-order">
<form bindsubmit="formSubmit">
<form bindsubmit="formSubmit">
<view class="address-wrap">
<view class="address-wrap">
...
@@ -122,7 +124,7 @@
...
@@ -122,7 +124,7 @@
<view>
<view>
<text class="price-label">优惠券</text>
<text class="price-label">优惠券</text>
<view class="select-coupon" bindtap="selectCoupon">
<view class="select-coupon" bindtap="selectCoupon">
<text class="{{haveCoupon ? 'coupon-price' : 'no-coupon'}}">{{currentCoupon}}</text>
<text class="{{haveCoupon ? 'coupon-price' : 'no-coupon'}}">
{{currentCoupon ? '-' : '无可用优惠券'}}
{{currentCoupon}}</text>
<image class="arrow-right" src="/assets/imgs/7_1_0/arrow-right.png" />
<image class="arrow-right" src="/assets/imgs/7_1_0/arrow-right.png" />
</view>
</view>
</view>
</view>
...
@@ -147,7 +149,7 @@
...
@@ -147,7 +149,7 @@
<view class="pro-footer">
<view class="pro-footer">
<view class="cost">
<view class="cost">
<text class="cost-label">实付款:</text>
<text class="cost-label">实付款:</text>
<text class="cost-price">¥{{
currentOrderList.amount
}}</text>
<text class="cost-price">¥{{
utils.numberFormat(orderPrice)
}}</text>
</view>
</view>
<!-- <button form-type="submit" class="theme-color buy-btn">立即购买</button>-->
<!-- <button form-type="submit" class="theme-color buy-btn">立即购买</button>-->
<!-- <view class="theme-color buy-btn" bindtap="handelGobuy">立即购买</view> -->
<!-- <view class="theme-color buy-btn" bindtap="handelGobuy">立即购买</view> -->
...
...
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