gift-advance.js 623 Bytes
/**
 * 赠品/加价购
 * @author: xuqi<qi.xu@yoho.cn>
 * @date: 2015/10/23
 */

var $ = require('yoho.zepto'),
    lazyLoad = require('yoho.zeptolazyload');

var chosePanel = require('./chose-panel');

lazyLoad($('.lazy'));

$('.gift-advance-page').delegate('.chose', 'tap', function() {
    var id = $(this).closest('.gift-advance-good').data('id');

    $.ajax({
        type: 'GET',
        url: '/shoppingCart/goodinfo',
        data: {
            id: id
        },
        success: function(data) {
            if (data.code === 200) {
                chosePanel.show(data.data);
            }
        }
    });
});