Parcourir la source

fix: 边界判断

joe il y a 4 ans
Parent
commit
751f223b56
1 fichiers modifiés avec 2 ajouts et 1 suppressions
  1. 2 1
      view/xcx/pages/index/index.js

+ 2 - 1
view/xcx/pages/index/index.js

@@ -385,7 +385,7 @@ Page({
     // },
 
     get_product_list: function (tabIndex, isReload) {
-        if (tabIndex <= 0 || tabIndex >= this.data.prodCates.children.length) {
+        if (tabIndex <= 0 || tabIndex > this.data.prodCates.children.length) {
             return
         }
         let cid = this.data.prodCates.id
@@ -439,6 +439,7 @@ Page({
             act.loaded = list.length < PAGE_LIMIT
             act.loading = false
             act.loadTitle = act.loaded ? '已全部加载' : '加载更多'
+            act.page += 1
             that.setData({
                 [`prodCates.children[${cindex}].loaded`]: act.loaded,
                 [`prodCates.children[${cindex}].loading`]: false,