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
c7c0e2f2
Commit
c7c0e2f2
authored
Sep 21, 2019
by
高淑倩
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
plus会员差价
parent
9c1a5558
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
1 deletions
+31
-1
confirmOrder.js
src/pages/confirmOrder/confirmOrder.js
+25
-0
confirmOrder.wxml
src/pages/confirmOrder/confirmOrder.wxml
+1
-1
util.js
src/utils/util.js
+5
-0
No files found.
src/pages/confirmOrder/confirmOrder.js
View file @
c7c0e2f2
// pages/confirmOrder/confirmOrder.js
// pages/confirmOrder/confirmOrder.js
const
wxService
=
require
(
'../../utils/wxService'
)
const
wxService
=
require
(
'../../utils/wxService'
)
const
app
=
getApp
()
const
app
=
getApp
()
const
utils
=
require
(
'../../utils/util'
)
wxService
.
page
({
wxService
.
page
({
/**
/**
...
@@ -15,6 +16,9 @@ wxService.page({
...
@@ -15,6 +16,9 @@ wxService.page({
trolleySku2Buy
:
Array
,
trolleySku2Buy
:
Array
,
currentOrderList
:
Array
,
currentOrderList
:
Array
,
isSelect
:
false
,
isSelect
:
false
,
selectPrice
:
''
,
noSelectPrice
:
''
,
plusSpread
:
''
,
goodsAddress
:
false
,
goodsAddress
:
false
,
citys
:
null
,
citys
:
null
,
cityView
:
''
,
cityView
:
''
,
...
@@ -308,6 +312,27 @@ wxService.page({
...
@@ -308,6 +312,27 @@ wxService.page({
const
{
result
,
data
}
=
res
.
data
const
{
result
,
data
}
=
res
.
data
if
(
result
==
0
)
{
if
(
result
==
0
)
{
wx
.
hideLoading
()
wx
.
hideLoading
()
let
skuList
=
data
.
tradePreviewSkus
let
sum
=
0
skuList
.
forEach
((
item
,
index
)
=>
{
// item.price
sum
+=
skuList
[
index
].
price
})
// 初始化商品价格
const
{
isSelect
}
=
this
.
data
if
(
isSelect
){
this
.
setData
({
selectPrice
:
sum
})
}
else
{
this
.
setData
({
noSelectPrice
:
sum
})
}
this
.
setData
({
this
.
setData
({
currentOrderList
:
data
,
currentOrderList
:
data
,
defalutCoupon
:
data
&&
data
.
couponDiscountPreviews
.
length
&&
data
.
couponDiscountPreviews
[
0
].
couponDiscount
||
''
,
defalutCoupon
:
data
&&
data
.
couponDiscountPreviews
.
length
&&
data
.
couponDiscountPreviews
[
0
].
couponDiscount
||
''
,
...
...
src/pages/confirmOrder/confirmOrder.wxml
View file @
c7c0e2f2
...
@@ -115,7 +115,7 @@
...
@@ -115,7 +115,7 @@
<view class="plus-price" wx:if="{{isSelect}}">
<view class="plus-price" wx:if="{{isSelect}}">
<view class="plus-info">
<view class="plus-info">
<text class="price-label">plus会员价</text>
<text class="price-label">plus会员价</text>
<text class="member-price">-¥
20
</text>
<text class="member-price">-¥
{{utils.numberFormat(noSelectPrice - selectPrice)}}
</text>
</view>
</view>
<text class="plus-member-price total-price">¥{{plusMemberPrice}}</text>
<text class="plus-member-price total-price">¥{{plusMemberPrice}}</text>
</view>
</view>
...
...
src/utils/util.js
View file @
c7c0e2f2
...
@@ -294,6 +294,10 @@ const formatNumber = n => {
...
@@ -294,6 +294,10 @@ const formatNumber = n => {
return
n
[
1
]
?
n
:
'0'
+
n
return
n
[
1
]
?
n
:
'0'
+
n
}
}
function
getSum
(
preValue
,
curValue
,
index
,
array
)
{
return
preValue
+
curValue
;
}
function
_getUserInfo
(
ev
)
{
function
_getUserInfo
(
ev
)
{
const
userInfo
=
ev
.
detail
||
ev
const
userInfo
=
ev
.
detail
||
ev
return
getUserInfoByBtn
(
userInfo
).
then
((
data
=
{})
=>
{
return
getUserInfoByBtn
(
userInfo
).
then
((
data
=
{})
=>
{
...
@@ -351,6 +355,7 @@ wxService.setGetAuthUserInfo(_getUserInfo);
...
@@ -351,6 +355,7 @@ wxService.setGetAuthUserInfo(_getUserInfo);
module
.
exports
=
{
module
.
exports
=
{
_getUserInfo
,
_getUserInfo
,
formatTime
,
formatTime
,
getSum
,
getCurrentPageUrl
,
getCurrentPageUrl
,
getCurrentRouter
,
getCurrentRouter
,
getCurrentPageUrlWithArgs
,
getCurrentPageUrlWithArgs
,
...
...
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