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