micro_mall_xcx/pages/goods/category/index.js
2023-08-06 16:39:33 +08:00

29 lines
546 B
JavaScript

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);
},
});