Commit ca5be604 by 修福龙

修复核对订单页面数量为0的问题

parent 8dca0a9d
...@@ -121,8 +121,10 @@ class OrderDetailsModal extends Component { ...@@ -121,8 +121,10 @@ class OrderDetailsModal extends Component {
let gaTemp = goodsArr.slice((current - 1) * pageSize, current * pageSize); let gaTemp = goodsArr.slice((current - 1) * pageSize, current * pageSize);
let totalPrice = 0; // 总价 let totalPrice = 0; // 总价
let totalCount = 0; // 总优惠 let totalCount = 0; // 总优惠
let number = 0; // 总数量
goodsArr.map(item => { goodsArr.map(item => {
// item.url = config.imgUrl + item.barcode + config.watermark; // item.url = config.imgUrl + item.barcode + config.watermark;
number += item.num;
if (item.price) { if (item.price) {
totalPrice += item.price * item.num; totalPrice += item.price * item.num;
totalCount += (item.prePrice - item.price) * item.num; totalCount += (item.prePrice - item.price) * item.num;
...@@ -235,7 +237,7 @@ class OrderDetailsModal extends Component { ...@@ -235,7 +237,7 @@ class OrderDetailsModal extends Component {
<View style={styles.total}> <View style={styles.total}>
<Text style={styles.totalText}>数量</Text> <Text style={styles.totalText}>数量</Text>
<Text style={styles.totalText}> <Text style={styles.totalText}>
{NP.round(totalCount, 0).toFixed(0)} {NP.round(number, 0).toFixed(0)}
</Text> </Text>
</View> </View>
<View style={styles.total}> <View style={styles.total}>
......
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