1 Star 0 Fork 0

jinlllll/day03

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
购物车.html 3.43 KB
一键复制 编辑 原始数据 按行查看 历史
jinlllll 提交于 2022-10-12 22:51 . 作业
<!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>Document</title>
<style>
*{
margin: 0;
padding: 0;
}
i{
font-style: normal;
color: red;
font-size: 20px;
}
html,body{
height: 100%;
}
#app{
/* height: 100%; */
width: 100%;
position: absolute;
bottom: 0;
}
#app .bx{
width: 92%;
/* background-color: antiquewhite; */
margin: auto;
height: 92%;
margin-top: 4%;
}
#app .bx .title{
display: flex;
justify-content: space-between;
margin-bottom: 10px;
}
#app .bx .list{
height: 120px;
}
#app .bx .list img{
width: 100px;
height: 100px;
float: left;
margin: 0 5px;
}
#app .bx .list .price{
margin-top: 60px;
display: flex;
justify-content: space-between;
}
#app .bx .list .price span{
display: inline-block;
width: 16px;
height: 16px;
text-align: center;
line-height: 14px;
background-color: lightskyblue;
color: white;
border-radius: 50%;
}
#app .bx .list .price span:nth-child(2){
color: black;
background-color: white;
}
.cls{
width: 100%;
height: 100px;
text-align: center;
line-height: 100px;
}
#app .bx .summary{
display: flex;
justify-content: space-between;
background-color: gray;
height: 40px;
line-height: 40px;
width: 100%;
}
#app .bx .summary span:nth-child(2){
background-color: lightgreen;
color: white;
height: 6px;
padding: 10px;
margin-top: 5px;
line-height: 6px;
border-radius: 5px;
}
</style>
</head>
<body>
<div id="app">
<div class="bx">
<div class="title">
<h3>已选商品</h3>
<span @click="clean">清空</span>
</div>
<div v-if="list.length!==0">
<div class="list" v-for="(item,index) in list">
<img :src="item.pic" >
<h4>{{item.name}}</h4>
<div class="price">
<i>¥{{item.price}}</i>
<div>
<span @click="sub(item)">-</span>
<span>{{item.count}}</span>
<span @click="add(item)">+</span>
</div>
</div>
</div>
</div>
<div v-else class="cls">购物车空空如也,去逛逛!</div>
<div class="summary">
<span>总数:{{totalCount}} 总价:{{totalPrice}} </span>
<span>去结算</span>
</div>
</div>
</div>
</body>
</html>
<script src="./vue-2.5.21.js"></script>
<script src="./购物车.js"></script>
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/jinlllll/day03.git
[email protected]:jinlllll/day03.git
jinlllll
day03
day03
master

搜索帮助