|
|
@ -58,15 +58,21 @@
|
|
|
|
placeholder="请输入商品名称"
|
|
|
|
placeholder="请输入商品名称"
|
|
|
|
></el-input>
|
|
|
|
></el-input>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="search-icon flex flex-center flex-middle">
|
|
|
|
<div
|
|
|
|
|
|
|
|
class="search-icon flex flex-center flex-middle"
|
|
|
|
|
|
|
|
@click="onSearch"
|
|
|
|
|
|
|
|
>
|
|
|
|
<img src="@/static/images/layout/icon-search.png" />
|
|
|
|
<img src="@/static/images/layout/icon-search.png" />
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="box-wrap-right__cart flex flex-middle">
|
|
|
|
<nuxt-link
|
|
|
|
|
|
|
|
class="box-wrap-right__cart flex flex-middle"
|
|
|
|
|
|
|
|
to="/cart"
|
|
|
|
|
|
|
|
>
|
|
|
|
<img src="@/static/images/layout/icon-shop.png" />
|
|
|
|
<img src="@/static/images/layout/icon-shop.png" />
|
|
|
|
<span>购物车</span>
|
|
|
|
<span>购物车</span>
|
|
|
|
<div class="wrap-right-cart__tip">3</div>
|
|
|
|
<div class="wrap-right-cart__tip">3</div>
|
|
|
|
</div>
|
|
|
|
</nuxt-link>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="bar-header-box__tab flex flex-middle">
|
|
|
|
<div class="bar-header-box__tab flex flex-middle">
|
|
|
@ -91,7 +97,7 @@
|
|
|
|
<div
|
|
|
|
<div
|
|
|
|
v-for="item in categrayData"
|
|
|
|
v-for="item in categrayData"
|
|
|
|
:key="item.id"
|
|
|
|
:key="item.id"
|
|
|
|
@mouseenter="handleCategoSelect(item.id)"
|
|
|
|
@mouseenter="handleCategorySelect(item.id)"
|
|
|
|
class="menu-left__item flex flex-middle"
|
|
|
|
class="menu-left__item flex flex-middle"
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<img />
|
|
|
|
<img />
|
|
|
@ -107,24 +113,25 @@
|
|
|
|
v-for="item in currentCategrayList"
|
|
|
|
v-for="item in currentCategrayList"
|
|
|
|
:key="item.id"
|
|
|
|
:key="item.id"
|
|
|
|
class="menu-right__item"
|
|
|
|
class="menu-right__item"
|
|
|
|
|
|
|
|
@click="onCateogryTwoClick(item)"
|
|
|
|
>
|
|
|
|
>
|
|
|
|
{{ item.name }}
|
|
|
|
{{ item.name }}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<nuxt-link
|
|
|
|
<div
|
|
|
|
v-for="item in tabList"
|
|
|
|
v-for="item in tabList"
|
|
|
|
:key="item.value"
|
|
|
|
:key="item.value"
|
|
|
|
class="header-box-tab__common flex flex-center flex-middle"
|
|
|
|
class="header-box-tab__common flex flex-center flex-middle"
|
|
|
|
:class="{
|
|
|
|
:class="{
|
|
|
|
'header-box-tab__common--light':
|
|
|
|
'header-box-tab__common--light':
|
|
|
|
item.value === $nuxt.$route.path,
|
|
|
|
item.value === $nuxt.$route.fullPath,
|
|
|
|
}"
|
|
|
|
}"
|
|
|
|
:to="item.value"
|
|
|
|
@click="onTabSelect(item)"
|
|
|
|
>
|
|
|
|
>
|
|
|
|
{{ item.label }}
|
|
|
|
{{ item.label }}
|
|
|
|
</nuxt-link>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
@ -167,9 +174,9 @@ export default {
|
|
|
|
tabPath: "/",
|
|
|
|
tabPath: "/",
|
|
|
|
tabList: [
|
|
|
|
tabList: [
|
|
|
|
{ label: "首页", value: "/" },
|
|
|
|
{ label: "首页", value: "/" },
|
|
|
|
{ label: "爆款推荐", value: "/hot" },
|
|
|
|
{ label: "爆款推荐", value: "/goods/list?id=1" },
|
|
|
|
{ label: "开发书籍", value: "/book" },
|
|
|
|
{ label: "开发书籍", value: "/goods/list?id=2" },
|
|
|
|
{ label: "限时秒杀", value: "/skill" },
|
|
|
|
{ label: "限时秒杀", value: "/sckill" },
|
|
|
|
],
|
|
|
|
],
|
|
|
|
categroyTwoVisible: false, // 是否展示二级分类
|
|
|
|
categroyTwoVisible: false, // 是否展示二级分类
|
|
|
|
categroyVisible: false, // 是否展示一级分类
|
|
|
|
categroyVisible: false, // 是否展示一级分类
|
|
|
@ -194,9 +201,13 @@ export default {
|
|
|
|
this.$isLoginValidate();
|
|
|
|
this.$isLoginValidate();
|
|
|
|
},
|
|
|
|
},
|
|
|
|
// 一级分类选中
|
|
|
|
// 一级分类选中
|
|
|
|
handleCategoSelect(id) {
|
|
|
|
handleCategorySelect(id) {
|
|
|
|
this.currentCategrayId = id;
|
|
|
|
this.currentCategrayId = id;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
// 二级分类点击
|
|
|
|
|
|
|
|
onCateogryTwoClick() {
|
|
|
|
|
|
|
|
this.$router.push("/goods/list");
|
|
|
|
|
|
|
|
},
|
|
|
|
// 一级分类是否可见
|
|
|
|
// 一级分类是否可见
|
|
|
|
handleCategoryChange(val) {
|
|
|
|
handleCategoryChange(val) {
|
|
|
|
this.categroyVisible = val;
|
|
|
|
this.categroyVisible = val;
|
|
|
@ -208,6 +219,10 @@ export default {
|
|
|
|
handleTabSelect(path) {
|
|
|
|
handleTabSelect(path) {
|
|
|
|
this.$router.push({ path });
|
|
|
|
this.$router.push({ path });
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
onTabSelect({ value }) {
|
|
|
|
|
|
|
|
this.tabPath = value;
|
|
|
|
|
|
|
|
this.$router.push({ path: value });
|
|
|
|
|
|
|
|
},
|
|
|
|
// 获取热门分类信息
|
|
|
|
// 获取热门分类信息
|
|
|
|
async getCategroyData() {
|
|
|
|
async getCategroyData() {
|
|
|
|
const { result } = await ApiGetCategoryOneList();
|
|
|
|
const { result } = await ApiGetCategoryOneList();
|
|
|
@ -227,6 +242,10 @@ export default {
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
onSearch() {
|
|
|
|
|
|
|
|
// 储存搜索内容
|
|
|
|
|
|
|
|
this.$router.push("/goods/list");
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
</script>
|
|
|
|