Commit 6eb463d5 authored by jiangjiantao's avatar jiangjiantao

bugfix

parent 44e222e7
...@@ -177,17 +177,15 @@ Page({ ...@@ -177,17 +177,15 @@ Page({
//计算总价格 总数量 总优惠 //计算总价格 总数量 总优惠
calculation(goods) { calculation(goods) {
if (null != goods && goods.length > 0) {
let quantitytemp = 0; let quantitytemp = 0;
let pricetemp = 0; let pricetemp = 0;
goods.forEach(function (item, index, array) { goods.forEach(function (item, index, array) {
quantitytemp = quantitytemp + item.quantity quantitytemp = quantitytemp + item.quantity
pricetemp = pricetemp + item.price pricetemp = pricetemp + item.price
}) })
this.setData({totalQuantity:quantitytemp,totalPrice:pricetem+''}) this.setData({totalQuantity:quantitytemp,totalPrice:pricetemp+''})
//数据同步到前屏 //数据同步到前屏
this.sendGoodInfoToFront() this.sendGoodInfoToFront()
}
}, },
//跳转到支付结果页面 //跳转到支付结果页面
......
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