buyer端的导航条下拉

master
pikachu 2022-04-12 18:03:31 +08:00
parent df408e640a
commit 9e0a681e01
1 changed files with 20 additions and 3 deletions

View File

@ -3,7 +3,7 @@
<div class="nav-con"> <div class="nav-con">
<div <div
class="all-categories hover-pointer" class="all-categories hover-pointer"
@mouseenter="showFirstList = true" @mouseenter="showFirstLists"
@mouseleave="showFirstList = false" @mouseleave="showFirstList = false"
> >
全部商品分类 全部商品分类
@ -16,6 +16,7 @@
@click="linkTo(item.url)" @click="linkTo(item.url)"
> >
{{ item.name }} {{ item.name }}
<!-- {{item}} -->
</li> </li>
</ul> </ul>
</div> </div>
@ -62,9 +63,9 @@
@mouseleave="panel = false" @mouseleave="panel = false"
> >
<div class="nav-detail-item"> <div class="nav-detail-item">
<template v-for="(item, index) in panelData"> <template v-for="(item,index) in panelData">
<span <span
@click="goGoodsList(item.id, item.parentId)" @click="goGoodsList(item.id,item.parentId)"
v-if="index < 8" v-if="index < 8"
:key="index" :key="index"
>{{ item.name }}<Icon type="ios-arrow-forward" >{{ item.name }}<Icon type="ios-arrow-forward"
@ -150,6 +151,22 @@ export default {
}, },
}, },
methods: { methods: {
showFirstLists(){
this.showFirstList = true;
if(
localStorage.getItem("category") &&
localStorage.getItem("category_expiration_time")
) {
// this.getCate();
//
if (new Date() > localStorage.getItem("category_expiration_time")) {
this.getCate();
return;
}
this.cateList = JSON.parse(localStorage.getItem("category"));
// this.$Message.info(cateList)
}
},
getCate() { getCate() {
// //
if (this.hover) return false; if (this.hover) return false;