// JavaScript Document
function del_collect(rec_id) {
    $.ajax({
        type: 'POST',
        url: '/cart.ajax.php',
        data: 'act=delete_collect&rec_id=' + rec_id,
        dataType: 'text',
        success: function(result) {
            jQuery.confirm.close();
            load_collect();
        }
    });
}

//移动到收藏夹
function MoveTocollect(_params) {
    $.ajax({
        url: "/Handler/AjaxHandler.ashx",
        cache: false,
        data: _params,
        dataType: 'text',
        success: function(result) {
            switch (parseInt(result)) {
                case -1:
                    alert("系统繁忙，请稍后再试");
                    break;
                case 1101:
                    alert("当前还未登录，请先登录");
                    location.href = '/login.html';
                    break;
                case 1104:
                    alert("添加失败");
                    break;
                case 1105:
                    alert("您已经收藏过该商品");
                    break;
                case 1106:
                    alert("参数异常");
                    break;
                case 1120:
                    alert("成功收藏");
                    break;
            }
            jQuery.confirm.close();
        }
    });
}
function ProListAddCollect(goods_id) {
    $.ajax({
        type: 'POST',
        url: '/ajax/ajax_collect.html',
        data: 'goods_id=' + goods_id,
        cache: false,
        contentType:"application/x-www-form-urlencoded; charset=utf-8",
        timeout:10000,
        dataType: 'text',
        success: function(result) {
            if (result == "1") {
                alert("加入到用户收藏夹成功！");
                jQuery.confirm.close();
                delete_goods(rec_id); //删除购物车中指定商品
                //load_collect();
            } else if (result == "-1") {
                alert("参数不正确！");
            } else if (result == "3") {
                alert("收藏夹已存在该商品！");
            } else {
                alert("加入到用户收藏夹失败！");
            }
        }
    });
}
function load_collect() {
    $.ajax({
        type: 'GET',
        url: '/ajax.php?act=load_collect',
        dataType: 'jsonp',
        jsonp: 'callback',
        success: function(json) {
            $('#collect').html(json.html);
        }
    });
}
//用户登录完修改用户购物车商品UserID，伪静态地址
function updateCartUserId(Defer) {
    $.ajax({
        type: 'POST',
        url: '/ajax/ajax_cart.html',
        data: 'act=updateuserId',
        cache: false,
        timeout:10000,
        dataType: 'text',
        success: function(result) {
            if(typeof Defer != "undefined")   Defer.resolve();/*Jquery 的 Deferred对象*/
        }
    });
}
function fresh_collect(v) {
    s('collect').innerHTML = v;
}

var Ajax = {
    call: function(url, param, fun, type) {
        $.ajax({
            url: url + '?' + param,
            success: fun,
            dataType: type ? type : 'html'
        });
    }
};

function goBuy(t) {
    setPos(t);
    if (com_del(document.forms['cart_form'])) {
        if (ckeckLack(document.forms['cart_form'])) {
            ge('jieshuan').onclick = getRef("");
            jQuery.tips.show(document.getElementById('jieshuan'), 180, $('#submsg').val());
            Sleep(this, 1000);
            this.NextStep = function() {
                location.href = '';
            }
        }
        else {
            jQuery.tips.show(t, 250, '很抱歉，您的购物袋中含有缺货商品，<br />请移除后继续结算。');
            setTimeout('jQuery.tips.close()', 2000);
        }
    }
    else {
        jQuery.tips.show(t, 170, '您还没有选择要购买的商品');
        setTimeout('jQuery.tips.close()', 2000);
    }
}

function showtips(t, w, s) {
    jQuery.tips.close()
    jQuery.tips.show(t, w, s);
    setTimeout('jQuery.tips.close()', 5000);
}
/*增加商品的数量*/
function addCart(_json) {
    _json.number = _json.number + 1;
    if (_json.number > 10) {
        jQuery.tips.show(document.getElementById('inputext' + _json.Id), 150, '抱歉，单件商品最多限购10件');
        setTimeout('jQuery.tips.close()', 1000);
        return;
    }
    $.ajax({
        type: 'POST',
        url: '/ajax/ajax_cart.html',
        data: _json,
        cache: false,
        timeout:10000,
        dataType: 'text',
        success: function(result) {
            jQuery.tips.show(document.getElementById('inputext' + _json.Id), 150, result);
            load_cart();
            setTimeout('jQuery.tips.close()', 1000);
        }
    });
}
/*减少商品的数量*/
function subCart(_json) {
    _json.number = _json.number - 1;
    if (_json.number <= 0) {
        jQuery.tips.show(document.getElementById('inputext' + _json.Id), 150, '数量不能是0');
        setTimeout('jQuery.tips.close()', 1000);
        return;
    }
    $.ajax({
        type: 'POST',
        url: '/ajax/ajax_cart.html',
        data: _json,
        cache: false,
        timeout:10000,
        dataType: 'text',
        success: function(result) {
            jQuery.tips.show(document.getElementById('inputext' + _json.Id), 150, result);
            load_cart();
            setTimeout('jQuery.tips.close()', 1000);
        }
    });
}
/*改变商品的数量*/
function chgCart(_json, obj) {
    if(_json.number == parseInt(obj.value)){return;}
    _json.number = parseInt(obj.value);
    $.ajax({
        type: 'POST',
        url: '/ajax/ajax_cart.html',
        data: _json,
        cache: false,
        timeout:10000,
        dataType: 'text',
        success: function(result) {
            jQuery.tips.show(document.getElementById('inputext' + _json.Id), 150, result);
            load_cart();
            setTimeout('jQuery.tips.close()', 1000);
        }
    });
}

function load_cart() {
    Ajax.call('/ajax/ajax_cart.html', 'act=load_cart&t=' + Math.random(), cart, 'text');
    load_Top_MenuCart();//重新加载页面顶部购物车数量
}

function cart(v) {
    $('#cart').html(v);
}

/*增加商品*/
function add_goods(rec_id,pro_id,obj,b) {
    var tourl="/Handler/AjaxHandler.ashx?action=add_goods&rec_id="+rec_id+"&pro_id="+pro_id;  
    if(arguments.length==5){
      tourl="/Handler/AjaxHandler.ashx?action=add_goods&type=point&rec_id="+rec_id+"&pro_id="+pro_id;//添加积分商品
    } 
    $.ajax({  
          type: "Get",
          url:tourl,
          cache: false,
          contentType:"application/x-www-form-urlencoded; charset=utf-8",
          timeout:10000,
          dataType:"text",
           error: function (XmlHttpRequest, textStatus, errorThrown) {                    
               alert(XMLHttpRequest.responseText+"---前面为错误内容！！！");       
        }, 
        success: function(result) {                   
            if (b == 1) {
                jQuery.tips.show(obj, 150, result);
                load_cart();
                setTimeout('jQuery.tips.close()', 1000);
            } else {
                if (result.indexOf("成功") != -1) {
                    location.href = "/cart.html";
                } else {
                    alert(result);
                }
            }            
        }
    });
}
function kcIsOk(){
    var num = $("#qty").val();var k = $('#qty').attr('k');
    if(!/^\d+$/.test(num) || num == "0") {$("#qty").val(1);return false;}
    if(k==null) {alert('请选择尺码');$("#qty").val(1);return false;}
    num = parseInt(num);k = parseInt(k);
    if(k >= 10){
        if(num > k || num > 10) {alert('抱歉，单件商品最多限购10件');$("#qty").val(10);return false;}
    }
    else
    {
        if(num > k) {alert('购买的数量超出库存量');$("#qty").val(k);return false;}
    }
    return true;
}




function show_num_goods() {
    var jData = {
        act: 'show_goods_num'
    }
    $.ajax({
        type: 'GET',
		url: '../cn_asp/ajax_cart.asp',
        data: jData,
        cache: false,
        timeout:10000,
        dataType: 'json',
        success: function(json) {
            if (json.result=="success") {
				/*alert(json.data.shoppingCartQuantity);*/
			   $("#carTotalNum").html(json.data.shoppingCartQuantity);
            } else {
                alert(json.data);
            }
        }
    });

}


/*添加指定数量的商品*/
function add_num_goods(rec_id, pro_id,type,IsBund) {//IsBund表示是否是捆绑的商品
    var _tempColor = $('dl.b .attr-value').eq(0).find('.current');
    var _tempSize = $('dl.b .attr-value').eq(1).find('.current');
	if(_tempColor.length == 0)
    {alert("请选择颜色");return;}
    if(_tempSize.length != 1)
    {alert('请选择尺码！');return;}
    if(!kcIsOk()) return;
    var num = $("#qty").val();
    var pro_color = _tempColor.text();
    var pro_size = _tempSize.text();
    var p_color_id = _tempColor.attr("attr");
    var p_size_id = _tempSize.attr("attr");
	
    var jData = {
        act: 'add_goods',
        rec_id: rec_id,
        proid: pro_id,
        size: escape(pro_size),
        color: escape(pro_color),
        IsBund: IsBund,
        num: num,
        p_color_id: p_color_id,
        p_size_id: p_size_id
    }
    $.ajax({
		/*type: 'POST',*/
        type: 'GET',
        /*url: '/ajax/ajax_cart.html',*/
		url: '../cn_asp/ajax_cart.asp',
        data: jData,
        cache: false,
        timeout:10000,
		/*dataType: 'text',*/
        dataType: 'json',
        success: function(json) {
            if (json.result=="success") {
				/*alert(json.data);*/
				showShoppingCartTips(json.data);
               /* location.href = "cart.asp";*/
            } else {
                alert(json.data);
            }
        }
    });

}

var closeShoppingCartTips = function() {
	$("#buy_info").css("display", "none");
};

var showShoppingCartTips = function(data) {
	$("#carTotalNum").html(data.shoppingCartQuantity);
	$("#totalCount").html(data.shoppingCartQuantity);
	$("#totalNum").html("￥" + data.shoppingCartPrice);
	$("#buy_info").css("display", "block");
};

/* 删除商品 */
function delete_goods(rec_id) {
    $.ajax({
        type: 'POST',
        url: '/ajax/ajax_cart.html',
        data: 'act=delete_goods&rec_id=' + rec_id,
        cache: false,
        timeout:10000,
        success: function(result) {
            jQuery.confirm.close();
            load_cart();
        }
    });
}
/*清空购物车*/
function clear_cart() {
    $.ajax({
        type: 'POST',
        url: '/ajax/ajax_cart.html',
        data: 'act=clear_cart',
        dataType: 'text',
        success: function(result) {
            jQuery.confirm.close();
            load_cart();
        }
    });
}
function f_url(params) {
    var act = getParam("act", params);
    if (act == "delete_goods") {
        Ajax.call('/cart.ajax.php', params, load_cart, 'text');
    }
    else if (act == "delete_collect") {
        Ajax.call('/cart.ajax.php', params, load_collect, 'text');
    }
}

function checkall(form) {
    for (var i = 0; i < form.elements.length; i++) {
        var e = form.elements[i];
        if (e.name.search('checkboxes') != -1) {
            e.checked = !e.checked;
        }
    }
}
function checksel(form) {
    for (var i = 0; i < form.elements.length; i++) {
        var e = form.elements[i];
        if (e.name.search('checkboxes') != -1)
            if (e.checked) return true;
    }
    return false;
}
function com_del(form) {
    if (checksel(form)) {
        return true;
    }
    else {
        return false;
    }
}
function ckeckLack(form) {
    for (var i = 0; i < form.elements.length; i++) {
        var e = form.elements[i];
        if (e.name.search('checkboxes') != -1) {
            if (e.checked) {
                var t = null;
                if (t = e.name.match(/\[(\d+)\]/)) {
                    if (isLack(t[1])) {
                        return false;
                    }
                }
            }
        }
    }
    return true;
}
function isLack(key) {
    return eval('lack[' + key + '];');
}

function reSelectLargess(activity_id) {
    $.ajax({
        type: 'POST',
        url: '/cart.ajax.php',
        data: 'act=reselect_largess&activity_id=' + activity_id,
        dataType: 'text',
        success: function(result) {
            load_cart();
        }
    });
}

function chgLargessCheck(obj, id, largess_num, activity_id, confirmflag) {
    var flag = 0;
    var ids = '';
    $("input[name='checkLargessRadio[" + id + "]']:checkbox").each(function() {
        if ($(this).attr("checked")) {
            flag += 1;
            if (flag > largess_num) {
                $(this).attr("checked", false);
                jQuery.tips.show(this, 160, '不能超过' + largess_num + '个');
                setTimeout('jQuery.tips.close()', 2000);
                return false;
            }
            ids += ',' + $(this).val();
        }
    });
    if (flag > largess_num) {
        return false;
    }
    jQuery.confirm.close();
    //if(flag==largess_num){
    if (ids) ids = ids.substr(1);
    if (ids == '' && !confirmflag) {
        jQuery.confirm.show(obj, 160, 'javascript:chgLargessCheck(this,' + id + ',' + largess_num + ',' + activity_id + ',1); void(0);', '您确定不需要赠品吗？');
        return false;
    }

    if (ids == '') {
        reSelectLargess(activity_id);
        return false;
    }
    $.ajax({
        type: 'POST',
        url: '/cart.ajax.php',
        data: 'act=modi_largess_checked&largess_u9Codes=' + ids + '&largess_num=' + largess_num + '&activity_id=' + activity_id + '&rec_id=' + id,
        dataType: 'text',
        success: function(result) {
            load_cart();
        }
    });
    //}

}

function chgCheck(id, checked) {
    var val = checked ? 1 : 0;
    $.ajax({
        type: 'POST',
        url: '/cart.ajax.php',
        data: 'act=modi_cart_checked&val=' + val + '&rec_id=' + id,
        dataType: 'text',
        success: function(result) {
            load_cart();
        }
    });
}

function checkValues() {
    var ids = '';
    $("input:checked").each(function() {
        ids += ',' + $(this).val();
    });
    if (ids) return ids.substr(1);
}

function show_collect() {
    if ($('#collect').css('display') == 'none') {
        $('#img_look_collect').attr('src', 'http://images.xiu.com/ued/zs2.0/flow/yourFav2.gif');
        $('#collect').show();
    } else {
        $('#img_look_collect').attr('src', 'http://images.xiu.com/ued/zs2.0/flow/yourFav.gif');
        $('#collect').hide();
    }
}

function in_array(needle, haystack) {
    //得到needle的类型
    var type = typeof needle;
    if (type == 'string' || type == 'number') {
        for (var i in haystack) {
            if (haystack[i] == needle) {
                return true;
            }
        }
    }
    return false;
}


//选择颜色
function colorClick(e) {
    //
    if (e.parentNode.className == 'sizelist checked') return;

    //赋值
    $('#sel_color').val(e.innerHTML + ',' + e.parentNode.id.substr(1));

    //改变样式
    $('#color a').each(function() {
        $(this).attr('class', 'sizelist');
    });
    e.parentNode.className = 'sizelist checked';

    //ajax重新加载尺寸
    $.ajax({
        type: 'POST',
        url: '/cart.ajax.php',
        data: 'act=load_store&goods_id=' + $('#goods_id').val() + '&color_id=' + e.parentNode.id.substr(1),
        dataType: 'jsonp',
        success: function(data) {
            var sizes = data['sizes'] || [];
            var s_len = sizes.length;
            var s_html = '';
            var is_sel = false;
            for (var i = 0; i < s_len; i++) {
                //如果只有一种尺寸则自动选择
                if (s_len == 1) {
                    s_html += '<a id="s' + sizes[i]['size_id'] + '" href="javascript:;" class="sizelist checked"><span onclick="sizeClick(this);">' + sizes[i]['size_name'] + '</span></a>';
                    $('#sel_size').val(sizes[i]['size_name'] + ',' + sizes[i]['size_id']);
                    is_sel = true;
                    //如果之前已经选有尺寸且那个尺寸是该尺寸已有则自动选中
                } else if ($('#sel_size').val() == (sizes[i]['size_name'] + ',' + sizes[i]['size_id'])) {
                    s_html += '<a id="s' + sizes[i]['size_id'] + '" href="javascript:;" class="sizelist checked"><span onclick="sizeClick(this);">' + sizes[i]['size_name'] + '</span></a>';
                    is_sel = true;
                } else {
                    s_html += '<a id="s' + sizes[i]['size_id'] + '" href="javascript:;" class="sizelist"><span onclick="sizeClick(this);">' + sizes[i]['size_name'] + '</span></a>';
                }
            }
            $('#size').html(s_html);
            if (!is_sel) $('#sel_size').val(''); //如果没有默认选择的尺寸，则清空。
        }
    });
}

function sizeClick(e) {
    if (e.parentNode.className == 'sizelist checked') return;
    //赋值
    $('#sel_size').val(e.innerHTML + ',' + e.parentNode.id.substr(1));

    //改变样式
    $('#size a').each(function() {
        $(this).attr('class', 'sizelist');
    });
    e.parentNode.className = 'sizelist checked';

    //ajax重新加载颜色
    $.ajax({
        type: 'POST',
        url: '/cart.ajax.php',
        data: 'act=load_store&goods_id=' + $('#goods_id').val() + '&size_id=' + e.parentNode.id.substr(1),
        dataType: 'jsonp',
        jsonp: 'callback',
        success: function(data) {
            var colors = data['colors'] || [];
            var c_len = colors.length;
            var c_html = '';
            var is_sel = false;

            for (var i = 0; i < c_len; i++) {
                //如果只有一种颜色则自动选择
                if (c_len == 1) {
                    c_html += '<a id="c' + colors[i]['color_id'] + '" href="javascript:;" class="sizelist checked"><span onclick="colorClick(this);">' + colors[i]['color_name'] + '</span></a>';
                    $('#sel_color').val(colors[i]['color_name'] + ',' + colors[i]['color_id']);
                    is_sel = true;
                    //如果之前已经选有颜色且那个颜色是该颜色已有则自动选中
                } else if ($('#sel_color').val() == (colors[i]['color_name'] + ',' + colors[i]['color_id'])) {
                    c_html += '<a id="c' + colors[i]['color_id'] + '" href="javascript:;" class="sizelist checked"><span onclick="colorClick(this);">' + colors[i]['color_name'] + '</span></a>';
                    is_sel = true;
                } else {
                    c_html += '<a id="c' + colors[i]['color_id'] + '" href="javascript:;" class="sizelist"><span onclick="colorClick(this);">' + colors[i]['color_name'] + '</span></a>';
                }
            }
            $('#color').html(c_html);
            if (!is_sel) $('#sel_color').val(''); //如果没有默认选择的颜色，则清空。
        }
    });
}

//弹出尺码颜色弹窗
function add_cart(goods_id) {
    document.csa_form.reset();
    $('#goods_id').val(goods_id);
    $('#goods_sn').val('');
    $('#condition').val('');
    $('#sel_size').val('');
    $('#sel_color').val('');

    $.ajax({
        type: 'POST',
        url: '/cart.ajax.php',
        data: 'act=load_store&goods_id=' + goods_id,
        dataType: 'jsonp',
        success: function(data) {
            var colors = data['colors'] || [];
            var sizes = data['sizes'] || [];
            var goods = data['goods'] || [];
            var c_len = colors.length;
            var s_len = sizes.length;
            var c_html = '';
            var s_html = '';

            if (c_len <= 1) {
                c_html += '<a href="javascript:;" class="sizelist checked"><span>' + colors[0]['color_name'] + '</span></a>';
                $('#sel_color').val(colors[0]['color_name'] + ',' + colors[0]['color_id']);
            } else {
                for (i = 0; i < c_len; i++) {
                    c_html += '<a id="c' + colors[i]['color_id'] + '" href="javascript:;" class="sizelist"><span onclick="colorClick(this);">' + colors[i]['color_name'] + '</span></a>';
                }
            }
            $('#color').html(c_html);

            if (s_len <= 1) {
                s_html += '<a href="javascript:;" class="sizelist checked"><span>' + sizes[0]['size_name'] + '</span></a>';
                $('#sel_size').val(sizes[0]['size_name'] + ',' + sizes[0]['size_id']);
            } else {
                for (i = 0; i < s_len; i++) {
                    s_html += '<a id="s' + sizes[i]['size_id'] + '" href="javascript:;" class="sizelist"><span onclick="sizeClick(this);">' + sizes[i]['size_name'] + '</span></a>';
                }
            }
            $('#size').html(s_html);
            $('#goods_sn').val(goods['goods_sn']);

            $('#color_sizes_area').show();
            var h = ($('#ac' + goods_id).offset().top - $('#color_sizes_area').height() / 2) + 'px';
            $('#color_sizes_area').center({ top: h });
        }
    });
}

//加入订单
function add_order() {
    var colorarr = ($('#sel_color').val()).split(',');
    var color_name = colorarr[0];
    var color_id = colorarr[1];
    var sizearr = ($('#sel_size').val()).split(',');
    var size_name = sizearr[0];
    var size_id = sizearr[1];
    var goods_sn = $('#goods_sn').val();
    var condition = $('#condition').val();
    var goods_id = $('#goods_id').val();
    var url = '/user.php?ajax=1&act=add_from_order&goods_sn=' + goods_sn + '&condition=' + condition + '&color_name=' + encodeURIComponent(color_name) + '&size_name=' + encodeURIComponent(size_name) + '&num=1';
    url = url + '&goods_id=' + goods_id + '&color_id=' + color_id + '&size_id=' + size_id + '&rnd=' + (new Date()).getTime();

    $.ajax({
        type: "GET",
        url: url,
        dataType: "jsonp",
        jsonp: 'callback',
        success: function(json) {
            if (json.success == 0) {
                $('#csa_submit_msg').html('出错啦！' + json.msg);
                var h = ($('#ac' + goods_id).offset().top - $('#csa_submit').height() / 2) + 'px';
                $('#csa_submit').show();
                $('#csa_submit').center({ top: h });
            } else if (json.success == 1) {
                load_cart();
            }
        }
    });
}

$(function() {
    $("#btn_addcart").click(function() {
        if ($('#sel_color').val() == '' && $('#sel_size').val() == '') {
            jQuery.tips.show(this, 180, '请选择颜色及尺码 <br><a href="javascript:;" onclick="jQuery.tips.close();">确定</a>');
        } else if ($('#sel_color').val() == '') {
            jQuery.tips.show(this, 180, '请选择颜色 <br><a href="javascript:;" onclick="jQuery.tips.close();">确定</a>');
        } else if ($('#sel_size').val() == '') {
            jQuery.tips.show(this, 180, '请选择尺码 <br><a href="javascript:;" onclick="jQuery.tips.close();">确定</a>');
        } else {
            add_order();
            if (!cart_count) {
                $('#nogoods').hide();
                cart_count = 0;
            }
            cart_count++;
            $('#color_sizes_area').hide();
            document.csa_form.reset();
        }
    });
});
//if (cart_count) load_cart();
//load_collect();

//add by marxw 
//显示优惠详情 
function showDiscount(goodsID) {
    hideWnd();
    var pos = $('#showDiscount' + goodsID).offset();
    var outerWidth = $('.showDiscount>a').outerWidth();
    $.ajax({
        type: "GET",
        //url: 'http://www.xiu.com/goods/ajax.php',
        url: '/cart.ajax.php',
        data: 'goods_id=' + goodsID + '&act=show_goods_discount',
        dataType: "jsonp",
        jsonp: 'callback',
        success: function(json) {
            var content = '';
            var money = 0;
            for (var i = 0; i < json.length; i++) {
                content += (i + 1) + '. ' + json[i].activity_name + '<br/>';
                money = json[i].activity_discount_amount;
            }
            $('#wndTitle').html('享受的优惠活动');
            $('#wndName').html(content);
            $('#wndMoney').html('共节省：<font color=red>' + money + '</font>元<br/>');
            $('#wndResult').css({ top: pos.top + 20, left: pos.left - 100 }).show();
        }
    });
}
//隐藏优惠详情提示
function hideWnd() {
    $('#wndResult').hide();
}

/*限制用户输入商品数量*/
function clearNoNum(obj, val) {
    var num = obj.value;
    if(!/^\d+$/.test(num) || num == "0") {obj.value = (val != undefined ? val : '1');return;}
    num = parseInt(num);
    if(num > 10) {alert('抱歉，单件商品最多限购10件');obj.value = (val != undefined ? val : '10');return;}
}

function checkCartPrice(ObjId, IsAjax) {
    $.ajax({
        url: '/ajax/ajax_cart.html?act=CheckCartPrice',
        cache: false,
        dataType: 'text',
        success: function(msg) {
            if (msg.indexOf(',') == -1) {
                if (typeof __doPostBack != "undefined")
                    __doPostBack(ObjId, '');
                else
                    document.forms[0].submit();
                return true;
            }
            else {
                if (IsAjax != undefined) {
                    alert("您购物车中有部分商品系统已对价格进行调整，所以购物金额将有所变动，造成不便敬请谅解");
                    location.replace(location.href);
                }
                else {
                    $.ajax({
                        url: '/ajax/ajax_cart.html?act=load_cart&IdArray=' + msg,
                        cache: false,
                        dataType: 'text',
                        success: function(data) {
                            $('#cart').html(data);
                            if (confirm("您购物车中有部分商品系统已对价格进行调整，造成不便敬请谅解。是否继续结算？")) {
                                if (typeof __doPostBack != "undefined")
                                    __doPostBack(ObjId, '');
                                else
                                    document.forms[0].submit();
                                return true;
                            }
                        }
                    });
                }
            }
        }
    });
    return false;
}