Commit 289f6a32 by 谢中龙

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

parent b01c5767
......@@ -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,
......
......@@ -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"
......
......@@ -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;
......
......@@ -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) {
// 毫秒差 本地时间 - 创建时间
......
......@@ -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'}}"
......
......@@ -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;
......
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