Browse Source

fix: 边界判断

joe 4 năm trước cách đây
mục cha
commit
751f223b56
1 tập tin đã thay đổi với 2 bổ sung1 xóa
  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,