Authored by yyq

购物车问题修复

... ... @@ -153,14 +153,24 @@ function loadCartDetail(key) {
};
$.getJSON('http://www.yohobuy.com/common/shoppingCart/?callback=?', param, function(jsonData) {
var totalGoods, data;
var totalGoods = [],
infoArr = [
'main_goods',
'advance_goods',
'outlet_goods',
'gift_goods',
'need_pay_gifts'
],
data;
if (jsonData.code === 200) {
data = jsonData.data;
totalGoods = $.merge(data.main_goods, data.advance_goods);
totalGoods = $.merge(totalGoods, data.outlet_goods);
totalGoods = $.merge(totalGoods, data.gift_goods);
totalGoods = $.merge(totalGoods, data.need_pay_gifts);
$.each(infoArr, function(k, v) {
if (data[v]) {
totalGoods = $.merge(totalGoods, data[v]);
}
});
if (totalGoods && totalGoods.length) {
data.totalGoods = totalGoods;
$miniCart.html(cartFn({
... ...