1
This commit is contained in:
86
pages/tools/tools.js
Normal file
86
pages/tools/tools.js
Normal file
@@ -0,0 +1,86 @@
|
||||
// pages/tools/tools.js
|
||||
const learningTracker = require('../../utils/learningTracker.js')
|
||||
|
||||
Page({
|
||||
data: {
|
||||
tools: [
|
||||
{
|
||||
id: 1,
|
||||
name: '启思AI',
|
||||
icon: '🤖',
|
||||
desc: '启迪思维,智慧学习',
|
||||
path: '/pages/ai-assistant/ai-assistant',
|
||||
color: '#6C5CE7',
|
||||
badge: 'AI',
|
||||
badgeColor: '#A29BFE'
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
name: '学习数据',
|
||||
icon: '📊',
|
||||
desc: '可视化数据分析',
|
||||
path: '/pages/dashboard/dashboard',
|
||||
color: '#667eea',
|
||||
badge: 'NEW',
|
||||
badgeColor: '#4CAF50'
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
name: 'GPA计算器',
|
||||
icon: '🎯',
|
||||
desc: '快速计算学期绩点',
|
||||
path: '/pages/gpa/gpa',
|
||||
color: '#FF6B6B'
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
name: '课程表',
|
||||
icon: '📅',
|
||||
desc: '查看个人课程安排',
|
||||
path: '/pages/schedule/schedule',
|
||||
color: '#9B59B6'
|
||||
},
|
||||
{
|
||||
id: 5,
|
||||
name: '考试倒计时',
|
||||
icon: '⏰',
|
||||
desc: '重要考试提醒',
|
||||
path: '/pages/countdown/countdown',
|
||||
color: '#F39C12'
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
onLoad() {
|
||||
|
||||
},
|
||||
|
||||
onShow() {
|
||||
// 开始跟踪学习时间
|
||||
learningTracker.onPageShow('tools')
|
||||
|
||||
// 更新自定义TabBar选中状态
|
||||
if (typeof this.getTabBar === 'function' && this.getTabBar()) {
|
||||
this.getTabBar().setData({
|
||||
selected: 3
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
onHide() {
|
||||
// 停止跟踪学习时间
|
||||
learningTracker.onPageHide()
|
||||
},
|
||||
|
||||
onUnload() {
|
||||
// 记录学习时长
|
||||
learningTracker.onPageUnload()
|
||||
},
|
||||
|
||||
onToolClick(e) {
|
||||
const { path } = e.currentTarget.dataset
|
||||
wx.navigateTo({
|
||||
url: path
|
||||
})
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user