// pages/studentHomePage/studentHomePage.js Page({ data: { studentId: '', name: '' }, onLoad: function(options) { const studentId = decodeURIComponent(options.studentId || ''); const name = decodeURIComponent(options.name || ''); // 将学号转换为数字类型 const numStudentId = Number(studentId) || ''; // 更新页面数据 this.setData({ studentId: numStudentId, name: name }); }, myPoints: function() { const { studentId, name } = this.data; wx.navigateTo({ url: '/pages/mypoint/mypoint?studentId=' + encodeURIComponent(studentId) + '&name=' + encodeURIComponent(name) }); }, goBack: function() { wx.navigateTo({ url:'/pages/index/index' //返回登录界面 }); }, showRulesList: function() { // 跳转到特殊规则总览页面 wx.navigateTo({ url: '/pages/RulesList/RulesList' // 假设特殊规则总览页面的路径 }); } });