|
|
@ -255,18 +255,17 @@ |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
async loadStudentInfo() { |
|
|
async loadStudentInfo() { |
|
|
try { |
|
|
try { |
|
|
// 模拟获取学员信息 |
|
|
// 调用真实API获取学员信息 |
|
|
const mockStudentInfo = { |
|
|
const response = await apiRoute.getStudentSummary(this.studentId) |
|
|
id: this.studentId, |
|
|
if (response.code === 1) { |
|
|
name: '小明', |
|
|
this.studentInfo = response.data |
|
|
remaining_courses: 24, |
|
|
} else { |
|
|
total_courses: 48 |
|
|
console.error('获取学员信息失败:', response) |
|
|
} |
|
|
} |
|
|
this.studentInfo = mockStudentInfo |
|
|
} catch (error) { |
|
|
} catch (error) { |
|
|
console.error('获取学员信息失败:', error) |
|
|
console.error('获取学员信息失败:', error) |
|
|
} |
|
|
} |
|
|
|
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
generateDateList() { |
|
|
generateDateList() { |
|
|
@ -365,7 +364,17 @@ |
|
|
|
|
|
|
|
|
async loadMyBookings() { |
|
|
async loadMyBookings() { |
|
|
try { |
|
|
try { |
|
|
console.log('加载我的预约') |
|
|
console.log('加载我的预约, studentId:', this.studentId) |
|
|
|
|
|
|
|
|
|
|
|
// 验证studentId |
|
|
|
|
|
if (!this.studentId || this.studentId <= 0) { |
|
|
|
|
|
console.error('无效的studentId:', this.studentId) |
|
|
|
|
|
uni.showToast({ |
|
|
|
|
|
title: '学员ID无效', |
|
|
|
|
|
icon: 'none' |
|
|
|
|
|
}) |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// 调用真实API |
|
|
// 调用真实API |
|
|
const response = await apiRoute.getMyBookingList({ |
|
|
const response = await apiRoute.getMyBookingList({ |
|
|
|