From 658bf7a16bcae32932e99959becce9333e7e4cfe Mon Sep 17 00:00:00 2001 From: "liujw155@outlook.com" Date: Mon, 1 Nov 2021 11:43:01 +0800 Subject: [PATCH] fix mall num --- src/components/order_list/mall/mall.vue | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/components/order_list/mall/mall.vue b/src/components/order_list/mall/mall.vue index 63ac4c5..8893577 100644 --- a/src/components/order_list/mall/mall.vue +++ b/src/components/order_list/mall/mall.vue @@ -19,7 +19,7 @@ - 共{{ orderInfo.goods_nums || 0 }}件 + 共{{ totalGoodsNum || 0 }}件 商品金额合计:¥{{ orderInfo.pay_amount || 0 }} @@ -37,7 +37,16 @@ export default { isShowSendMethods(){ let { orderInfo } = this; return orderInfo.status == 2 || orderInfo.status == 3 || orderInfo.status == 5 || orderInfo.status == 6 - }, + }, + totalGoodsNum(){ + let { orderInfo } = this; + if(!orderInfo)return 0; + let _ls = orderInfo.goods || []; + return _ls.reduce((total, item)=>{ + total += +item.product_nums || 0; + return total + }, 0) + } }, props: {