You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
732 B

Page({
data: {
activities: []
},
onLoad() {
this.fetchActivities();
},
fetchActivities() {
// 这里应该从后端 API 获取活动列表
const mockActivities = [
{ id: 1, name: '软件工程课程', participants: 50 },
{ id: 2, name: '数据结构讨论', participants: 30 }
];
this.setData({ activities: mockActivities });
},
onSearch(e) {
const keyword = e.detail.value;
// 实现搜索逻辑
},
goToCreateActivity() {
wx.navigateTo({ url: '/pages/createActivity/createActivity' });
},
goToActivityDetail(e) {
const activityId = e.currentTarget.dataset.id;
wx.navigateTo({ url: `/pages/activityDetail/activityDetail?id=${activityId}` });
}
});