ppypp伦理天堂,91手机在线视频,免费在线观看黄色毛片,夜夜穞天天穞狠狠穞AV美女按摩

任意模塊開(kāi)啟訂單功能之后,都可以使用購(gòu)物車(chē)功能

// 購(gòu)物車(chē)
var is_cart = true;
function dr_cart() {
	if (!is_cart) {
		alert('刷新后再試');
		return;
	}
	var cart = "{dr_url('order/cart/add', array('mid'=>APP_DIR, 'cid'=>$id))}&num=購(gòu)買(mǎi)數(shù)量";
	is_cart = false;
	$.ajax({type: "GET", url: cart, dataType:"jsonp",
	    success: function (data) {
			if (data.status) {
				var html = "<div style=\"font-size:14px\">已成功添加到購(gòu)物車(chē)!購(gòu)物車(chē)?yán)镆延?nbsp;<font color=red>"+data.code+"</font> 種商品</div>";
				art.dialog({
					id: 'cart',
					lock: true,
					opacity: 0.1,
					content: html,
					ok: function () {
						location.href="{dr_url('order/cart/index')}";
						is_cart = true;
						return false;
					},
					okVal: '去結(jié)算',
					cancelVal: '繼續(xù)購(gòu)物',
					cancel: function () {
						is_cart = true;
						return true;
					} 
				});
			} else {
				dr_tips(data.code);
				is_cart = true;
			}
	    }
	});
}

以上的js代碼,用于將指定數(shù)量的商品加入到購(gòu)物車(chē)中,通過(guò)下面的調(diào)用

<a href="javascript:;" onclick="dr_cart()">加入購(gòu)物車(chē)</a>



購(gòu)物中商品數(shù)量

<script language="javascript">
    $.get("/index.php?s=order&c=cart&m=nums", function(data){
        alert('商品數(shù):'+data.code);
    }, 'jsonp');
</script>


文檔最后更新時(shí)間:2017-05-08 13:16:27