mobile app chat contest_detail exam_detail exam_list themes
This commit is contained in:
@@ -80,7 +80,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<!-- 聊天视图 -->
|
||||
<div id="chatView" class="flex-1 hidden z-10 relative h-full">
|
||||
<div id="chatView" class="flex-1 hidden flex-col z-10 relative h-full">
|
||||
<!-- 顶栏 -->
|
||||
<div id="chatHeader" class="px-6 py-4 border-b border-white/10 flex items-center justify-between bg-slate-800/60 backdrop-blur-xl flex-shrink-0 z-20">
|
||||
<div class="flex items-center gap-3">
|
||||
@@ -413,6 +413,7 @@ function renderNotifications() {
|
||||
const isResult = n.type === 'contest_result' || n.type === 'teacher_result';
|
||||
const isNewExam = n.type === 'contest_new_exam';
|
||||
const isGraded = n.type === 'exam_graded';
|
||||
const isSubmission = n.type === 'exam_submission';
|
||||
const isSystem = n.type === 'system_announcement';
|
||||
const isPendingContest = isContestApp && n.application_status === 'pending';
|
||||
const isPendingTeacher = isTeacherApp && n.application_status === 'pending';
|
||||
@@ -421,8 +422,8 @@ function renderNotifications() {
|
||||
if ((isContestApp || isTeacherApp) && n.application_status === 'approved') statusHtml = '<span class="text-xs text-green-600 font-medium">已批准</span>';
|
||||
else if ((isContestApp || isTeacherApp) && n.application_status === 'rejected') statusHtml = '<span class="text-xs text-red-600 font-medium">已拒绝</span>';
|
||||
else if (isFriendReq && n.application_status === 'accepted') statusHtml = '<span class="text-xs text-green-600 font-medium">已同意</span>';
|
||||
const icon = isContestApp ? '📋' : isTeacherApp ? '👨🏫' : isFriendReq ? '👤' : isResult ? '📢' : isNewExam ? '📝' : isGraded ? '✅' : isSystem ? '📢' : '🔔';
|
||||
const iconBg = isContestApp ? 'bg-orange-100' : isTeacherApp ? 'bg-purple-100' : isFriendReq ? 'bg-blue-100' : isResult ? 'bg-green-100' : isNewExam ? 'bg-indigo-100' : isGraded ? 'bg-emerald-100' : isSystem ? 'bg-amber-100' : 'bg-blue-100';
|
||||
const icon = isContestApp ? '📋' : isTeacherApp ? '👨🏫' : isFriendReq ? '👤' : isResult ? '📢' : isNewExam ? '📝' : isSubmission ? '📝' : isGraded ? '✅' : isSystem ? '📢' : '🔔';
|
||||
const iconBg = isContestApp ? 'bg-orange-100' : isTeacherApp ? 'bg-purple-100' : isFriendReq ? 'bg-blue-100' : isResult ? 'bg-green-100' : isNewExam ? 'bg-indigo-100' : isSubmission ? 'bg-amber-100' : isGraded ? 'bg-emerald-100' : isSystem ? 'bg-amber-100' : 'bg-blue-100';
|
||||
const clickAction = `showNotifDetail(${n.id})`;
|
||||
let actionsHtml = '';
|
||||
if (isPendingContest && currentUser.role === 'admin') {
|
||||
@@ -584,13 +585,15 @@ function showNotifDetail(nid) {
|
||||
'teacher_application': '教师申请', 'teacher_result': '教师审核结果',
|
||||
'contest_application': '杯赛申请', 'contest_result': '杯赛通知',
|
||||
'contest_new_exam': '新考试', 'exam_graded': '成绩通知',
|
||||
'system_announcement': '系统通知', 'friend_request': '好友申请'
|
||||
'exam_submission': '待批改', 'system_announcement': '系统通知',
|
||||
'friend_request': '好友申请'
|
||||
};
|
||||
const typeIcons = {
|
||||
'teacher_application': '👨🏫', 'teacher_result': '🎓',
|
||||
'contest_application': '📋', 'contest_result': '🏅',
|
||||
'contest_new_exam': '📝', 'exam_graded': '✅',
|
||||
'system_announcement': '📢', 'friend_request': '👤'
|
||||
'exam_submission': '📝', 'system_announcement': '📢',
|
||||
'friend_request': '👤'
|
||||
};
|
||||
|
||||
document.getElementById('notifDetailIcon').textContent = typeIcons[n.type] || '🔔';
|
||||
@@ -611,8 +614,13 @@ function showNotifDetail(nid) {
|
||||
<button onclick="approveTeacher(${n.application_id})" class="px-4 py-2 text-sm bg-green-500 text-white rounded-md hover:bg-green-600">批准</button>
|
||||
<button onclick="rejectTeacher(${n.application_id})" class="px-4 py-2 text-sm bg-red-500 text-white rounded-md hover:bg-red-600">拒绝</button>
|
||||
</div>`;
|
||||
} else if (n.type === 'exam_submission' && n.exam_id && n.submission_id) {
|
||||
actHtml = `<a href="/exams/${n.exam_id}/grade/${n.submission_id}" class="btn-futuristic inline-flex items-center gap-2 px-5 py-2.5 text-sm font-medium">
|
||||
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"/></svg>
|
||||
去批改
|
||||
</a>`;
|
||||
} else if (n.type === 'contest_new_exam' || n.type === 'exam_graded') {
|
||||
actHtml = `<a href="/exams/${n.post_id}" class="inline-block px-4 py-2 text-sm bg-primary text-white rounded-md hover:bg-blue-700">查看考试</a>`;
|
||||
actHtml = `<a href="/exams/${n.post_id}" class="btn-futuristic inline-flex items-center gap-2 px-5 py-2.5 text-sm font-medium">查看考试</a>`;
|
||||
} else if (n.type === 'friend_request' && n.application_status === 'pending' && n.friend_request_id) {
|
||||
actHtml = `<div class="flex gap-3">
|
||||
<button onclick="acceptFriendReq(${n.friend_request_id},${n.id})" class="px-4 py-2 text-sm bg-green-500 text-white rounded-md hover:bg-green-600">同意</button>
|
||||
|
||||
Reference in New Issue
Block a user