Commit 92f11f6530c392152f0a99bf72f66aedfad22745

Authored by yvan.ni
1 parent d1417717

订单再来一单的优化

pages/user/order_detail/order_detail.js
@@ -1607,7 +1607,7 @@ Page({ @@ -1607,7 +1607,7 @@ Page({
1607 }).then(res=>{ 1607 }).then(res=>{
1608 //-------如果购物车中有相关的数据------- 1608 //-------如果购物车中有相关的数据-------
1609 if (res.data.data.total > 0) { 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,14 +1617,14 @@ Page({
1617 if(b_cart_goods) { 1617 if(b_cart_goods) {
1618 for (let jr = 0; jr < b_cart_goods.length; jr++) { 1618 for (let jr = 0; jr < b_cart_goods.length; jr++) {
1619 var b_cart_item = b_cart_goods[jr]; 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 if ([0, 3, 5, 7, 10].indexOf(b_cart_item.prom_type) > -1) { 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 break 1623 break
1624 } 1624 }
1625 } else { 1625 } else {
1626 if (b_cart_goods.prom_type == g_item.prom_type && b_cart_goods.prom_id == g_item.prom_id) { 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 break 1628 break
1629 } 1629 }
1630 } 1630 }
@@ -1635,8 +1635,8 @@ Page({ @@ -1635,8 +1635,8 @@ Page({
1635 //-- 如果就加入过购物车 -- 1635 //-- 如果就加入过购物车 --
1636 if(is_has){ 1636 if(is_has){
1637 var updata = { 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 goods_price: newd.goods_price, 1640 goods_price: newd.goods_price,
1641 member_goods_price:newd.goods_price, 1641 member_goods_price:newd.goods_price,
1642 store_id: os.stoid, 1642 store_id: os.stoid,
pages/user/order_list/order_list.js
@@ -1977,7 +1977,7 @@ Page({ @@ -1977,7 +1977,7 @@ Page({
1977 var b_cart_item = b_cart_goods[jr]; 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 if ([0, 3, 5, 7, 10].indexOf(b_cart_item.prom_type) > -1) { 1981 if ([0, 3, 5, 7, 10].indexOf(b_cart_item.prom_type) > -1) {
1982 is_has = b_cart_item; 1982 is_has = b_cart_item;
1983 break 1983 break