1. 第一次进入商品列表,商品分类未展示

2. 链接选择器,店铺开启状态展示错误
3. 从新装修楼层,楼层bug修改
4. 搜索热词为空是返回null,导致报错
5. 首页全部商品分类缓存问题
6. 修改菜单项缓存、添加设置
7. 店铺分类二级分类修改时无父级分类
This commit is contained in:
mabo
2021-08-04 17:07:39 +08:00
parent 483d8c3aef
commit 726ae1f856
15 changed files with 1383 additions and 486 deletions

View File

@@ -82,13 +82,17 @@ export default {
},
computed: {
promotionTags () {
return JSON.parse(this.$store.state.hotWordsList)
if (this.$store.state.hotWordsList) {
return JSON.parse(this.$store.state.hotWordsList)
} else {
return []
}
}
},
created () {
this.searchData = this.$route.query.keyword
if (!this.hover) { // 首页顶部固定搜索栏不调用热词接口
// 搜索热词每一小时请求一次
// 搜索热词每5分钟请求一次
const reloadTime = storage.getItem('hotWordsReloadTime')
const time = new Date().getTime() - 5 * 60 * 1000
if (!reloadTime) {

View File

@@ -81,10 +81,10 @@ export default {
},
data () {
return {
cateList: [], // 分类数据
panel: false, // 二级分类展示
panelData: [], // 二级分类数据
showFirstList: false // 始终展示一级列表
showFirstList: false, // 始终展示一级列表
cateList: [] // 商品分类
}
},
computed: {
@@ -98,6 +98,7 @@ export default {
getCategory(0).then(res => {
if (res.success) {
this.cateList = res.result;
this.$store.commit('SET_CATEGORY', res.result)
// 过期时间
var expirationTime = new Date().setHours(new Date().getHours() + 1);
// 存放过期时间

View File

@@ -183,10 +183,14 @@ export default {
multSelected: [], // 多选分类
selectedItem: [], // 已选分类集合 顶部展示
brandIds: [], // 品牌id合集
params: {}, // 请求参数
cateList: [] // 全部商品分类
params: {} // 请求参数
};
},
computed: {
cateList () { // 商品分类
return this.$store.state.category
}
},
watch: {
selectedItem: {
// 监听已选条件,来调用列表接口
@@ -228,8 +232,12 @@ export default {
methods: {
getNav () { // 获取商品分类,分类下展示
if (!this.$route.query.categoryId) return
this.cateList = JSON.parse(localStorage.getItem('category'))
if (!this.cateList.length) { // 商品分类存储在localstorage接口未调用成功前再次刷新数据
setTimeout(() => {
this.getNav()
}, 500)
return
}
const arr = this.$route.query.categoryId.split(',')
if (arr.length > 0) {
this.tabBar = this.cateList.filter(e => {
@@ -416,7 +424,7 @@ export default {
background: #fff;
border: 1px solid #999;
padding: 0 8px;
width: 85px;
min-width: 85px;
text-align: center;
margin: 0 3px;
&:hover {

View File

@@ -81,10 +81,10 @@ export default {
},
data () {
return {
cateList: [], // 分类数据
panel: false, // 二级分类展示
panelData: [], // 二级分类数据
showFirstList: false // 始终展示一级列表
showFirstList: false, // 始终展示一级列表
cateList: [] // 商品分类
}
},
computed: {
@@ -98,6 +98,7 @@ export default {
getCategory(0).then(res => {
if (res.success) {
this.cateList = res.result;
this.$store.commit('SET_CATEGORY', res.result)
// 过期时间
var expirationTime = new Date().setHours(new Date().getHours() + 1);
// 存放过期时间

View File

@@ -3,7 +3,6 @@
<drawer></drawer>
<!-- 固定头部 -->
<hover-search class="hover-search" :class="{show: topSearchShow}"></hover-search>
<!-- 顶部广告 -->
<FixedTopPage :data="topAdvert"></FixedTopPage>
<!-- 头部 包括登录我的订单等 -->

View File

@@ -34,7 +34,7 @@
{{item.grade==='GOOD'?'好评' : item.grade === 'WORSE'?'差评' : '中评'}}
</i-col>
<i-col span="4">
<Tooltip >
<Tooltip transfer>
<div class="content">{{item.content}}</div>
<div style="white-space: normal;" slot="content">
{{item.content}}

View File

@@ -9,11 +9,11 @@ Vue.use(Vuex);
export default new Vuex.Store({
state: {
category: [], // 全部分类
navList: [], // 首页快捷导航
cartNum: storage.getItem('cartNum') || 0,
logoImg: require('@/assets/images/logo2.png'),
hotWordsList: storage.getItem('hotWordsList') || []
hotWordsList: storage.getItem('hotWordsList'),
category: localStorage.getItem('category')
},
getters,
actions,