From 0dc5269893fffced2073c0a4f9fe03d68da078a1 Mon Sep 17 00:00:00 2001 From: huertian Date: Tue, 7 Jan 2025 17:13:58 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E8=AF=BE=E7=A8=8B=E8=BF=9B=E5=BA=A6?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 课程列表和详情: 1. 为课程添加了徽标展示 2. 优化了课程完成、未完成、未开始的展示 3. 更新了进度查看界面的icon 进度管理: 1. 优化了课程进度详细界面的进度处理逻辑关系 2. 修复了老师过滤器切换后标签颜色不更新的问题 代码优化: 1. 统一了角色和岗位的注释风格 --- src/components/TabBar.vue | 2 +- src/pages/index/index.vue | 34 +++++++++++++++++++++++----------- src/pages/lesson/index.vue | 31 +++++++++++++++++++++++++------ src/types/api/user.ts | 16 ++++++++-------- src/utils/lesson.ts | 18 ++++++++++++++++++ 5 files changed, 75 insertions(+), 26 deletions(-) diff --git a/src/components/TabBar.vue b/src/components/TabBar.vue index 9c8501e..7e32a3e 100644 --- a/src/components/TabBar.vue +++ b/src/components/TabBar.vue @@ -36,7 +36,7 @@ const nameLabelIconMap = { progress: { title: '进度管理', icon: 'transfer', - roles: ['teacher', 'sysadmin'] as const // 校方教师、公司课程顾问、公司系统管理员 + roles: ['teacher', 'sysadmin'] as const // 校方教师、公司系统管理员 // roles: ['teacher', 'admin', 'sysadmin'] as const // 校方教师、公司课程顾问、公司系统管理员 }, my: { diff --git a/src/pages/index/index.vue b/src/pages/index/index.vue index 14dfdc1..41ba11b 100644 --- a/src/pages/index/index.vue +++ b/src/pages/index/index.vue @@ -3,7 +3,7 @@ import BussApi from '@/api/BussApi'; import pageWrapper from '@/components/page-wrapper.vue'; import { useUser } from '@/stores/useUser'; import type { LessonTask } from '@/types/api/lesson'; -import { calcLessonProgress, getLessonSteps } from '@/utils/lesson'; +import { calcLessonProgress, getLessonRole } from '@/utils/lesson'; import { onPageShow, onLoad, onPullDownRefresh } from '@dcloudio/uni-app'; import { useRouter } from 'uni-mini-router'; import { onMounted, ref, watch } from 'vue'; @@ -73,6 +73,7 @@ const openLessonDetail = (courseId: number) => { }) } + const loadLessons = async () => { if (!user.userinfo) { toast.error({ msg: '请先登录' }) @@ -156,7 +157,9 @@ const loadLessons = async () => { } watch(teacherFilterValue, () => { - loadLessons() + loadLessons().then(() => { + refreshKey.value++ + }) }) onPageShow(() => { @@ -207,7 +210,6 @@ onLoad(() => { - @@ -216,11 +218,14 @@ onLoad(() => {