You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
227 lines
4.9 KiB
227 lines
4.9 KiB
3 months ago
|
<template>
|
||
|
<div class="home-layout-container">
|
||
|
<!-- 左侧导航栏 -->
|
||
|
<div class="left-nav">
|
||
|
<ul class="nav-list">
|
||
|
<li class="nav-item"><i class="el-icon-sell"></i>全部商品</li>
|
||
|
<li class="nav-item"><i class="el-icon-burger"></i>米面油</li>
|
||
|
<li class="nav-item"><i class="el-icon-fork-spoon"></i>调味干货</li>
|
||
|
<li class="nav-item"><i class="el-icon-potato-strips"></i>休闲食品</li>
|
||
|
<li class="nav-item"><i class="el-icon-dish"></i>禽畜肉蛋</li>
|
||
|
<li class="nav-item"><i class="el-icon-grape"></i>鲜果蔬菜</li>
|
||
|
<li class="nav-item"><i class="el-icon-present"></i>组合集市</li>
|
||
|
</ul>
|
||
|
</div>
|
||
|
|
||
|
<!-- 轮播图 -->
|
||
|
<div class="main-content">
|
||
|
<el-carousel style="height: 100%">
|
||
|
<el-carousel-item v-for="item in 4" :key="item.id">
|
||
|
<img
|
||
|
src="
|
||
|
https://static.ticket.sz-trip.com/jundaosuzhou/images/scenicType/topImg.png
|
||
|
"
|
||
|
class="carousel-img"
|
||
|
/>
|
||
|
</el-carousel-item>
|
||
|
</el-carousel>
|
||
|
</div>
|
||
|
|
||
|
<!-- 右侧用户信息栏 -->
|
||
|
<div class="right-info">
|
||
|
<div class="avatar-container">
|
||
|
<img
|
||
|
src="https://picsum.photos/id/64/120/120"
|
||
|
alt="用户头像"
|
||
|
class="user-avatar"
|
||
|
/>
|
||
|
<div class="welcome-text">Hi-欢迎您</div>
|
||
|
</div>
|
||
|
|
||
|
<div class="btn-group">
|
||
|
<el-button type="danger" size="mini">登录</el-button>
|
||
|
<el-button type="warning" size="mini">注册</el-button>
|
||
|
<el-button type="primary" size="mini">客服</el-button>
|
||
|
</div>
|
||
|
|
||
|
<div class="func-icons">
|
||
|
<div class="icon-item">
|
||
|
<i class="icon el-icon-user"></i>
|
||
|
<span>个人中心</span>
|
||
|
</div>
|
||
|
<div class="icon-item">
|
||
|
<i class="icon el-icon-goods"></i>
|
||
|
<span>我的订单</span>
|
||
|
</div>
|
||
|
<div class="icon-item">
|
||
|
<i class="icon el-icon-star-off"></i>
|
||
|
<span>我的收藏</span>
|
||
|
</div>
|
||
|
<div class="icon-item">
|
||
|
<i class="icon el-icon-pie-chart"></i>
|
||
|
<span>议价单</span>
|
||
|
</div>
|
||
|
</div>
|
||
|
|
||
|
<div class="announcement">
|
||
|
<el-tag type="danger" size="mini">公告</el-tag>
|
||
|
<span>2099年12月平台重要新规速递</span>
|
||
|
</div>
|
||
|
</div>
|
||
|
</div>
|
||
|
</template>
|
||
|
|
||
|
<script>
|
||
|
export default {
|
||
|
name: "HomeLayout",
|
||
|
data() {
|
||
|
return {
|
||
|
// 轮播图数据
|
||
|
carouselItems: [
|
||
|
{
|
||
|
id: 1,
|
||
|
imageUrl: "https://picsum.photos/id/26/1200/500",
|
||
|
altText: "新鲜水果促销",
|
||
|
},
|
||
|
{
|
||
|
id: 2,
|
||
|
imageUrl: "https://picsum.photos/id/292/1200/500",
|
||
|
altText: "有机蔬菜专场",
|
||
|
},
|
||
|
{
|
||
|
id: 3,
|
||
|
imageUrl: "https://picsum.photos/id/431/1200/500",
|
||
|
altText: "粮油特惠活动",
|
||
|
},
|
||
|
],
|
||
|
};
|
||
|
},
|
||
|
};
|
||
|
</script>
|
||
|
|
||
|
<style scoped lang="scss">
|
||
|
.home-layout-container {
|
||
|
display: flex;
|
||
|
width: 100%;
|
||
|
height: auto;
|
||
|
}
|
||
|
|
||
|
/* 左侧导航栏样式 */
|
||
|
.left-nav {
|
||
|
width: 200px;
|
||
|
background-color: #f8f9fa;
|
||
|
padding: 20px 0;
|
||
|
box-sizing: border-box;
|
||
|
}
|
||
|
.nav-list {
|
||
|
list-style: none;
|
||
|
margin: 0;
|
||
|
padding: 0;
|
||
|
}
|
||
|
.nav-item {
|
||
|
padding: 12px 20px;
|
||
|
cursor: pointer;
|
||
|
color: #333;
|
||
|
transition: all 0.3s ease;
|
||
|
|
||
|
i {
|
||
|
color: #f63131;
|
||
|
margin-right: 5px;
|
||
|
}
|
||
|
}
|
||
|
.nav-item:hover {
|
||
|
background-color: #e9ecef;
|
||
|
padding-left: 25px;
|
||
|
}
|
||
|
|
||
|
/* 中间主内容样式 */
|
||
|
.main-content {
|
||
|
flex: 1;
|
||
|
height: auto;
|
||
|
overflow: hidden;
|
||
|
}
|
||
|
.carousel-img {
|
||
|
width: 100%;
|
||
|
height: 100%;
|
||
|
object-fit: cover;
|
||
|
}
|
||
|
.main-content ::v-deep .el-carousel__container {
|
||
|
height: 100% !important;
|
||
|
}
|
||
|
|
||
|
/* 右侧用户信息栏样式 */
|
||
|
.right-info {
|
||
|
width: 280px;
|
||
|
background-color: #fff;
|
||
|
padding: 20px;
|
||
|
box-sizing: border-box;
|
||
|
display: flex;
|
||
|
flex-direction: column;
|
||
|
align-items: center;
|
||
|
border-left: 1px solid #eee;
|
||
|
}
|
||
|
.avatar-container {
|
||
|
display: flex;
|
||
|
flex-direction: column;
|
||
|
align-items: center;
|
||
|
margin-bottom: 20px;
|
||
|
}
|
||
|
.user-avatar {
|
||
|
width: 60px;
|
||
|
height: 60px;
|
||
|
border-radius: 50%;
|
||
|
margin-bottom: 10px;
|
||
|
border: 2px solid #f0f0f0;
|
||
|
}
|
||
|
.welcome-text {
|
||
|
font-size: 14px;
|
||
|
color: #333;
|
||
|
}
|
||
|
.btn-group {
|
||
|
display: flex;
|
||
|
gap: 10px;
|
||
|
margin-bottom: 30px;
|
||
|
width: 100%;
|
||
|
}
|
||
|
.func-icons {
|
||
|
display: flex;
|
||
|
justify-content: space-around;
|
||
|
width: 100%;
|
||
|
margin-bottom: 30px;
|
||
|
padding: 10px 0;
|
||
|
border-top: 1px dashed #eee;
|
||
|
border-bottom: 1px dashed #eee;
|
||
|
}
|
||
|
.icon-item {
|
||
|
display: flex;
|
||
|
flex-direction: column;
|
||
|
align-items: center;
|
||
|
cursor: pointer;
|
||
|
color: #666;
|
||
|
transition: color 0.3s ease;
|
||
|
width: 50px;
|
||
|
}
|
||
|
.icon-item:hover {
|
||
|
color: #1890ff;
|
||
|
}
|
||
|
.icon {
|
||
|
font-size: 24px;
|
||
|
margin-bottom: 5px;
|
||
|
}
|
||
|
.icon-item span {
|
||
|
font-size: 12px;
|
||
|
}
|
||
|
.announcement {
|
||
|
display: flex;
|
||
|
align-items: center;
|
||
|
font-size: 12px;
|
||
|
color: #666;
|
||
|
width: 100%;
|
||
|
padding-top: 10px;
|
||
|
|
||
|
span {
|
||
|
margin-left: 10px;
|
||
|
}
|
||
|
}
|
||
|
</style>
|
||
|
|