Commit 874f144f authored by xiejb's avatar xiejb

商品清单页面金额合计

parent caa0dde8
...@@ -62,14 +62,15 @@ export default { ...@@ -62,14 +62,15 @@ export default {
goodsName: '', // 商品名称 goodsName: '', // 商品名称
goodsSpec: '', // 商品规格 goodsSpec: '', // 商品规格
manufacturer: '', // 生产企业 manufacturer: '', // 生产企业
} },
totalAmount: 0
}; };
}, },
props: { props: {
totalAmount: { // totalAmount: {
type: String, // type: String,
default: '0.00' // default: '0.00'
} // }
}, },
computed: { computed: {
// 总价格 // 总价格
...@@ -77,7 +78,8 @@ export default { ...@@ -77,7 +78,8 @@ export default {
// if (this.detailData.orderTotalAmount) { // if (this.detailData.orderTotalAmount) {
// return AmountNumFormat(this.detailData.orderTotalAmount) // return AmountNumFormat(this.detailData.orderTotalAmount)
// } else { // } else {
return this.orderItem.orderTotalAmount // return this.orderItem.orderTotalAmount
return AmountNumFormat(this.totalAmount)
// } // }
} }
}, },
...@@ -178,6 +180,7 @@ export default { ...@@ -178,6 +180,7 @@ export default {
} }
getMyOrderDetail(params).then(res => { getMyOrderDetail(params).then(res => {
this.detailData = [] this.detailData = []
this.totalAmount = 0
if (res.code === 200 && res.data && res.data.code === '00000' && if (res.code === 200 && res.data && res.data.code === '00000' &&
res.data.entity && res.data.entity.detailList && res.data.entity.detailList.length > 0) { res.data.entity && res.data.entity.detailList && res.data.entity.detailList.length > 0) {
this.detailData = res.data.entity.detailList this.detailData = res.data.entity.detailList
...@@ -186,7 +189,9 @@ export default { ...@@ -186,7 +189,9 @@ export default {
// array.push(this.detailData.goodsInfos[0]) // array.push(this.detailData.goodsInfos[0])
// array.push(this.detailData.goodsInfos[1]) // array.push(this.detailData.goodsInfos[1])
// } // }
// this.detailData.goodsInfos = array this.detailData.forEach(item => {
this.totalAmount = this.totalAmount + parseFloat(item.taxAmount)
})
} else { } else {
console.log('订单详情', '请求失败') console.log('订单详情', '请求失败')
} }
......
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