import { getGoodsCategoryTreeList } from '../../../services/good/fetchCategoryList';
Page({
  data: {
    list: [],
  },
  async init() {
    try {
      const result = await getGoodsCategoryTreeList();
      this.setData({
        list: result,
      });
    } catch (error) {
      console.error('err:', error);
    }
  },

  onShow() {
    this.getTabBar().init();
  },
  onChange(e) {
    wx.navigateTo({
      url: '/pages/goods/list/index?goodsCategoryGuid=' + e.detail.item.groupId,
    });
  },
  onLoad() {
    this.init(true);
  },
});
