购物车页面

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>购物车</title>
<script type="text/javascript">  
   function jian(obj){
	    var oNum = obj.parentNode.children[2];
		var iNum = parseInt(oNum.innerHTML);
		if(iNum>1){
			var flag = confirm("您本次修改的商品数量为:"+(iNum - 1)+"请确认以上信息是否有误!");
			if(flag)
			    oNum.innerHTML = iNum - 1 ;
		}
   };
   function jia(obj,i){
	    var oNum = obj.parentNode.children[2];
		var iNum = parseInt(oNum.innerHTML);
		if(iNum<i){
			var flag = confirm("您本次修改的商品数量为:"+(iNum + 1)+"请确认以上信息是否有误!");
			if(flag)
			      oNum.innerHTML = iNum + 1 ;
		}
   };

   function checkAll(obj){
	    var cbs = document.getElementsByTagName("input"); 
		for(i = 0; i<cbs.length;i++){
			if(obj.checked == true&&cbs[i].parentNode.parentNode.parentNode.parentNode==obj.parentNode.parentNode.parentNode)
			    cbs[i].checked = true;
			else if(obj.checked == false&&cbs[i].parentNode.parentNode.parentNode.parentNode==obj.parentNode.parentNode.parentNode)
			    cbs[i].checked = false;
			else if(obj.checked == true&&obj.name=="buy_all")
			    cbs[i].checked = true;
			else if(obj.checked == false&&obj.name=="buy_all")
			    cbs[i].checked = false;
		}       
   }
</script>
<script src="js/jquery-3.3.1.js"></script>
<script>
  $(function(){
	    $("#delBtn").click(function(){
		       if(!confirm("一旦删除将无法恢复!您确定要删除吗?"))	{
				   return;
			   }else{
				   $(".add:checked").parent().parent().remove();
				   $(".store").each(function(){
					         if($(this).children(".store_content").children(".pro").children(".pro_select").children(".add").length==0)
				                     $(this).remove(); 
					});
			   }
		});  
  });
</script>
<style>
body{width:1200px; margin:auto;}
*{ margin:0; padding:0;}
.frame{width:100%; height:auto;clear:both;}




#head{
	
}
#head button{
	float:right;
	width:100px;
	height:25px;
	margin:5px;
}
/*商店名称*/
.store .store_head{
	width:100%;
	height:auto;
	background-color:#999;
	padding-top:10px;
	padding-bottom:10px;
	clear:both;
	border:1px solid #999;
}
.store .store_head h3,a{
	text-align:left;
	color:white;
}

/*从属于该商店的商品们*/
.store .store_content{
	width:100%;
	overflow:hidden;
}
.store .store_content .pro{
	float:left;
	border:1px solid #999;
	width:49.83%;
}
.store .store_content .pro div{
	float:left;
	height:120px;
}
/*复选框*/
.pro_select{
	width:10%;
}
.pro_select input{
	margin-top:50px;
}
/*商品图片*/
.pro_img{
	width:20%;
}
.pro_img img{
	width:90%;
	height:100%;
}
/*商品简介*/
.pro_brief{
	width:30%;
}
.pro_brief p{
	margin-top:10px;
}
/*单价*/
.pro_price{
	width:20%;
}
.pro h4{
	margin-top:10px;
}
.pro_price p{
	color:red;
	margin-top:20px;
}


/*加减器*/
.pro_counter{
	width:20%;
}
.pro_counter h4{
	margin-top:10px;
}
.pro_counter span{
	width:35px;
    height:20px;
	float:left;
	border:1px solid #999;
	margin-top:20px;
	cursor:pointer;
}




#buy{
	background-color:#F00;
	width:100%;
	height:100px;
	position:fixed !important;
	left:0px;
	bottom:0px;
	z-index:1;
	color:white;
}

#buy #buy_all{
	float:left;
	padding-top:40px;
	padding-left:100px;
}
#buy #heji{
	float:right;
	padding-top:40px;
	padding-right:10px;
}
#buy #jiesuan{
	float:right;
	width:200px;
	height:100%;
}
#jiesuan input{
	width:100%;
	height:100%;
	background-color:#F60;
	border:0;
	color:white;
	font-size:24px;
}
</style>
</head>

<body>

<div><iframe src="top.html" class="frame" scrolling="no" frameborder="0"></iframe></div>


<center>

<div id="head"><hr/>
     <h1>购物车</h1>
     <button id="moveBtn">移入收藏夹</button>
     <button id="delBtn">删除</button>
</div>

<div id="content">
    <form action="#" method="post">
    <!--商店-->
    <div class="store">
       <!--商店名称-->
       <div class="store_head"><h3>  <input name="$" type="checkbox" value="" οnclick="checkAll(this)"/> <a href="#"><a href="">小麦二手电脑旗舰店</a></h3></div>
       <!--商品-->
       <div class="store_content">
       
           <div class="pro">
              <div class="pro_select"><input name="add" class="add" type="checkbox" /></div>
              <div class="pro_img"><a href="商品详情.html" target="_blank"><img src="img/list0.jpg"/></a></div>
              <div class="pro_brief"><p>二手9成新ThinkPad笔记本电脑4G内存/2G独显/128G固态硬盘二手9成新ThinkPad笔记本电脑4G内存/2G独显/128G固态硬盘</p></div>
              <div class="pro_price"><h4>单价:</h4><p>¥2999777777</p></div>
              <div class="pro_counter">
                 <h4>数量:</h4>
                 <span id="jian1" οnclick="jian(this)">-</span>
                 <span id="num1">1</span>
                 <span id="jia1" οnclick="jia(this,5)">+</span>
              </div>
           </div>
           
       </div>
    </div>
    
    <div class="store">
       <!--商店名称-->
       <div class="store_head"><h3>  <input  type="checkbox" value="" οnclick="checkAll(this)"/> <a href="#"><a href="">小麦二手电脑旗舰店</a></h3></div>
       <!--商品-->
       <div class="store_content">
       
           <div class="pro">
              <div class="pro_select"><input name="add" class="add" type="checkbox" /></div>
              <div class="pro_img"><a href="商品详情.html" target="_blank"><img src="img/list0.jpg"/></a></div>
              <div class="pro_brief"><p>二手9成新ThinkPad笔记本电脑4G内存/2G独显/128G固态硬盘二手9成新ThinkPad笔记本电脑4G内存/2G独显/128G固态硬盘</p></div>
              <div class="pro_price"><h4>单价:</h4><p>¥2999777777</p></div>
              <div class="pro_counter">
                 <h4>数量:</h4>
                 <span id="jian1" οnclick="jian(this)">-</span>
                 <span id="num1">1</span>
                 <span id="jia1" οnclick="jia(this,5)">+</span>
              </div>
           </div>
       </div>
    </div>
    
    <div id="buy">
       <div id="buy_all"><h2><input type="checkbox" name="buy_all" οnclick="checkAll(this)"/> 全选</h2></div>
       <div id="jiesuan"><input type="submit"/></div>
       <div id="heji"><h2>合计:¥100000000000</h2></div>
    </div>
    
    
    </form>
</div>


</center>



<div><iframe src="footer.html" class="frame" scrolling="no" frameborder="0"></iframe></div>


</body>
</html>

  • 0
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值