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.

101 lines
3.1 KiB

2 months ago
const app = getApp<IAppOption>()
Page({
data: {
2 weeks ago
statusBarHeight: 44,
activeTab: 0,
navItems: [
{ type: 'schedule', label: '智能课表', icon: '/images/icon_schedule.png' },
{ type: 'bus', label: '校园巴士', icon: '/images/icon_bus.png' },
{ type: 'race', label: '活动报名', icon: '/images/icon_race.png' },
{ type: 'ai', label: 'AI辅导员', icon: '/images/icon_ai.png' },
],
tabList: [
{ label: '首页', icon: '/images/icon_home_active.png' },
{ label: '活动', icon: '/images/icon_calendar.png' },
{ label: '智能体', icon: '/images/icon_ai.png' },
{ label: '通知', icon: '/images/icon_bell.png' },
{ label: '我的', icon: '/images/icon_user.png' },
],
recommendAgents: [
{ id: 'ppt', name: 'PPT小助手', icon: '/images/agent_ppt.png', bgImage: '/images/activity_1.png' },
{ id: 'ielts', name: '雅思模拟考官', icon: '/images/agent_ielts.png', bgImage: '/images/activity_2.png' },
{ id: 'pdf', name: 'PDF翻译', icon: '/images/agent_pdf.png', bgImage: '/images/activity_3.png' },
],
recommendActivities: [
{
id: '3',
title: '英语角交流活动',
desc: '提升口语能力',
time: '活动时间:2026-04-01~2026-05-30',
image: '/images/activity_1.png',
},
{
id: '4',
title: '大学生创业项目大赛',
desc: '提升创新能力',
time: '活动时间:2026-04-01~2026-05-30',
image: '/images/activity_2.png',
},
],
hotActivities: [
{
id: '1',
title: '计算机学院编程大赛',
image: '/images/activity_1.png',
deadline: '截止日期:2026年5月30日',
},
{
id: '2',
title: '创新创业项目路演',
image: '/images/activity_2.png',
deadline: '截止日期:2026年6月15日',
},
],
2 months ago
},
2 weeks ago
2 months ago
onLoad() {
2 weeks ago
const sysInfo = wx.getSystemInfoSync()
this.setData({ statusBarHeight: sysInfo.statusBarHeight || 44 })
2 months ago
app.waitLogin()
},
2 weeks ago
onSearchTap() {
wx.showToast({ title: '搜索功能开发中', icon: 'none' })
},
onNavTap(e: WechatMiniprogram.TouchEvent) {
const type = e.currentTarget.dataset.type
wx.showToast({ title: `${type}功能开发中`, icon: 'none' })
},
onAnnounceTap() {
wx.showToast({ title: '公告详情开发中', icon: 'none' })
},
onMoreAgentsTap() {
wx.showToast({ title: '更多智能体开发中', icon: 'none' })
},
onAgentTap(e: WechatMiniprogram.TouchEvent) {
const id = e.currentTarget.dataset.id
wx.navigateTo({ url: `/pages/agent/index?id=${id}` })
},
onActivityTap(e: WechatMiniprogram.TouchEvent) {
const id = e.currentTarget.dataset.id
wx.navigateTo({ url: `/pages/activity-detail/index?id=${id}` })
},
onTabTap(e: WechatMiniprogram.TouchEvent) {
const index = e.currentTarget.dataset.index
if (index === this.data.activeTab) return
this.setData({ activeTab: index })
if (index === 4) {
wx.switchTab({ url: '/pages/my/index' })
}
},
2 months ago
})
export {}