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
39c403a1
Commit
39c403a1
authored
Sep 19, 2019
by
高淑倩
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
默认付费会员
parent
fd1187ee
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
18 deletions
+42
-18
confirmOrder.js
src/pages/confirmOrder/confirmOrder.js
+37
-6
confirmOrder.wxml
src/pages/confirmOrder/confirmOrder.wxml
+3
-3
project.config.json
src/project.config.json
+2
-9
No files found.
src/pages/confirmOrder/confirmOrder.js
View file @
39c403a1
...
@@ -23,6 +23,9 @@ wxService.page({
...
@@ -23,6 +23,9 @@ wxService.page({
wxAddress
:
false
,
wxAddress
:
false
,
currentCoupon
:
''
,
currentCoupon
:
''
,
orderPrice
:
null
,
// 订单金额
orderPrice
:
null
,
// 订单金额
orderInitPrice
:
0
,
plusMemberPrice
:
0
,
// plus 默认价
plusMemberName
:
''
},
},
/**
/**
...
@@ -88,11 +91,13 @@ wxService.page({
...
@@ -88,11 +91,13 @@ wxService.page({
this
.
setPayPrice
()
this
.
setPayPrice
()
},
},
setPayPrice
()
{
setPayPrice
()
{
const
{
currentCoupon
,
orderPrice
}
=
this
.
data
const
{
currentCoupon
,
orderInitPrice
,
isSelect
,
plusMemberPrice
}
=
this
.
data
let
orderCoupon
=
parseFloat
(
currentCoupon
)
let
newCurrentCoupon
=
currentCoupon
?
currentCoupon
:
0
let
orderCoupon
=
parseFloat
(
newCurrentCoupon
)
// 优惠券价格
let
plusPrice
=
isSelect
?
plusMemberPrice
:
0
// plus
this
.
setData
({
this
.
setData
({
orderPrice
:
Math
.
round
(
orderPrice
-
orderCoupon
)
// orderPrice: Math.round(orderInitPrice - orderCoupon)
orderPrice
:
orderInitPrice
-
orderCoupon
-
plusPrice
})
})
},
},
formSubmit
(
e
)
{
formSubmit
(
e
)
{
...
@@ -235,8 +240,31 @@ wxService.page({
...
@@ -235,8 +240,31 @@ wxService.page({
trolleySku2Buy
trolleySku2Buy
}
}
this
.
calPreferentialPrice
(
params
)
// 重新计算优惠价
this
.
calPreferentialPrice
(
params
)
// 重新计算优惠价
// 获取默认付费会员设置
this
.
getPremiumDefault
()
})
})
})
},
// /premium/getDefault
getPremiumDefault
()
{
wx
.
showLoading
({
title
:
'加载中'
})
wxService
.
get
(
`/sale/premium/getDefault`
).
then
(
res
=>
{
if
(
res
)
{
const
{
result
,
data
}
=
res
.
data
if
(
result
==
0
)
{
wx
.
hideLoading
()
this
.
setData
({
plusMemberPrice
:
data
.
price
,
plusMemberName
:
data
.
name
},()
=>
{
// 实付款
this
.
setPayPrice
()
})
}
}
})
})
},
},
// 默认地址
// 默认地址
...
@@ -255,7 +283,10 @@ wxService.page({
...
@@ -255,7 +283,10 @@ wxService.page({
wx
.
hideLoading
()
wx
.
hideLoading
()
this
.
setData
({
this
.
setData
({
currentOrderList
:
data
,
currentOrderList
:
data
,
orderPrice
:
data
.
amount
orderInitPrice
:
data
.
amount
},()
=>
{
// 实付款
this
.
setPayPrice
()
})
})
}
}
}
}
...
...
src/pages/confirmOrder/confirmOrder.wxml
View file @
39c403a1
...
@@ -117,7 +117,7 @@
...
@@ -117,7 +117,7 @@
<text class="price-label">plus会员价</text>
<text class="price-label">plus会员价</text>
<text class="member-price">-¥20</text>
<text class="member-price">-¥20</text>
</view>
</view>
<text class="plus-member-price">¥
289
</text>
<text class="plus-member-price">¥
{{plusMemberPrice}}
</text>
</view>
</view>
</view>
</view>
<view class="coupon">
<view class="coupon">
...
@@ -131,10 +131,10 @@
...
@@ -131,10 +131,10 @@
</view>
</view>
<view class="coupon" wx:if="{{isSelect}}">
<view class="coupon" wx:if="{{isSelect}}">
<view>
<view>
<text class="price-label">
VIP会员年费
</text>
<text class="price-label">
{{plusMemberName}}
</text>
<text class="vip-desc"> (不可使用任何优惠或积分)</text>
<text class="vip-desc"> (不可使用任何优惠或积分)</text>
<view class="select-coupon">
<view class="select-coupon">
<text class="coupon-price">+¥
100
</text>
<text class="coupon-price">+¥
{{plusMemberPrice}}
</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>
...
...
src/project.config.json
View file @
39c403a1
...
@@ -39,7 +39,7 @@
...
@@ -39,7 +39,7 @@
"list"
:
[]
"list"
:
[]
},
},
"miniprogram"
:
{
"miniprogram"
:
{
"current"
:
13
,
"current"
:
-1
,
"list"
:
[
"list"
:
[
{
{
"id"
:
-1
,
"id"
:
-1
,
...
@@ -148,14 +148,7 @@
...
@@ -148,14 +148,7 @@
"scene"
:
null
"scene"
:
null
},
},
{
{
"id"
:
17
,
"id"
:
18
,
"name"
:
"确认订单"
,
"pathName"
:
"pages/confirmOrder/confirmOrder"
,
"query"
:
"trolleySku2Buy=[{
\"
count
\"
:1,
\"
skuId
\"
:621372628724224000}]"
,
"scene"
:
null
},
{
"id"
:
-1
,
"name"
:
"购物车"
,
"name"
:
"购物车"
,
"pathName"
:
"pages/cart/cart"
,
"pathName"
:
"pages/cart/cart"
,
"query"
:
""
,
"query"
:
""
,
...
...
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