今天是在第二大学远程实习的第四天,偷偷发个博客记录一下自己的成长哈哈(今天继续学习电子商城)
html:
<!--构建假的商品信息-->
<view class="works">
<view class="container">
<!--爆款热卖+更多-->
<view class="pubTile">
<view class="txt">爆款热卖</view>
<navigator url="" class="more">更多</navigator>
</view>
<!--商品详情-->
<view class="wkMain">
<navigator url="" hover-class="none" class="box">
<view style="height: 380rpx;width: 350rpx;">
<image class="pic" src="https://img14.360buyimg.com/n7/jfs/t1/46331/32/18165/29244/63612692E8c9f0c92/ee169c476757a077.jpg"></image>
</view>
<view class="ceng">
<view class="tit">Apple iPhone 14 (A2884) 128GB 紫色 5G 双卡双待手机</view>
<view class="des">
<view style="font-size:24rpx ;color: red;">¥5999.00元</view>
<view style="font-size: 20rpx;color: slategray;">200+人付款</view>
</view>
</view>
</navigator>
<navigator url="" hover-class="none" class="box">
<view style="height: 380rpx;width: 350rpx;">
<image class="pic" src="https://img14.360buyimg.com/n7/jfs/t1/46331/32/18165/29244/63612692E8c9f0c92/ee169c476757a077.jpg"></image>
</view>
<view class="ceng">
<view class="tit">Apple iPhone 14 (A2884) 128GB 紫色 5G 双卡双待手机</view>
<view class="des">
<view style="font-size:24rpx ;color: red;">¥5999.00元</view>
<view style="font-size: 20rpx;color: slategray;">200+人付款</view>
</view>
</view>
</navigator>
<navigator url="" hover-class="none" class="box">
<view style="height: 380rpx;width: 350rpx;">
<image class="pic" src="https://img14.360buyimg.com/n7/jfs/t1/46331/32/18165/29244/63612692E8c9f0c92/ee169c476757a077.jpg"></image>
</view>
<view class="ceng">
<view class="tit">Apple iPhone 14 (A2884) 128GB 紫色 5G 双卡双待手机</view>
<view class="des">
<view style="font-size:24rpx ;color: red;">¥5999.00元</view>
<view style="font-size: 20rpx;color: slategray;">200+人付款</view>
</view>
</view>
</navigator>
<navigator url="" hover-class="none" class="box">
<view style="height: 380rpx;width: 350rpx;">
<image class="pic" src="https://img14.360buyimg.com/n7/jfs/t1/46331/32/18165/29244/63612692E8c9f0c92/ee169c476757a077.jpg"></image>
</view>
<view class="ceng">
<view class="tit">Apple iPhone 14 (A2884) 128GB 紫色 5G 双卡双待手机</view>
<view class="des">
<view style="font-size:24rpx ;color: red;">¥5999.00元</view>
<view style="font-size: 20rpx;color: slategray;">200+人付款</view>
</view>
</view>
</navigator>
</view>
</view>
</view>
wxss:
/*假的商品信息*/
.works{
background:#f0f3f8;
padding: 90rpx 0 0;
}
/*(爆款热卖+更多)*/
.pubTile{
display: flex;
justify-content: space-between;
height: 60rpx;
align-items: center;
margin-bottom: 40rpx;
}
.pubTile .txt{
font-size: 40rpx;
height: 100%;
position: relative;
padding-left: 20rpx;
}
.pubTile.txt ::before{
display:block;
width: 10rpx;
height: 34rpx;
background: #d80b07;
content: "";
position: absolute;
left: 0;
top: 50%;
margin-top: -15rpx;
}
.pubTile .more{
font-size: 34rpx;
color: #666;
}
/*(商品详情)*/
.wkMain{
display: flex;
flex-wrap: wrap;
justify-content: space-between;
}
.wkMain .box{
width: 344rpx;
height: 550rpx;
margin-bottom: 10rpx;
position: relative;
}
.wkMain .pic{
width: 100%;
height: 100%;
}
.wkMain .ceng{
width: 350rpx;
height: 200rpx;
background: rgba(0,0,0,0,3);
top:0;
left: 0;
color: #666;
display: flex;
flex-direction: column;
}
.tit{
font-size: 34rpx;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
.wkMain .ceng .des{
display: flex;
justify-content: space-between;
opacity: 1.2;
text-transform: uppercase;
letter-spacing: 5rpx;}
效果:
重难点:
1.各个view之间的排列设计
2.文字的排列以及样式设计