浏览代码

fix[litemall-wx]: 从id是L1分类id时,分类商品信息应该重新设置该L1分类的子分类id

Junling Bu 7 年之前
父节点
当前提交
3bd0520012
共有 1 个文件被更改,包括 7 次插入0 次删除
  1. 7 0
      litemall-wx/pages/category/category.js

+ 7 - 0
litemall-wx/pages/category/category.js

@@ -49,6 +49,13 @@ Page({
             title: res.data.parentCategory.name
             title: res.data.parentCategory.name
           })
           })
 
 
+          // 当id是L1分类id时,这里需要重新设置成L1分类的一个子分类的id
+          if (res.data.parentCategory.id == that.data.id) {
+            that.setData({
+              id: res.data.currentCategory.id
+            });
+          }
+
           //nav位置
           //nav位置
           let currentIndex = 0;
           let currentIndex = 0;
           let navListCount = that.data.navList.length;
           let navListCount = that.data.navList.length;