feat:完成首页、分类页内容管理功能开发
This commit is contained in:
@@ -67,6 +67,17 @@ Page({
|
||||
scrollIntoViewId: '',
|
||||
},
|
||||
|
||||
onLoad(options: Record<string, string>) {
|
||||
const id = options.id;
|
||||
if (id && id !== 'all') {
|
||||
const items = getItemsByCategory(id);
|
||||
this.setData({
|
||||
activeCategoryId: id,
|
||||
displayItems: items,
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
onTapCategory(e: WechatMiniprogram.TouchEvent) {
|
||||
const id = e.currentTarget.dataset.id as string;
|
||||
if (!id || id === this.data.activeCategoryId) return;
|
||||
|
||||
Reference in New Issue
Block a user