diff --git a/pages/index/index.vue b/pages/index/index.vue index 209d6bc..df8b372 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -183,13 +183,21 @@ } }) }, - getGoods: function() { + getGoods: function(item) { graphicLstApi(this.where).then(res => { this.cateGoods.push(...res.data.list) - if (res.data.list.length < this.where.limit) { - this.status = 'nomore' - } + if (res.data.list.length < this.where.limit) this.status = 'nomore' if (this.where.page == 1 && res.data.list.length <= 0) this.emptyShow = true + if (item.index == 1) { + uni.navigateTo({ + // #ifdef MP || H5 + url: '/pages/short_video/nvueSwiper/index?id=' + this.cateGoods[0].community_id + // #endif + // #ifdef APP + url: `/pages/short_video/appSwiper/index?id=${this.cateGoods[0].community_id}` + // #endif + }) + } }) }, /*获取分类列表*/ @@ -208,19 +216,10 @@ this.cateGoods = [] this.where.category_id = item.category_id this.where.page = 1 - this.getGoods() + this.getGoods(item) this.street_id = item.id this.tabsData.tabsActive = item.index - if (item.index == 1) { - uni.navigateTo({ - // #ifdef MP || H5 - url: '/pages/short_video/nvueSwiper/index?id=' + this.cateGoods[0].community_id - // #endif - // #ifdef APP - url: `/pages/short_video/appSwiper/index?id=${this.cateGoods[0].community_id}` - // #endif - }) - } + }, selfLocation() { const that = this