Commit 289f6a32 by 谢中龙

订单包裹中增加商品数量和商品总价显示

parent b01c5767
...@@ -550,6 +550,20 @@ wxService.page({ ...@@ -550,6 +550,20 @@ wxService.page({
this.data.orderList = [...this.data.orderList,...orderList]; 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({ this.setData({
orderList: this.data.pageNo == 1 ? [...data] : [...this.data.orderList, ...data], orderList: this.data.pageNo == 1 ? [...data] : [...this.data.orderList, ...data],
noMoreFlag: data.length < pageSize ? true : false, noMoreFlag: data.length < pageSize ? true : false,
......
...@@ -61,6 +61,10 @@ ...@@ -61,6 +61,10 @@
</view> </view>
</view> </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="package-btns">
<view class="btns normal-btn" <view class="btns normal-btn"
......
...@@ -344,6 +344,25 @@ scroll-view{ ...@@ -344,6 +344,25 @@ scroll-view{
justify-content: flex-end; 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{ .package-btns .btns{
width: auto; width: auto;
height: 50rpx; height: 50rpx;
......
...@@ -116,6 +116,7 @@ wxService.page({ ...@@ -116,6 +116,7 @@ wxService.page({
sendOutList : data.skuVOList, sendOutList : data.skuVOList,
}]; }];
this.calcuPackageProductCountAndTotalPrice(data);
this.data.totalGoodsPrice = parseFloat(sum).toFixed(2); this.data.totalGoodsPrice = parseFloat(sum).toFixed(2);
this.setData({ this.setData({
detail: data, detail: data,
...@@ -176,6 +177,8 @@ wxService.page({ ...@@ -176,6 +177,8 @@ wxService.page({
}); });
} }
this.calcuPackageProductCountAndTotalPrice(data);
this.data.totalGoodsPrice = parseFloat(sum).toFixed(2); this.data.totalGoodsPrice = parseFloat(sum).toFixed(2);
this.setData({ this.setData({
detail: data, detail: data,
...@@ -189,6 +192,20 @@ wxService.page({ ...@@ -189,6 +192,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) { initCountDown(countDownOrderTime,startTime,localTime) {
// 毫秒差 本地时间 - 创建时间 // 毫秒差 本地时间 - 创建时间
let countTimeSpan = localTime - startTime let countTimeSpan = localTime - startTime
......
...@@ -90,6 +90,10 @@ ...@@ -90,6 +90,10 @@
</view> </view>
</view> </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="package-btns">
<view class="btns normal-btn" wx:if="{{item.status == 'N'}}" <view class="btns normal-btn" wx:if="{{item.status == 'N'}}"
......
...@@ -39,6 +39,24 @@ page{ ...@@ -39,6 +39,24 @@ page{
border-radius: 8rpx; 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{ .pro-header{
display: flex; display: flex;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment