Authored by 梁志锋

购物车功能开发

... ... @@ -12,7 +12,6 @@ var $ = require('jquery'),
var dialog = require('../me/dialog'),
tip = require('../plugin/tip');
var $names;
//var $curDelPanel;
... ... @@ -55,25 +54,26 @@ $('.cart-goods').on('touchstart', '.checkbox', function() {
} else {
$this.removeClass('icon-checkbox').addClass('icon-cb-checked');
}
}
$.ajax({
type: 'GET',
url: '/cart/index/getCartData',
data: {
id: id
},
success: function(data) {
if (data) {
$('#good-totalprice').html('¥' + data.commonCart.price);
$('#good-activityPrice').html('¥' + data.commonCart.activityPrice);
$('#good-total').html(data.commonCart.count + '件总计:¥' + data.commonCart.sumPrice);
$.ajax({
type: 'GET',
url: '/cart/index/getCartData',
data: {
skuList: JSON.stringfy(id)
},
success: function(data) {
if (data) {
$('#good-totalprice').html('¥' + data.commonCart.price);
$('#good-activityPrice').html('¥' + data.commonCart.activityPrice);
$('#good-total').html('总计:¥' + data.commonCart.sumPrice +' (' + data.commonCart.count + '件)');
}
},
error: function() {
tip.show('网络错误');
}
},
error: function() {
tip.show('网络错误');
}
});
});
} else if(data.code === 200) {
tip.show('网络错误');
}
}).fail(function() {
tip.show('网络错误');
});
... ...
... ... @@ -157,6 +157,7 @@
display: block;
height: 40rem / $pxConvertRem;
line-height: 40rem / $pxConvertRem;
color: #d0253b;
}
.tip {
... ...
... ... @@ -52,7 +52,7 @@
<span class="iconfont icon-cb-checked"></span>
<p>
<span id="good-total">
{{count}}件总计:¥{{sumPrice}}
总计:¥{{sumPrice}} ({{count}}件)
</span>
<span class="tip">(不含运费)</span>
</p>
... ...