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
289f6a32
Commit
289f6a32
authored
Apr 11, 2020
by
谢中龙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
订单包裹中增加商品数量和商品总价显示
parent
b01c5767
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
76 additions
and
0 deletions
+76
-0
order.js
src/pages/order/order.js
+14
-0
order.wxml
src/pages/order/order.wxml
+4
-0
order.wxss
src/pages/order/order.wxss
+19
-0
orderDetail.js
src/pages/orderDetail/orderDetail.js
+17
-0
orderDetail.wxml
src/pages/orderDetail/orderDetail.wxml
+4
-0
orderDetail.wxss
src/pages/orderDetail/orderDetail.wxss
+18
-0
No files found.
src/pages/order/order.js
View file @
289f6a32
...
...
@@ -549,7 +549,21 @@ wxService.page({
else
{
this
.
data
.
orderList
=
[...
this
.
data
.
orderList
,...
orderList
];
}
//计算每个包裹中的数量和总价
this
.
data
.
orderList
.
forEach
(
item
=>
{
let
parcelList
=
item
.
parcelList
;
parcelList
.
forEach
(
p
=>
{
let
totalCount
=
0
,
totalPrice
=
0
;
p
.
sendOutList
.
forEach
(
s
=>
{
totalCount
=
totalCount
+
s
.
count
;
totalPrice
=
totalPrice
+
s
.
amount
;
});
p
.
totalCount
=
totalCount
;
p
.
totalPrice
=
parseFloat
(
totalPrice
).
toFixed
(
2
);
})
});
this
.
setData
({
orderList
:
this
.
data
.
pageNo
==
1
?
[...
data
]
:
[...
this
.
data
.
orderList
,
...
data
],
noMoreFlag
:
data
.
length
<
pageSize
?
true
:
false
,
...
...
src/pages/order/order.wxml
View file @
289f6a32
...
...
@@ -61,6 +61,10 @@
</view>
</view>
</view>
<!-- 包裹数量价格数据 -->
<view class="pacakge-price">
共计<label>{{packageInfo.totalCount}}</label>件商品 合计 <text class="theme-text-color">{{packageInfo.totalPrice}}</text>元
</view>
<!-- 按钮 -->
<view class="package-btns">
<view class="btns normal-btn"
...
...
src/pages/order/order.wxss
View file @
289f6a32
...
...
@@ -344,6 +344,25 @@ scroll-view{
justify-content: flex-end;
}
.pacakge-price{
display: flex;
justify-content: flex-end;
align-items: center;
padding: 10rpx 0;
font-size: 28rpx;
color: #999999;
}
.pacakge-price label{
font-weight: bold;
color: #333333;
}
.pacakge-price text{
font-weight: bold;
/* color: #333333; */
}
.package-btns .btns{
width: auto;
height: 50rpx;
...
...
src/pages/orderDetail/orderDetail.js
View file @
289f6a32
...
...
@@ -116,6 +116,7 @@ wxService.page({
sendOutList
:
data
.
skuVOList
,
}];
this
.
calcuPackageProductCountAndTotalPrice
(
data
);
this
.
data
.
totalGoodsPrice
=
parseFloat
(
sum
).
toFixed
(
2
);
this
.
setData
({
detail
:
data
,
...
...
@@ -175,6 +176,8 @@ wxService.page({
item
.
sendOutList
=
sendOutList
;
});
}
this
.
calcuPackageProductCountAndTotalPrice
(
data
);
this
.
data
.
totalGoodsPrice
=
parseFloat
(
sum
).
toFixed
(
2
);
this
.
setData
({
...
...
@@ -188,6 +191,20 @@ wxService.page({
}
})
},
//计算包裹商品数量和价格
calcuPackageProductCountAndTotalPrice
(
data
){
let
parcelList
=
data
.
parcelList
;
parcelList
.
forEach
(
p
=>
{
let
totalCount
=
0
,
totalPrice
=
0
;
p
.
sendOutList
.
forEach
(
s
=>
{
totalCount
=
totalCount
+
s
.
count
;
totalPrice
=
totalPrice
+
s
.
amount
;
});
p
.
totalCount
=
totalCount
;
p
.
totalPrice
=
parseFloat
(
totalPrice
).
toFixed
(
2
);
});
},
initCountDown
(
countDownOrderTime
,
startTime
,
localTime
)
{
// 毫秒差 本地时间 - 创建时间
...
...
src/pages/orderDetail/orderDetail.wxml
View file @
289f6a32
...
...
@@ -90,6 +90,10 @@
</view>
</view>
</view>
<!-- 数量和价格 -->
<view class="pacakge-price">
共计<label>{{item.totalCount}}</label>件商品 合计 <text class="theme-text-color">{{item.totalPrice}}</text>元
</view>
<!-- 按钮 -->
<view class="package-btns">
<view class="btns normal-btn" wx:if="{{item.status == 'N'}}"
...
...
src/pages/orderDetail/orderDetail.wxss
View file @
289f6a32
...
...
@@ -39,6 +39,24 @@ page{
border-radius: 8rpx;
}
.pacakge-price{
display: flex;
justify-content: flex-end;
align-items: center;
padding: 10rpx 0;
font-size: 28rpx;
color: #999999;
}
.pacakge-price label{
font-weight: bold;
color: #333333;
}
.pacakge-price text{
font-weight: bold;
/* color: #333333; */
}
.pro-header{
display: flex;
...
...
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