|
|
|
@ -7,18 +7,18 @@
|
|
|
|
|
@mouseenter="handleCategoryChange(true)"
|
|
|
|
|
@mouseleave="handleCategoryChange(false)"
|
|
|
|
|
>
|
|
|
|
|
<div class="tab-category__label flex flex-middle">
|
|
|
|
|
<!-- <div class="tab-category__label flex flex-middle">
|
|
|
|
|
<img src="~/assets/img/layout/icon-category.png" />
|
|
|
|
|
<span>热门分类</span>
|
|
|
|
|
</div>
|
|
|
|
|
</div> -->
|
|
|
|
|
<div
|
|
|
|
|
v-show="isCategroyOpen || categroyVisible"
|
|
|
|
|
class="tab-category__menu flex"
|
|
|
|
|
class="tab-category__menu"
|
|
|
|
|
@mouseenter="handleCategoryTwoChange(true)"
|
|
|
|
|
@mouseleave="handleCategoryTwoChange(false)"
|
|
|
|
|
>
|
|
|
|
|
<!-- 左侧一级分类 -->
|
|
|
|
|
<div class="tab-category-menu__left">
|
|
|
|
|
<div class="tab-category-menu__left flex flex-between flex-middle">
|
|
|
|
|
<div
|
|
|
|
|
v-for="item in categroyData"
|
|
|
|
|
:key="item.id"
|
|
|
|
@ -29,31 +29,27 @@
|
|
|
|
|
'menu-left__item--light': item.id === currentCategroyId,
|
|
|
|
|
}"
|
|
|
|
|
>
|
|
|
|
|
<img :src="item.icon" />
|
|
|
|
|
<span>{{ item.name }}</span>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="menu-left__item--bottom"></div>
|
|
|
|
|
<!-- 右侧二级分类 -->
|
|
|
|
|
<div class="tab-category-menu__right flex-1 flex-wrap flex-between">
|
|
|
|
|
<div
|
|
|
|
|
v-show="categroyTwoVisible"
|
|
|
|
|
class="tab-category-menu__right flex-1"
|
|
|
|
|
v-for="itemList in getList(item.id)"
|
|
|
|
|
:key="itemList.id"
|
|
|
|
|
class="menu-right-wrap__item"
|
|
|
|
|
@click="onCategoryClick(itemList.id, CATEGROY_LEVEL.TWO)"
|
|
|
|
|
>
|
|
|
|
|
<div
|
|
|
|
|
<img :src="itemList.picture" alt="商品分类" />
|
|
|
|
|
{{ itemList.name }}
|
|
|
|
|
</div>
|
|
|
|
|
<!-- <div
|
|
|
|
|
v-for="item in list"
|
|
|
|
|
:key="item.id"
|
|
|
|
|
@mouseenter="handleCategoryHover(item.id)"
|
|
|
|
|
class="category-menu-right__wrap"
|
|
|
|
|
:class="{
|
|
|
|
|
'category-menu-right__wrap--light': item.id === currentCategroyId,
|
|
|
|
|
}"
|
|
|
|
|
>
|
|
|
|
|
<span
|
|
|
|
|
v-for="itemList in item.list"
|
|
|
|
|
:key="itemList.id"
|
|
|
|
|
class="menu-right-wrap__item"
|
|
|
|
|
@click="onCategoryClick(itemList.id, CATEGROY_LEVEL.TWO)"
|
|
|
|
|
>{{ itemList.name }}</span
|
|
|
|
|
>
|
|
|
|
|
v-show="item.id === currentCategroyId"
|
|
|
|
|
></div> -->
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
@ -101,6 +97,11 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
getList(id) {
|
|
|
|
|
let list = this.list.filter((item) => item.id == id);
|
|
|
|
|
console.log(`list[0]?.list`, list[0]?.list);
|
|
|
|
|
return list[0]?.list;
|
|
|
|
|
},
|
|
|
|
|
// 获取热门分类信息
|
|
|
|
|
async getCategroyData() {
|
|
|
|
|
this.list = await Promise.all(
|
|
|
|
@ -146,9 +147,11 @@ export default {
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
|
.header-category {
|
|
|
|
|
height: 100%;
|
|
|
|
|
width: 700px;
|
|
|
|
|
.header-box-tab__category {
|
|
|
|
|
position: relative;
|
|
|
|
|
height: 100%;
|
|
|
|
|
width: 700px;
|
|
|
|
|
.tab-category__label {
|
|
|
|
|
width: 190px;
|
|
|
|
|
height: 100%;
|
|
|
|
@ -165,60 +168,67 @@ export default {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
.tab-category__menu {
|
|
|
|
|
position: absolute;
|
|
|
|
|
top: 38px;
|
|
|
|
|
left: 0;
|
|
|
|
|
height: 360px;
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
color: #333333;
|
|
|
|
|
// position: absolute;
|
|
|
|
|
// top: 38px;
|
|
|
|
|
// left: 0;
|
|
|
|
|
// height: 360px;
|
|
|
|
|
// font-size: 14px;
|
|
|
|
|
// color: #333333;
|
|
|
|
|
width: 100%;
|
|
|
|
|
height: 100%;
|
|
|
|
|
padding: 0 55px;
|
|
|
|
|
.tab-category-menu__left {
|
|
|
|
|
width: 190px;
|
|
|
|
|
padding: 30px 0 35px 0;
|
|
|
|
|
background: #ffffff;
|
|
|
|
|
width: 100%;
|
|
|
|
|
height: 100%;
|
|
|
|
|
.menu-left__item {
|
|
|
|
|
height: 36px;
|
|
|
|
|
height: 100%;
|
|
|
|
|
font-size: 16px;
|
|
|
|
|
font-weight: 400;
|
|
|
|
|
color: #333333;
|
|
|
|
|
position: relative;
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
padding: 0 24px 0 41px;
|
|
|
|
|
margin-top: 15px;
|
|
|
|
|
&:first-child {
|
|
|
|
|
margin-top: 0;
|
|
|
|
|
|
|
|
|
|
.menu-left__item--bottom {
|
|
|
|
|
width: 68px;
|
|
|
|
|
height: 3px;
|
|
|
|
|
background: #ff6a19;
|
|
|
|
|
position: absolute;
|
|
|
|
|
left: 50%;
|
|
|
|
|
bottom: 0;
|
|
|
|
|
transform: translateX(-50%);
|
|
|
|
|
display: none;
|
|
|
|
|
}
|
|
|
|
|
&:hover,
|
|
|
|
|
&--light {
|
|
|
|
|
color: #ff875b;
|
|
|
|
|
color: #ff6a19;
|
|
|
|
|
.tab-category-menu__right,
|
|
|
|
|
.menu-left__item--bottom {
|
|
|
|
|
display: flex;
|
|
|
|
|
}
|
|
|
|
|
img {
|
|
|
|
|
width: 20px;
|
|
|
|
|
height: 20px;
|
|
|
|
|
margin-right: 16px;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
.tab-category-menu__right {
|
|
|
|
|
padding: 30px 26px 35px 26px;
|
|
|
|
|
box-shadow: 7px 0px 10px 1px rgba(0, 0, 0, 0.1);
|
|
|
|
|
border: 1px solid #eeeeee;
|
|
|
|
|
position: absolute;
|
|
|
|
|
top: 90px;
|
|
|
|
|
left: -54px;
|
|
|
|
|
width: 350px;
|
|
|
|
|
padding: 25px 25px 9px;
|
|
|
|
|
background: #ffffff;
|
|
|
|
|
border-radius: 0 4px 4px 0;
|
|
|
|
|
.category-menu-right__wrap {
|
|
|
|
|
height: 36px;
|
|
|
|
|
margin-top: 15px;
|
|
|
|
|
line-height: 36px;
|
|
|
|
|
padding: 0 16px;
|
|
|
|
|
font-size: 12px;
|
|
|
|
|
color: #999999;
|
|
|
|
|
white-space: nowrap;
|
|
|
|
|
&:first-child {
|
|
|
|
|
margin-top: 0;
|
|
|
|
|
}
|
|
|
|
|
&:hover,
|
|
|
|
|
&--light {
|
|
|
|
|
background: #f8f8f8;
|
|
|
|
|
}
|
|
|
|
|
box-shadow: 0px 0px 40px 1px rgba(0, 0, 0, 0.1);
|
|
|
|
|
border-radius: 4px;
|
|
|
|
|
display: none;
|
|
|
|
|
|
|
|
|
|
.menu-right-wrap__item {
|
|
|
|
|
color: #999999;
|
|
|
|
|
margin-right: 20px;
|
|
|
|
|
width: 140px;
|
|
|
|
|
height: 40px;
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
color: #333;
|
|
|
|
|
margin-bottom: 16px;
|
|
|
|
|
img {
|
|
|
|
|
height: 40px;
|
|
|
|
|
width: 40px;
|
|
|
|
|
}
|
|
|
|
|
&:hover {
|
|
|
|
|
color: #ff875b;
|
|
|
|
|
}
|
|
|
|
@ -226,6 +236,5 @@ export default {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|