|
|
@@ -127,75 +127,51 @@
|
|
|
<SelfDirectedLearning v-if="currentOpenedMenu === menuConfigTemp[3].id"
|
|
|
@refreshData="refreshData" />
|
|
|
|
|
|
- <!-- 家长课堂-手机端 - 与其他课程保持一致的样式 -->
|
|
|
- <template v-else-if="currentOpenedMenu === '/parent-mobile'">
|
|
|
- <!-- 电脑端样式:与原课程相同的布局结构 -->
|
|
|
- <div
|
|
|
- class="small-box parent-mobile-course-item"
|
|
|
- v-for="(course, index) in currentCourseData"
|
|
|
- :key="course.id"
|
|
|
- >
|
|
|
- <div
|
|
|
- class="nested-box"
|
|
|
- :style="{
|
|
|
- backgroundImage: `url(${course.ctTypeImage})`,
|
|
|
- backgroundSize: 'cover'
|
|
|
- }"
|
|
|
- @click="goToParentMobileCourse(course)"
|
|
|
- ></div>
|
|
|
- <div class="additional-text">
|
|
|
- {{ course.ctTypeSort }} {{ course.ctType }}
|
|
|
- </div>
|
|
|
- </div>
|
|
|
-
|
|
|
- <!-- 移动端样式 -->
|
|
|
- <div class="parent-mobile-container">
|
|
|
- <div
|
|
|
- class="parent-mobile-item"
|
|
|
- v-for="(course, index) in currentCourseData"
|
|
|
- :key="course.id"
|
|
|
- @click="goToParentMobileCourse(course)"
|
|
|
- >
|
|
|
- <!-- 左侧图片 -->
|
|
|
- <div class="parent-mobile-image">
|
|
|
- <img :src="course.ctTypeImage" :alt="course.title" />
|
|
|
- </div>
|
|
|
- <!-- 右侧内容 -->
|
|
|
- <div class="parent-mobile-content">
|
|
|
- <div class="parent-mobile-title">
|
|
|
- <span class="parent-mobile-index">{{ course.ctTypeSort }}</span>
|
|
|
- {{ course.ctType }}
|
|
|
- </div>
|
|
|
- <div class="parent-mobile-desc">{{ course.ctTypeDescribe || '' }}</div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
-
|
|
|
- <!-- 空状态 -->
|
|
|
- <div v-if="currentCourseData.length === 0" class="empty-state" style="width: 100%; text-align: center; padding: 40px;">
|
|
|
- <p>暂无课程</p>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
-
|
|
|
- <!-- 其他课程类型的默认显示 -->
|
|
|
+ <!-- 课程列表(兼容手机端)-->
|
|
|
+ <!-- 电脑端 -->
|
|
|
<div
|
|
|
- class="small-box"
|
|
|
- v-for="(outlineData, index) in currentCourseData"
|
|
|
- :key="index"
|
|
|
- v-else
|
|
|
+ class="small-box parent-mobile-course-item"
|
|
|
+ v-for="(course, index) in currentCourseData"
|
|
|
+ :key="course.id"
|
|
|
>
|
|
|
<div
|
|
|
class="nested-box"
|
|
|
:style="{
|
|
|
- backgroundImage: `url(${outlineData.ctTypeImage})`,
|
|
|
+ backgroundImage: `url(${course.ctTypeImage})`,
|
|
|
backgroundSize: 'cover'
|
|
|
}"
|
|
|
- @click="goToAIExperience(outlineData)"
|
|
|
+ @click="goToAIExperience(course)"
|
|
|
></div>
|
|
|
<div class="additional-text">
|
|
|
- {{ outlineData.ctTypeSort }} {{ outlineData.ctType }}
|
|
|
+ {{ course.ctTypeSort }} {{ course.ctType }}
|
|
|
</div>
|
|
|
</div>
|
|
|
+ <!-- 移动端 -->
|
|
|
+ <div class="parent-mobile-container">
|
|
|
+ <div
|
|
|
+ class="parent-mobile-item"
|
|
|
+ v-for="(course, index) in currentCourseData"
|
|
|
+ :key="course.id"
|
|
|
+ @click="goToAIExperience(course)"
|
|
|
+ >
|
|
|
+ <!-- 左侧图片 -->
|
|
|
+ <div class="parent-mobile-image">
|
|
|
+ <img :src="course.ctTypeImage" :alt="course.title" />
|
|
|
+ </div>
|
|
|
+ <!-- 右侧内容 -->
|
|
|
+ <div class="parent-mobile-content">
|
|
|
+ <div class="parent-mobile-title">
|
|
|
+ <span class="parent-mobile-index">{{ course.ctTypeSort }}</span>
|
|
|
+ {{ course.ctType }}
|
|
|
+ </div>
|
|
|
+ <div class="parent-mobile-desc">{{ course.ctTypeDescribe || '' }}</div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <!-- 空状态 -->
|
|
|
+ <div v-if="currentCourseData.length === 0" class="empty-state" style="width: 100%; text-align: center; padding: 40px;">
|
|
|
+ <p>暂无课程</p>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -280,10 +256,10 @@ const menuList = computed(() => {
|
|
|
const roleRouteMenuSet = computed(() => {
|
|
|
try {
|
|
|
const roleRouteMenuStr = localStorage.getItem(CONFIG.USER_ROLE_ROUTE_MENU_KEY)
|
|
|
- // const roleRouteMenu = JSON.parse(roleRouteMenuStr)
|
|
|
- // roleRouteMenu.push('/parent-mobile')
|
|
|
- // return roleRouteMenu
|
|
|
- return roleRouteMenuStr ? JSON.parse(roleRouteMenuStr) : []
|
|
|
+ const roleRouteMenu = JSON.parse(roleRouteMenuStr)
|
|
|
+ roleRouteMenu.push('/parent-mobile')
|
|
|
+ return roleRouteMenu
|
|
|
+ // return roleRouteMenuStr ? JSON.parse(roleRouteMenuStr) : []
|
|
|
} catch (error) {
|
|
|
console.error('Error parsing roleRouteMenuSet:', error)
|
|
|
return []
|
|
|
@@ -318,6 +294,7 @@ const saveActiveState = (menuId, index) => {
|
|
|
const refreshData = async () => {
|
|
|
|
|
|
const res = await ClassOutline(localStorage.getItem('selectedGradeId'), menuConfigTemp[3].type)
|
|
|
+ debugger
|
|
|
if (res.code === 0) {
|
|
|
selfStudyCourseData.value = processCourseData(res.data)
|
|
|
}
|
|
|
@@ -515,7 +492,7 @@ const goBack = () => {
|
|
|
router.push('/home') // 跳转到HomePage
|
|
|
}
|
|
|
|
|
|
-const goToAIExperience = outlineData => {
|
|
|
+const goToAIExperience = (outlineData) => {
|
|
|
// 确定当前课程所属的菜单类型
|
|
|
const menuId = currentOpenedMenu.value
|
|
|
|
|
|
@@ -532,25 +509,7 @@ const goToAIExperience = outlineData => {
|
|
|
|
|
|
// 课程跳转逻辑
|
|
|
router.push({
|
|
|
- path: '/ai-develop', // 跳转视频页面
|
|
|
- state: { typeId: outlineData.id, typeName: outlineData.ctType, typeSort: outlineData.ctTypeSort }
|
|
|
- })
|
|
|
-}
|
|
|
-
|
|
|
-// 家长课堂-手机端跳转方法
|
|
|
-const goToParentMobileCourse = (outlineData) => {
|
|
|
- const menuId = currentOpenedMenu.value
|
|
|
- const menu = menuConfig.value.find(m => m.id === menuId)
|
|
|
- const currentData = menu ? menu.data.value : []
|
|
|
- const index = currentData.findIndex(item => item.id === outlineData.id)
|
|
|
-
|
|
|
- if (index !== -1) {
|
|
|
- const menuIndex = menuId + '-' + (index + 1)
|
|
|
- saveActiveState(menuId, menuIndex)
|
|
|
- }
|
|
|
-
|
|
|
- router.push({
|
|
|
- path: '/parent-mobile-course-detail',
|
|
|
+ path: menuId === menuConfigTemp[4].id ? '/parent-mobile-course-detail' : '/ai-develop', // 跳转视频页面
|
|
|
state: { typeId: outlineData.id, typeName: outlineData.ctType, typeSort: outlineData.ctTypeSort }
|
|
|
})
|
|
|
}
|