|
|
|
@ -1,81 +1,85 @@
|
|
|
|
|
<template>
|
|
|
|
|
<div class="default-header">
|
|
|
|
|
<div class="default-header-box">
|
|
|
|
|
<div class="default-header-box__wrap flex flex-between flex-middle">
|
|
|
|
|
<img
|
|
|
|
|
class="header-box-wrap__logo"
|
|
|
|
|
src="@/static/images/layout/logo.png"
|
|
|
|
|
/>
|
|
|
|
|
<div class="header-box-wrap__right flex flex-middle">
|
|
|
|
|
<div class="box-wrap-right__search flex">
|
|
|
|
|
<div class="search-input">
|
|
|
|
|
<el-input
|
|
|
|
|
v-model="searchContent"
|
|
|
|
|
placeholder="请输入商品名称"
|
|
|
|
|
></el-input>
|
|
|
|
|
<div>
|
|
|
|
|
<HeaderInfoBar />
|
|
|
|
|
<div class="default-header">
|
|
|
|
|
<div class="default-header-box">
|
|
|
|
|
<div class="default-header-box__wrap flex flex-between flex-middle">
|
|
|
|
|
<img
|
|
|
|
|
class="header-box-wrap__logo"
|
|
|
|
|
src="@/static/images/layout/logo.png"
|
|
|
|
|
/>
|
|
|
|
|
<div class="header-box-wrap__right flex flex-middle">
|
|
|
|
|
<div class="box-wrap-right__search flex">
|
|
|
|
|
<div class="search-input">
|
|
|
|
|
<el-input
|
|
|
|
|
v-model="searchContent"
|
|
|
|
|
placeholder="请输入商品名称"
|
|
|
|
|
></el-input>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="search-icon flex flex-center flex-middle">
|
|
|
|
|
<img src="@/static/images/layout/icon-search.png" />
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="search-icon flex flex-center flex-middle">
|
|
|
|
|
<img src="@/static/images/layout/icon-search.png" />
|
|
|
|
|
<div class="box-wrap-right__cart flex flex-middle">
|
|
|
|
|
<img src="@/static/images/layout/icon-shop.png" />
|
|
|
|
|
<span>购物车</span>
|
|
|
|
|
<div class="wrap-right-cart__tip">3</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="box-wrap-right__cart flex flex-middle">
|
|
|
|
|
<img src="@/static/images/layout/icon-shop.png" />
|
|
|
|
|
<span>购物车</span>
|
|
|
|
|
<div class="wrap-right-cart__tip">3</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="default-header-box__tab flex flex-middle">
|
|
|
|
|
<div class="header-box-tab__category">
|
|
|
|
|
<div class="tab-category__label flex flex-center flex-middle">
|
|
|
|
|
<img src="@/static/images/layout/icon-category.png" />
|
|
|
|
|
<span>热门分类</span>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="tab-category__menu flex flex-left">
|
|
|
|
|
<div class="tab-category-menu__left">
|
|
|
|
|
<div
|
|
|
|
|
v-for="item in categrayData"
|
|
|
|
|
:key="item.id"
|
|
|
|
|
@mouseenter="handleMouEnter(item.id)"
|
|
|
|
|
@mouseleave="categrayHoverVisible = false"
|
|
|
|
|
class="menu-left__item flex felx-middle"
|
|
|
|
|
>
|
|
|
|
|
<img />
|
|
|
|
|
<span>{{ item.name }}</span>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="default-header-box__tab flex flex-middle">
|
|
|
|
|
<div class="header-box-tab__category">
|
|
|
|
|
<div class="tab-category__label flex flex-center flex-middle">
|
|
|
|
|
<img src="@/static/images/layout/icon-category.png" />
|
|
|
|
|
<span>热门分类</span>
|
|
|
|
|
</div>
|
|
|
|
|
<div v-show="categrayHoverVisible">
|
|
|
|
|
<div
|
|
|
|
|
class="tab-category-menu__right flex flex-wrap"
|
|
|
|
|
@mouseenter="categrayHoverVisible = true"
|
|
|
|
|
>
|
|
|
|
|
<div class="tab-category__menu flex flex-left">
|
|
|
|
|
<div class="tab-category-menu__left">
|
|
|
|
|
<div
|
|
|
|
|
v-for="item in currentCategrayList"
|
|
|
|
|
v-for="item in categrayData"
|
|
|
|
|
:key="item.id"
|
|
|
|
|
class="menu-right__item"
|
|
|
|
|
@mouseenter="handleMouEnter(item.id)"
|
|
|
|
|
@mouseleave="categrayHoverVisible = false"
|
|
|
|
|
class="menu-left__item flex felx-middle"
|
|
|
|
|
>
|
|
|
|
|
<img />
|
|
|
|
|
<span>{{ item.name }}</span>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div v-show="categrayHoverVisible">
|
|
|
|
|
<div
|
|
|
|
|
class="tab-category-menu__right flex flex-wrap"
|
|
|
|
|
@mouseenter="categrayHoverVisible = true"
|
|
|
|
|
>
|
|
|
|
|
{{ item.name }}
|
|
|
|
|
<div
|
|
|
|
|
v-for="item in currentCategrayList"
|
|
|
|
|
:key="item.id"
|
|
|
|
|
class="menu-right__item"
|
|
|
|
|
>
|
|
|
|
|
{{ item.name }}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div
|
|
|
|
|
v-for="item in tabList"
|
|
|
|
|
:key="item.value"
|
|
|
|
|
class="header-box-tab__common flex flex-center flex-middle"
|
|
|
|
|
:class="{
|
|
|
|
|
'header-box-tab__common--light': item.value === activityTab,
|
|
|
|
|
}"
|
|
|
|
|
@click="onTabClick(item)"
|
|
|
|
|
>
|
|
|
|
|
{{ item.label }}
|
|
|
|
|
<nuxt-link
|
|
|
|
|
v-for="item in tabList"
|
|
|
|
|
:key="item.value"
|
|
|
|
|
class="header-box-tab__common flex flex-center flex-middle"
|
|
|
|
|
:class="{
|
|
|
|
|
'header-box-tab__common--light': item.path === $nuxt.$route.path,
|
|
|
|
|
}"
|
|
|
|
|
:to="item.path"
|
|
|
|
|
>
|
|
|
|
|
{{ item.label }}
|
|
|
|
|
</nuxt-link>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<script>
|
|
|
|
|
import HeaderInfoBar from "./HeaderInfoBar.vue";
|
|
|
|
|
import {
|
|
|
|
|
ApiGetCategoryOneList,
|
|
|
|
|
ApiGetCategoryTwoAndGoods,
|
|
|
|
@ -89,14 +93,15 @@ const TAB_TYPE = {
|
|
|
|
|
};
|
|
|
|
|
export default {
|
|
|
|
|
name: "DefaultHeader",
|
|
|
|
|
components: { HeaderInfoBar },
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
searchContent: "",
|
|
|
|
|
activityTab: TAB_TYPE.HOME,
|
|
|
|
|
tabList: [
|
|
|
|
|
{ label: "首页", value: TAB_TYPE.HOME, path: "/" },
|
|
|
|
|
{ label: "爆款推荐", value: TAB_TYPE.RECOMMEND, path: "/" },
|
|
|
|
|
{ label: "开发书籍", value: TAB_TYPE.BOOK, path: "/" },
|
|
|
|
|
{ label: "爆款推荐", value: TAB_TYPE.RECOMMEND, path: "/hot" },
|
|
|
|
|
{ label: "开发书籍", value: TAB_TYPE.BOOK, path: "/book" },
|
|
|
|
|
{ label: "限时秒杀", value: TAB_TYPE.TIME_LIMIT, path: "/skill" },
|
|
|
|
|
],
|
|
|
|
|
categrayData: [],
|
|
|
|
@ -139,15 +144,6 @@ export default {
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
onTabClick(tab) {
|
|
|
|
|
if (this.activityTab === tab.value) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
this.activityTab = tab.value;
|
|
|
|
|
this.$router.push({
|
|
|
|
|
path: tab.path,
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
</script>
|
|
|
|
@ -164,6 +160,7 @@ export default {
|
|
|
|
|
height: 42px;
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
margin-bottom: 38px;
|
|
|
|
|
padding-right: 50px;
|
|
|
|
|
.header-box-wrap__logo {
|
|
|
|
|
width: 244px;
|
|
|
|
|
height: 100%;
|