28 changed files with 2594 additions and 1049 deletions
@ -1,14 +1,18 @@ |
|||||
<?php |
<?php |
||||
// 全局中间件定义文件 |
// 全局中间件定义文件 |
||||
|
use app\adminapi\middleware\AllowCrossDomain; |
||||
use think\middleware\LoadLangPack; |
use think\middleware\LoadLangPack; |
||||
|
use think\app\MultiApp; |
||||
|
|
||||
return [ |
return [ |
||||
|
// 多应用模式 |
||||
|
MultiApp::class, |
||||
// 全局请求缓存 |
// 全局请求缓存 |
||||
// \think\middleware\CheckRequestCache::class, |
// \think\middleware\CheckRequestCache::class, |
||||
// 多语言加载 |
// 多语言加载 |
||||
LoadLangPack::class, |
LoadLangPack::class, |
||||
//跨域请求中间件 |
//跨域请求中间件 |
||||
// AllowCrossDomain::class, |
AllowCrossDomain::class, |
||||
// Session初始化 |
// Session初始化 |
||||
// \think\middleware\SessionInit::class |
// \think\middleware\SessionInit::class |
||||
]; |
]; |
||||
|
|||||
@ -0,0 +1,24 @@ |
|||||
|
#!/bin/bash |
||||
|
# start-claude-v2ray.sh |
||||
|
|
||||
|
echo "检查 V2Ray 是否运行..." |
||||
|
if ! pgrep -x "v2ray" > /dev/null; then |
||||
|
echo "启动 V2Ray..." |
||||
|
nohup v2ray run -config config.json > /tmp/v2ray.log 2>&1 & |
||||
|
sleep 3 |
||||
|
fi |
||||
|
|
||||
|
echo "设置代理: 127.0.0.1:1087" |
||||
|
export HTTP_PROXY=http://127.0.0.1:1087 |
||||
|
export HTTPS_PROXY=http://127.0.0.1:1087 |
||||
|
|
||||
|
# 测试连接 |
||||
|
echo "测试代理连接..." |
||||
|
if curl --proxy $HTTP_PROXY --max-time 10 -s https://api.anthropic.com > /dev/null; then |
||||
|
echo "✅ 代理连接正常" |
||||
|
echo "启动 Claude Code..." |
||||
|
claude |
||||
|
else |
||||
|
echo "❌ 代理连接失败,请检查 V2Ray 配置" |
||||
|
exit 1 |
||||
|
fi |
||||
@ -1,355 +1,379 @@ |
|||||
<template> |
<template> |
||||
<fui-modal |
<fui-modal :show="visible" title="课程安排详情" width="700" @cancel="closePopup" :buttons="[]"> |
||||
:show="visible" |
<view class="schedule-detail" v-if="scheduleInfo"> |
||||
title="课程安排详情" |
<!-- 课程基本信息 --> |
||||
width="700" |
<view class="section basic-info"> |
||||
@cancel="closePopup" |
<view class="section-title">基本信息</view> |
||||
:buttons="[]" |
<view class="info-item"> |
||||
> |
<text class="item-label">课程名称:</text> |
||||
<view class="schedule-detail" v-if="scheduleInfo"> |
<text class="item-value">{{ scheduleInfo.course_name }}</text> |
||||
<!-- 课程基本信息 --> |
</view> |
||||
<view class="section basic-info"> |
<view class="info-item"> |
||||
<view class="section-title">基本信息</view> |
<text class="item-label">上课时间:</text> |
||||
<view class="info-item"> |
<text class="item-value">{{ scheduleInfo.course_date }} {{ scheduleInfo.time_slot }}</text> |
||||
<text class="item-label">课程名称:</text> |
</view> |
||||
<text class="item-value">{{ scheduleInfo.course_name }}</text> |
<view class="info-item"> |
||||
</view> |
<text class="item-label">上课地点:</text> |
||||
<view class="info-item"> |
<text class="item-value">{{ scheduleInfo.venue_name }}</text> |
||||
<text class="item-label">上课时间:</text> |
</view> |
||||
<text class="item-value">{{ scheduleInfo.course_date }} {{ scheduleInfo.time_slot }}</text> |
<view class="info-item"> |
||||
</view> |
<text class="item-label">授课教练:</text> |
||||
<view class="info-item"> |
<text class="item-value">{{ scheduleInfo.coach_name }}</text> |
||||
<text class="item-label">上课地点:</text> |
</view> |
||||
<text class="item-value">{{ scheduleInfo.venue_name }}</text> |
<view class="info-item"> |
||||
</view> |
<text class="item-label">课程状态:</text> |
||||
<view class="info-item"> |
<text :class="['item-value',statusClass]">{{ scheduleInfo.status_text }}</text> |
||||
<text class="item-label">授课教练:</text> |
</view> |
||||
<text class="item-value">{{ scheduleInfo.coach_name }}</text> |
<view class="info-item"> |
||||
</view> |
<text class="item-label">班级:</text> |
||||
<view class="info-item"> |
<text |
||||
<text class="item-label">课程状态:</text> |
class="item-value">{{ scheduleInfo.class_info ? scheduleInfo.class_info.class_name : '无班级' }}</text> |
||||
<text class="item-value" :class="getStatusClass(scheduleInfo.status)">{{ scheduleInfo.status_text }}</text> |
</view> |
||||
</view> |
</view> |
||||
<view class="info-item"> |
|
||||
<text class="item-label">班级:</text> |
<!-- 学员信息 --> |
||||
<text class="item-value">{{ scheduleInfo.class_info ? scheduleInfo.class_info.class_name : '无班级' }}</text> |
<view class="section students-info"> |
||||
</view> |
<view class="section-title">学员信息 ({{ scheduleInfo.students ? scheduleInfo.students.length : 0 }}人) |
||||
</view> |
</view> |
||||
|
<view class="student-list" v-if="scheduleInfo.students && scheduleInfo.students.length > 0"> |
||||
<!-- 学员信息 --> |
<view class="student-item" v-for="(student, index) in scheduleInfo.students" :key="index"> |
||||
<view class="section students-info"> |
<view class="student-avatar"> |
||||
<view class="section-title">学员信息 ({{ scheduleInfo.students ? scheduleInfo.students.length : 0 }}人)</view> |
<image :src="student.avatar || '/static/icon-img/avatar.png'" mode="aspectFill"></image> |
||||
<view class="student-list" v-if="scheduleInfo.students && scheduleInfo.students.length > 0"> |
</view> |
||||
<view class="student-item" v-for="(student, index) in scheduleInfo.students" :key="index"> |
<view class="student-detail"> |
||||
<view class="student-avatar"> |
<text class="student-name">{{ student.name }}</text> |
||||
<image :src="student.avatar || '/static/icon-img/avatar.png'" mode="aspectFill"></image> |
<text class="" |
||||
</view> |
:class="['student-status',student.statusClass]">{{ student.status_text }}</text> |
||||
<view class="student-detail"> |
</view> |
||||
<text class="student-name">{{ student.name }}</text> |
</view> |
||||
<text class="student-status" :class="getStudentStatusClass(student.status)">{{ student.status_text }}</text> |
</view> |
||||
</view> |
<view class="empty-list" v-else> |
||||
</view> |
<text>暂无学员参与此课程</text> |
||||
</view> |
</view> |
||||
<view class="empty-list" v-else> |
</view> |
||||
<text>暂无学员参与此课程</text> |
|
||||
</view> |
<!-- 操作按钮 --> |
||||
</view> |
<view class="action-buttons"> |
||||
|
<fui-button type="primary" @click="handleSignIn" |
||||
<!-- 操作按钮 --> |
:disabled="scheduleInfo.status === 'completed'">课程点名</fui-button> |
||||
<view class="action-buttons"> |
<fui-button type="default" @click="handleAdjustClass" |
||||
<fui-button type="primary" @click="handleSignIn" :disabled="scheduleInfo.status === 'completed'">课程点名</fui-button> |
:disabled="scheduleInfo.status === 'completed'">调整课程</fui-button> |
||||
<fui-button type="default" @click="handleAdjustClass" :disabled="scheduleInfo.status === 'completed'">调整课程</fui-button> |
</view> |
||||
</view> |
|
||||
|
<!-- 关闭按钮 --> |
||||
<!-- 关闭按钮 --> |
<view class="close-btn" @click="closePopup"> |
||||
<view class="close-btn" @click="closePopup"> |
<fui-icon name="close" :size="40" color="#999"></fui-icon> |
||||
<fui-icon name="close" :size="40" color="#999"></fui-icon> |
</view> |
||||
</view> |
</view> |
||||
</view> |
|
||||
|
<view class="loading" v-if="loading && !scheduleInfo"> |
||||
<view class="loading" v-if="loading && !scheduleInfo"> |
<fui-loading></fui-loading> |
||||
<fui-loading></fui-loading> |
<text class="loading-text">加载中...</text> |
||||
<text class="loading-text">加载中...</text> |
</view> |
||||
</view> |
|
||||
|
<view class="error-message" v-if="error && !scheduleInfo"> |
||||
<view class="error-message" v-if="error && !scheduleInfo"> |
<text>{{ errorMessage }}</text> |
||||
<text>{{ errorMessage }}</text> |
<view class="retry-btn" @click="fetchScheduleDetail"> |
||||
<view class="retry-btn" @click="fetchScheduleDetail"> |
<text>重试</text> |
||||
<text>重试</text> |
</view> |
||||
</view> |
</view> |
||||
</view> |
</fui-modal> |
||||
</fui-modal> |
</view> |
||||
</view> |
|
||||
</template> |
</template> |
||||
|
|
||||
<script> |
<script> |
||||
import api from '@/api/apiRoute.js'; |
import api from '@/api/apiRoute.js'; |
||||
|
|
||||
export default { |
export default { |
||||
name: 'ScheduleDetail', |
name: 'ScheduleDetail', |
||||
props: { |
props: { |
||||
visible: { |
visible: { |
||||
type: Boolean, |
type: Boolean, |
||||
default: false |
default: false |
||||
}, |
}, |
||||
scheduleId: { |
scheduleId: { |
||||
type: [String, Number], |
type: [String, Number], |
||||
default: null |
default: null |
||||
} |
} |
||||
}, |
}, |
||||
data() { |
computed: { |
||||
return { |
statusClass() { |
||||
loading: false, |
const statusMap = { |
||||
error: false, |
'pending': 'status-pending', |
||||
errorMessage: '加载失败,请重试', |
'upcoming': 'status-upcoming', |
||||
scheduleInfo: null |
'ongoing': 'status-ongoing', |
||||
} |
'completed': 'status-completed' |
||||
}, |
}; |
||||
watch: { |
return statusMap[this.scheduleInfo.status] || ''; |
||||
visible(newVal) { |
}, |
||||
if (newVal && this.scheduleId) { |
studentList() { |
||||
this.fetchScheduleDetail(); |
const statusMap = { |
||||
} |
0: 'status-absent', |
||||
}, |
1: 'status-present', |
||||
scheduleId(newVal) { |
2: 'status-leave' |
||||
if (newVal && this.visible) { |
}; |
||||
this.fetchScheduleDetail(); |
|
||||
} |
return this.studentListRaw.map(student => ({ |
||||
} |
...student, |
||||
}, |
statusClass: statusMap[student.status] || 'status-absent', |
||||
methods: { |
status_text: this.getStatusText(student.status) |
||||
// 获取课程安排详情 |
})); |
||||
async fetchScheduleDetail() { |
} |
||||
if (!this.scheduleId) { |
}, |
||||
this.error = true; |
data() { |
||||
this.errorMessage = '课程ID不能为空'; |
return { |
||||
return; |
loading: false, |
||||
} |
error: false, |
||||
|
errorMessage: '加载失败,请重试', |
||||
this.loading = true; |
scheduleInfo: null |
||||
this.error = false; |
} |
||||
|
}, |
||||
try { |
watch: { |
||||
const res = await api.getCourseScheduleInfo({ schedule_id: this.scheduleId }); |
visible(newVal) { |
||||
if (res.code === 1) { |
if (newVal && this.scheduleId) { |
||||
this.scheduleInfo = res.data; |
this.fetchScheduleDetail(); |
||||
} else { |
} |
||||
uni.showToast({ |
}, |
||||
title: res.msg || '获取课程安排详情失败', |
scheduleId(newVal) { |
||||
icon: 'none' |
if (newVal && this.visible) { |
||||
}); |
this.fetchScheduleDetail(); |
||||
this.error = true; |
} |
||||
this.errorMessage = res.msg || '获取课程安排详情失败'; |
} |
||||
} |
}, |
||||
} catch (error) { |
methods: { |
||||
console.error('获取课程安排详情失败:', error); |
// 获取课程安排详情 |
||||
this.error = true; |
async fetchScheduleDetail() { |
||||
this.errorMessage = error.message || '获取课程安排详情失败,请重试'; |
if (!this.scheduleId) { |
||||
} finally { |
this.error = true; |
||||
this.loading = false; |
this.errorMessage = '课程ID不能为空'; |
||||
} |
return; |
||||
}, |
} |
||||
|
|
||||
// 关闭弹窗 |
this.loading = true; |
||||
closePopup() { |
this.error = false; |
||||
this.$emit('update:visible', false); |
|
||||
}, |
try { |
||||
|
const res = await api.getCourseScheduleInfo({ |
||||
// 点名操作 |
schedule_id: this.scheduleId |
||||
handleSignIn() { |
}); |
||||
this.$emit('sign-in', { |
if (res.code === 1) { |
||||
scheduleId: this.scheduleId, |
this.scheduleInfo = res.data; |
||||
scheduleName: this.scheduleInfo?.course_name |
} else { |
||||
}); |
uni.showToast({ |
||||
this.closePopup(); |
title: res.msg || '获取课程安排详情失败', |
||||
}, |
icon: 'none' |
||||
|
}); |
||||
// 调课操作 |
this.error = true; |
||||
handleAdjustClass() { |
this.errorMessage = res.msg || '获取课程安排详情失败'; |
||||
this.$emit('adjust-class', { |
} |
||||
scheduleId: this.scheduleId, |
} catch (error) { |
||||
scheduleName: this.scheduleInfo?.course_name |
console.error('获取课程安排详情失败:', error); |
||||
}); |
this.error = true; |
||||
this.closePopup(); |
this.errorMessage = error.message || '获取课程安排详情失败,请重试'; |
||||
}, |
} finally { |
||||
|
this.loading = false; |
||||
// 获取状态样式类 |
} |
||||
getStatusClass(status) { |
}, |
||||
const statusMap = { |
|
||||
'pending': 'status-pending', |
// 关闭弹窗 |
||||
'upcoming': 'status-upcoming', |
closePopup() { |
||||
'ongoing': 'status-ongoing', |
this.$emit('update:visible', false); |
||||
'completed': 'status-completed' |
}, |
||||
}; |
|
||||
return statusMap[status] || ''; |
// 点名操作 |
||||
}, |
handleSignIn() { |
||||
|
this.$emit('sign-in', { |
||||
// 获取学员状态样式类 |
scheduleId: this.scheduleId, |
||||
getStudentStatusClass(status) { |
scheduleName: this.scheduleInfo?.course_name |
||||
const statusMap = { |
}); |
||||
0: 'status-pending', // 待上课 |
this.closePopup(); |
||||
1: 'status-completed', // 已上课 |
}, |
||||
2: 'status-leave' // 请假 |
|
||||
}; |
// 调课操作 |
||||
return statusMap[status] || ''; |
handleAdjustClass() { |
||||
} |
this.$emit('adjust-class', { |
||||
} |
scheduleId: this.scheduleId, |
||||
} |
scheduleName: this.scheduleInfo?.course_name |
||||
|
}); |
||||
|
this.closePopup(); |
||||
|
}, |
||||
|
|
||||
|
// 获取学员状态样式类 |
||||
|
getStudentStatusClass(status) { |
||||
|
const statusMap = { |
||||
|
0: 'status-pending', // 待上课 |
||||
|
1: 'status-completed', // 已上课 |
||||
|
2: 'status-leave' // 请假 |
||||
|
}; |
||||
|
return statusMap[status] || ''; |
||||
|
}, |
||||
|
// 获取状态文本 |
||||
|
getStatusText(status) { |
||||
|
const statusTextMap = { |
||||
|
0: '待上课', |
||||
|
1: '已上课', |
||||
|
2: '请假' |
||||
|
}; |
||||
|
return statusTextMap[status] || '未知状态'; |
||||
|
}, |
||||
|
} |
||||
|
} |
||||
</script> |
</script> |
||||
|
|
||||
<style lang="scss" scoped> |
<style lang="scss" scoped> |
||||
.schedule-detail { |
.schedule-detail { |
||||
padding: 20rpx; |
padding: 20rpx; |
||||
max-height: 80vh; |
max-height: 80vh; |
||||
overflow-y: auto; |
overflow-y: auto; |
||||
position: relative; |
position: relative; |
||||
} |
} |
||||
|
|
||||
.section { |
.section { |
||||
margin-bottom: 30rpx; |
margin-bottom: 30rpx; |
||||
background-color: #2a2a2a; |
background-color: #2a2a2a; |
||||
border-radius: 12rpx; |
border-radius: 12rpx; |
||||
padding: 20rpx; |
padding: 20rpx; |
||||
} |
} |
||||
|
|
||||
.section-title { |
.section-title { |
||||
font-size: 30rpx; |
font-size: 30rpx; |
||||
font-weight: bold; |
font-weight: bold; |
||||
color: #29d3b4; |
color: #29d3b4; |
||||
margin-bottom: 20rpx; |
margin-bottom: 20rpx; |
||||
border-bottom: 1px solid #3a3a3a; |
border-bottom: 1px solid #3a3a3a; |
||||
padding-bottom: 10rpx; |
padding-bottom: 10rpx; |
||||
} |
} |
||||
|
|
||||
.info-item { |
.info-item { |
||||
display: flex; |
display: flex; |
||||
margin-bottom: 16rpx; |
margin-bottom: 16rpx; |
||||
font-size: 28rpx; |
font-size: 28rpx; |
||||
} |
} |
||||
|
|
||||
.item-label { |
.item-label { |
||||
color: #999; |
color: #999; |
||||
width: 160rpx; |
width: 160rpx; |
||||
flex-shrink: 0; |
flex-shrink: 0; |
||||
} |
} |
||||
|
|
||||
.item-value { |
.item-value { |
||||
color: #fff; |
color: #fff; |
||||
flex: 1; |
flex: 1; |
||||
} |
} |
||||
|
|
||||
.student-list { |
.student-list { |
||||
display: flex; |
display: flex; |
||||
flex-wrap: wrap; |
flex-wrap: wrap; |
||||
gap: 20rpx; |
gap: 20rpx; |
||||
} |
} |
||||
|
|
||||
.student-item { |
.student-item { |
||||
display: flex; |
display: flex; |
||||
align-items: center; |
align-items: center; |
||||
background-color: #3a3a3a; |
background-color: #3a3a3a; |
||||
border-radius: 8rpx; |
border-radius: 8rpx; |
||||
padding: 15rpx; |
padding: 15rpx; |
||||
width: calc(50% - 10rpx); |
width: calc(50% - 10rpx); |
||||
} |
} |
||||
|
|
||||
.student-avatar { |
.student-avatar { |
||||
width: 80rpx; |
width: 80rpx; |
||||
height: 80rpx; |
height: 80rpx; |
||||
border-radius: 40rpx; |
border-radius: 40rpx; |
||||
overflow: hidden; |
overflow: hidden; |
||||
margin-right: 15rpx; |
margin-right: 15rpx; |
||||
|
|
||||
image { |
image { |
||||
width: 100%; |
width: 100%; |
||||
height: 100%; |
height: 100%; |
||||
} |
} |
||||
} |
} |
||||
|
|
||||
.student-detail { |
.student-detail { |
||||
flex: 1; |
flex: 1; |
||||
display: flex; |
display: flex; |
||||
flex-direction: column; |
flex-direction: column; |
||||
} |
} |
||||
|
|
||||
.student-name { |
.student-name { |
||||
font-size: 28rpx; |
font-size: 28rpx; |
||||
color: #fff; |
color: #fff; |
||||
margin-bottom: 8rpx; |
margin-bottom: 8rpx; |
||||
} |
} |
||||
|
|
||||
.student-status { |
.student-status { |
||||
font-size: 24rpx; |
font-size: 24rpx; |
||||
} |
} |
||||
|
|
||||
.status-pending { |
.status-pending { |
||||
color: #ff9500; |
color: #ff9500; |
||||
} |
} |
||||
|
|
||||
.status-upcoming { |
.status-upcoming { |
||||
color: #29d3b4; |
color: #29d3b4; |
||||
} |
} |
||||
|
|
||||
.status-ongoing { |
.status-ongoing { |
||||
color: #007aff; |
color: #007aff; |
||||
} |
} |
||||
|
|
||||
.status-completed { |
.status-completed { |
||||
color: #8e8e93; |
color: #8e8e93; |
||||
} |
} |
||||
|
|
||||
.status-leave { |
.status-leave { |
||||
color: #ff3b30; |
color: #ff3b30; |
||||
} |
} |
||||
|
|
||||
.action-buttons { |
.action-buttons { |
||||
display: flex; |
display: flex; |
||||
justify-content: space-around; |
justify-content: space-around; |
||||
margin-top: 30rpx; |
margin-top: 30rpx; |
||||
gap: 30rpx; |
gap: 30rpx; |
||||
} |
} |
||||
|
|
||||
.close-btn { |
.close-btn { |
||||
position: absolute; |
position: absolute; |
||||
top: 20rpx; |
top: 20rpx; |
||||
right: 20rpx; |
right: 20rpx; |
||||
z-index: 10; |
z-index: 10; |
||||
padding: 10rpx; |
padding: 10rpx; |
||||
} |
} |
||||
|
|
||||
.loading, .error-message { |
.loading, |
||||
height: 300rpx; |
.error-message { |
||||
display: flex; |
height: 300rpx; |
||||
flex-direction: column; |
display: flex; |
||||
justify-content: center; |
flex-direction: column; |
||||
align-items: center; |
justify-content: center; |
||||
} |
align-items: center; |
||||
|
} |
||||
.loading-text { |
|
||||
margin-top: 20rpx; |
.loading-text { |
||||
font-size: 28rpx; |
margin-top: 20rpx; |
||||
color: #ccc; |
font-size: 28rpx; |
||||
} |
color: #ccc; |
||||
|
} |
||||
.error-message { |
|
||||
color: #ff6b6b; |
.error-message { |
||||
font-size: 28rpx; |
color: #ff6b6b; |
||||
text-align: center; |
font-size: 28rpx; |
||||
} |
text-align: center; |
||||
|
} |
||||
.retry-btn { |
|
||||
margin-top: 30rpx; |
.retry-btn { |
||||
padding: 12rpx 30rpx; |
margin-top: 30rpx; |
||||
background-color: #29d3b4; |
padding: 12rpx 30rpx; |
||||
border-radius: 8rpx; |
background-color: #29d3b4; |
||||
color: #fff; |
border-radius: 8rpx; |
||||
font-size: 24rpx; |
color: #fff; |
||||
} |
font-size: 24rpx; |
||||
|
} |
||||
.empty-list { |
|
||||
padding: 40rpx 0; |
.empty-list { |
||||
text-align: center; |
padding: 40rpx 0; |
||||
color: #999; |
text-align: center; |
||||
font-size: 28rpx; |
color: #999; |
||||
} |
font-size: 28rpx; |
||||
|
} |
||||
</style> |
</style> |
||||
File diff suppressed because it is too large
Loading…
Reference in new issue