Authored by 郭成尧

bundle-info-to-ensure-cart

... ... @@ -24,5 +24,6 @@
</div>
<button id="bundle-buy-now" class="bundle-buy-btn">立即购买</button>
</div>
<input type="hidden" id="activityId" value="{{bundleId}}">
{{/ bundleInfo}}
</div>
\ No newline at end of file
... ...
... ... @@ -32,13 +32,27 @@ $selectBtn.on('click', function() {
* 立即购买
*/
$buyNowBtn.on('click', function() {
var bundleGoods = [],
bundleId = $('#activityId').val();
$('span[id^="gskn"]').each(function() {
if (!$(this).data('sku')) {
tip.show('请为套餐商品选择属性');
return;
}
// TODO tar 已经获取到 sku
console.log($(this).data('skn'), '-', $(this).data('sku'));
bundleGoods.push({
type: 'bundle',
sku: $(this).data('sku'),
buy_number: 1
});
});
window.setCookie('bundle-info', JSON.stringify({
bundleGoods: bundleGoods,
bundleId: bundleId
}));
window.location.href = '/cart/index/orderEnsure?cartType=ordinary&bundleId=' +
bundleId;
});
... ...