Commit 92f11f6530c392152f0a99bf72f66aedfad22745
1 parent
d1417717
订单再来一单的优化
Showing
2 changed files
with
7 additions
and
7 deletions
pages/user/order_detail/order_detail.js
... | ... | @@ -1607,7 +1607,7 @@ Page({ |
1607 | 1607 | }).then(res=>{ |
1608 | 1608 | //-------如果购物车中有相关的数据------- |
1609 | 1609 | if (res.data.data.total > 0) { |
1610 | - b_cart_goods= res.data.data.pageData[0]; | |
1610 | + b_cart_goods= res.data.data.pageData; | |
1611 | 1611 | } |
1612 | 1612 | }) |
1613 | 1613 | |
... | ... | @@ -1617,14 +1617,14 @@ Page({ |
1617 | 1617 | if(b_cart_goods) { |
1618 | 1618 | for (let jr = 0; jr < b_cart_goods.length; jr++) { |
1619 | 1619 | var b_cart_item = b_cart_goods[jr]; |
1620 | - if (g_item.prom_type == 0) { | |
1620 | + if (!g_item.prom_type || g_item.prom_type == 0) { | |
1621 | 1621 | if ([0, 3, 5, 7, 10].indexOf(b_cart_item.prom_type) > -1) { |
1622 | - is_has = b_cart_item.id; | |
1622 | + is_has = b_cart_item; | |
1623 | 1623 | break |
1624 | 1624 | } |
1625 | 1625 | } else { |
1626 | 1626 | if (b_cart_goods.prom_type == g_item.prom_type && b_cart_goods.prom_id == g_item.prom_id) { |
1627 | - is_has = b_cart_item.id; | |
1627 | + is_has = b_cart_item; | |
1628 | 1628 | break |
1629 | 1629 | } |
1630 | 1630 | } |
... | ... | @@ -1635,8 +1635,8 @@ Page({ |
1635 | 1635 | //-- 如果就加入过购物车 -- |
1636 | 1636 | if(is_has){ |
1637 | 1637 | var updata = { |
1638 | - id: is_has, | |
1639 | - goods_num: newd.goods_num + b_cart_goods.goods_num, | |
1638 | + id: is_has.id, | |
1639 | + goods_num: newd.goods_num + is_has.goods_num, | |
1640 | 1640 | goods_price: newd.goods_price, |
1641 | 1641 | member_goods_price:newd.goods_price, |
1642 | 1642 | store_id: os.stoid, | ... | ... |
pages/user/order_list/order_list.js
... | ... | @@ -1977,7 +1977,7 @@ Page({ |
1977 | 1977 | var b_cart_item = b_cart_goods[jr]; |
1978 | 1978 | |
1979 | 1979 | |
1980 | - if (g_item.prom_type == 0) { | |
1980 | + if (!g_item.prom_type || g_item.prom_type == 0) { | |
1981 | 1981 | if ([0, 3, 5, 7, 10].indexOf(b_cart_item.prom_type) > -1) { |
1982 | 1982 | is_has = b_cart_item; |
1983 | 1983 | break | ... | ... |