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

var $ = require('jquery'),
    lazyLoad = require('yoho.lazyload');

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

lazyLoad($('.lazy'));

$('.gift-advance-page').on('touchstart', '.chose', 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);
            }
        }
    });
});