diff --git a/pages/peanut/home.vue b/pages/peanut/home.vue index 0822807..e9936ac 100644 --- a/pages/peanut/home.vue +++ b/pages/peanut/home.vue @@ -642,11 +642,16 @@ export default { //存储的需要固定分类 this.fixed = uni.getStorageSync("fixed"); //固定分类 - if (this.fixed) { - this.curseClick(this.currentItem, this.currentIndex); - } else { + if (this.currentIndex === null || this.currentIndex === undefined) { this.currentIndex = 0; - this.currentItem = null; + } + if ( + this.fixed && + this.currentItem && + this.currentIndex !== null && + this.currentIndex !== undefined + ) { + this.curseClick(this.currentItem, this.currentIndex); } uni.hideTabBar(); // #ifdef APP-PLUS