bundle.page.js 822 Bytes
/**
 * Created by targaryen on 2016/11/28.
 */
var $ = require('yoho-jquery');

require('../common');

var chosePanelRender = require('../common/chose-panel'),
    chosePanel = require('./bundle/chose-pannel');

var $selectBtn = $('.select-btn'),
    $buyNowBtn = $('#bundle-buy-now');

/**
 * 选择商品颜色等
 */
$selectBtn.on('click', function() {
    var self = $(this);

    $.post('/product/detail/info', {
        id: self.data('id'),
        productSkn: self.data('skn')
    }, function(data) {
        chosePanelRender(data);
        chosePanel.init(self.data('skn'));
        chosePanel.show();
    });
});

/**
 * 立即购买
 */
$buyNowBtn.on('click', function() {
    $('span[id^="gskn"]').each(function() {

        // TODO tar 已经获取到 sku
        console.log($(this).data('sku'));
    });
});