<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>订单页面</title>
<link rel="stylesheet" href="lib/iconfont/iconfont.css">
<link rel="stylesheet" href="css/base.css">
<link rel="stylesheet" href="css/order.css">
</head>
<body>
<!-- 样式图的顶端时间wife和填写订单区域均是手机自带 -->
<!-- main 主体start -->
<div class="main">
<!-- 用户信息start -->
<div class="user_msg pannel-bj">
<div class="location">
<img src="images/loc-s.png" alt="">
</div>
<div class="user">
<div class="top">
<!-- 添加两个标签,存放两个不同的数据库数据,以便后期利用数据库修改 -->
<h5>张三</h5>
<p>18500667882</p>
</div>
<div class="bottom">北京市 海淀区 中关村软件园 信息科技大厦1号 楼410#北京市 海淀区 中关村软件园 信息科技大厦1号 楼410#</div>
</div>
<div class="arrow">
<a href="http://www.360.com" class="icon-arrow-right iconfont"></a>
</div>
</div>
<!-- 用户信息end -->
<!-- 商品 -->
<div class="goods pannel-bj">
<!-- 放三个区域 -->
<div class="pic">
<a href="#">
<img src="uploads/pic.png" alt="">
</a>
</div>
<div class="info">
<h5>康尔贝 非接触式红外体温仪<br>领券立减30元 婴儿级材质 测温无敌无敌</h5>
<p><span>粉色</span> <i>红外体温计</i></p>
<div class="price">
<!-- 动态变化的数据都放入标签内 -->
<span class="font-red">¥<i>266</i></span>
<span>¥<i>299</i></span>
</div>
</div>
<div class="count">
<!-- 凡是数据要通过数据库修改的都需要放入标签 -->
<i class="iconfont icon-close"></i>
<span>1</span>
</div>
</div>
<!-- 商品 -->
<!-- 其他模块用rest类名 -->
<section class="rest pannel-bj">
<div>
<h5>配送方式</h5>
<p>顺丰快递</p>
</div>
<div>
<h5>买家备注</h5>
<p>希望可以尽快发货,谢谢~</p>
</div>
<div>
<h5>支付方式</h5>
<p>支付宝</p>
</div>
</section>
<section class="rest2 pannel-bj">
<div>
<h5>商品总价</h5>
<p>¥<i>299.00</i></p>
</div>
<div>
<h5>运费</h5>
<p>¥<i>0.00</i></p>
</div>
<div>
<h5>折扣</h5>
<p>-¥<i>30.00</i></p>
</div>
</section>
<!-- 其他模块用rest类名 -->
</div>
<!-- main 主体end -->
<!-- pay支付start -->
<div class="pay">
<div class="left">
<!-- 价格后期经过数据块修改,需要存放在标签中利于修改 -->
合计:<span class="font-red">¥<i>266.00</i></span>
</div>
<div class="right">
<a href="http://www.360.com">去支付</a>
</div>
</div>
<!-- pay支付end -->
<!-- pay支付跳转页面 -->
<div class="paystyle">
<div class="title">
<h4>支付方式</h4>
</div>
<div class="variety">
<div class="top">
<img src="images/zhifubao.png" alt="">
<span>支付宝</span>
<div class="gouxuan"></div>
</div>
<div class="bottom">
<img src="images/weixinzhifu.png" alt="">
<span>微信支付</span>
<div class="gouxuan"></div>
</div>
</div>
<div class="purchase">
<a href="#">立即购买</a>
</div>
</div>
<!-- pay支付跳转页面 -->
</body>
</html>
.font-red {
color: #cf4444;
}
.pannel-bj {
margin-bottom: 10px;
background-color: #fff;
border-radius: 5px;
}
/* main 开始 */
.main {
/* main主体部分需要防止内容被固定定位的pay区域盖住 */
/* 底部内边距设置80px目的是防止展示的内容被pay固定内容区域盖住 */
padding: 12px 11px 80px;
}
.main .user_msg {
/* 使用弹性布局,块级元素一行多个显示 */
display: flex;
align-items: center;
padding: 15px 0 14px 11px;
height: 85px;
}
.user_msg .location {
margin-right: 11px;
width: 30px;
height: 30px;
}
.user {
/* 将剩下的空白部分最为一份,而user占一份 */
flex: 1;
}
.user .top {
display: flex;
}
.user .top h5 {
font-size: 14px;
}
.user .top p {
font-size: 13px;
}
.user .bottom {
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
font-size: 12px;
height: 35px;
}
.user_msg .arrow {
width: 44px;
height: 44px;
line-height: 44px;
}
.user_msg .arrow a {
display: block;
width: 100%;
height: 100%;
text-align: center;
}
/* 商品goods区域开始 */
.goods {
display: flex;
padding-left: 11px;
}
.goods .pic {
margin: 11px 12px 11px 0;
/* 因为在base基础样式里设置了图片宽度默认100%
所以不需要设置图片的大小,默认随父级*/
width: 85px;
height: 85px;
}
.info {
flex: 1;
margin-top: 18px;
}
.goods .count {
margin-top: -8px;
align-self: center;
width: 44px;
height: 44px;
text-align: center!important;
line-height: 44px!important;
}
.goods .info h5 {
font-size: 13px;
font-weight: 400;
/* 设置省略号 */
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
.goods .info p {
width: 115px;
height: 16px;
border-radius: 2px;
margin-top: 5px;
padding: 0 5px;
line-height: 16px;
font-size: 12px;
background-color: #f7f7f8;
}
.goods .info p span {
padding-right: 5px;
}
.goods .info .price {
font-size: 12px;
}
.goods .info .price span:first-child i {
font-size: 16px;
}
.goods .info .price span:last-child {
margin-left: 12px;
color: #999;
text-decoration: line-through;
}
/* 其他模块 */
.rest {
padding: 14px 15px 16px 13px;
}
.rest>div {
display: flex;
}
.rest div:nth-child(odd) {
justify-content: space-between;
}
.rest div:nth-child(2) {
margin: 29px 0;
}
.rest div:nth-child(2) p {
margin-left: 20px;
font-size: 12px;
color: #989898;
}
.rest h5,
.rest p {
font-size: 13px;
font-weight: 400;
}
.rest2 {
padding: 14px 15px 16px 13px;
}
.rest2>div {
display: flex;
justify-content: space-between;
}
.rest2 div:nth-child(2) {
margin: 29px 0;
}
.rest2 h5,
.rest2 p {
font-size: 13px;
font-weight: 400;
}
/* main 结束 */
/* pay开始 */
/* pay支付区域采用固定定位的方法 */
.pay {
/* 选择浏览器推荐的布局方法,浏览器的渲染速度快加载更快 */
display: flex;
/* 让空白在两个弹性盒子之间 */
justify-content: space-between;
/* 让弹性盒子在弹性容器中垂直居中 */
align-items: center;
padding: 0 11px 0 10px;
/* 固定定位的盒子会脱标 所以需要手动添加宽度*/
position: fixed;
left: 0;
bottom: 0;
z-index: 1;
background-color: #fff;
width: 100%;
height: 80px;
border-top: 1px solid #ededed;
}
.pay .left {
/* 浏览器的最小字体为12px */
font-size: 11px;
}
.pay .left span i {
font-size: 20px;
}
.pay .right a {
display: block;
width: 91px;
height: 35px;
text-align: center;
line-height: 35px;
color: #fff;
border-radius: 3px;
background-image: linear-gradient(90deg, #6fc2aa 5%, #54b196 100%);
}
/* pay结束 */
/* 付款跳转 */
.paystyle {
opacity: 1;
position: absolute;
left: 0;
bottom: 0;
border-top-left-radius: 5px;
border-top-right-radius: 5px;
width: 100%;
height: 350px;
background-color: #fff;
}
.paystyle .title {
padding-top: 15px;
text-align: center;
}
.paystyle .variety {
padding-left: 12px;
}
.variety img {
margin-right: 10px;
height: 14px;
width: 14px;
}
.variety .top,
.variety .bottom {
display: flex;
align-items: center;
justify-content: space-between;
height: 49px;
width: 340px;
border-bottom: 1px dotted #ccc;
}
.variety span {
margin-left: -236px;
}
.variety .gouxuan {
width: 14px;
height: 14px;
border: 1px solid #ccc;
border-radius: 50%;
}
.paystyle .purchase {
margin: 138px 0 0 11px;
width: 354px;
height: 40px;
line-height: 40px;
text-align: center;
background-image: linear-gradient(90deg, #6fc2aa 5%, #54b196 100%);
border-radius: 3px;
}
.paystyle .purchase a {
display: block;
width: 100%;
height: 100%;
color: #fff;
}
首先隐藏 支付方式 界面。
然后 对去支付按钮绑定点击事件,在点击事件的逻辑中 显示 支付界面就行,如果还有问题,可以私信我。