hookehuyr

fix: 修复视频播放器暂停功能并优化学生页面样式

修复视频播放器暂停功能的条件判断,确保player存在且pause是函数时才调用
调整学生页面标签大小和布局间距,增加卡片阴影效果
移除调试日志并优化音频暂停逻辑
......@@ -131,8 +131,8 @@ onBeforeUnmount(() => {
defineExpose({
pause() {
if (player.value) {
player.value?.pause();
if (player && typeof player?.pause === 'function') {
player?.pause();
emit('onPause', player.value);
}
},
......
......@@ -2,7 +2,7 @@
* @Author: hookehuyr hookehuyr@gmail.com
* @Date: 2025-06-19 17:12:19
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2025-06-19 22:39:26
* @LastEditTime: 2025-06-19 23:27:57
* @FilePath: /mlaj/src/views/teacher/studentPage.vue
* @Description: 学生详情页面
-->
......@@ -28,7 +28,7 @@
</div>
<!-- 标签 -->
<div class="flex flex-wrap gap-2">
<van-tag v-for="tag in studentInfo.tags" :key="tag" type="success" size="small">
<van-tag v-for="tag in studentInfo.tags" :key="tag" type="success" size="large">
{{ tag }}
</van-tag>
</div>
......@@ -43,7 +43,7 @@
<span class="text-sm font-medium text-gray-700">所学课程</span>
</div>
<div class="flex flex-wrap gap-2">
<van-tag v-for="course in studentInfo.courses" :key="course" type="primary" size="small">
<van-tag v-for="course in studentInfo.courses" :key="course" type="primary" size="large">
{{ course }}
</van-tag>
</div>
......@@ -86,7 +86,7 @@
</div>
<!-- 功能按钮 -->
<div class="mt-2 p-4">
<div class="mt-2 px-4">
<!-- 状态筛选 -->
<div class="flex items-center justify-end mb-4">
<div @click="showStatusPopup = true" class="flex items-center text-sm text-gray-600 cursor-pointer">
......@@ -97,19 +97,19 @@
</div>
<!-- 使用van-sticky包裹van-tabs实现粘性布局 -->
<div class="bg-white" style="margin: 1rem;">
<van-sticky :offset-top="0">
<div class="bg-white">
<van-tabs v-model:active="activeTab" color="#10b981" animated swipeable @change="handleTabChange">
<van-tab title="作业记录" name="homework"></van-tab>
<van-tab title="班主任点评" name="evaluation"></van-tab>
<van-tab title="打卡统计" name="statistics"></van-tab>
</van-tabs>
</div>
</van-sticky>
</div>
<!-- 记录列表 -->
<van-list v-show="activeTab === 'statistics'" v-model:loading="recordLoading" :finished="recordFinished"
finished-text="没有更多了" @load="onRecordLoad">
finished-text="没有更多了" @load="onRecordLoad" class="px-4">
<div v-for="record in filteredRecords" :key="record.id"
class="flex items-center justify-between py-4 border-b border-gray-100 last:border-b-0 bg-white px-4">
<div class="flex items-center flex-1">
......@@ -138,8 +138,8 @@
<!--作业记录 -->
<van-list v-show="activeTab === 'homework' && checkinDataList.length" v-model:loading="loading"
:finished="finished" finished-text="没有更多了" @load="onLoad" class="space-y-4">
<div class="post-card" v-for="post in checkinDataList" :key="post.id">
:finished="finished" finished-text="没有更多了" @load="onLoad" class="space-y-4 px-4">
<div class="post-card shadow-md" v-for="post in checkinDataList" :key="post.id">
<div class="post-header">
<van-row>
<van-col span="4">
......@@ -410,7 +410,6 @@ const handleTabChange = (name) => {
// 停止所有视频和音频播放
if (videoPlayers.value) {
videoPlayers.value.forEach(player => {
console.warn(player);
if (player && typeof player?.pause === 'function') {
player?.pause();
}
......@@ -546,7 +545,7 @@ const stopAllAudio = () => {
audioPlayers.value?.forEach(player => {
// 使用组件暴露的pause方法
if (typeof player.pause === 'function') {
player.pause();
player?.pause();
}
});
// 更新所有帖子的播放状态
......