Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
S
saas-learn
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
saas-learn
Commits
e526ac67
提交
e526ac67
authored
10月 25, 2023
作者:
lhh
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update
上级
3c10b5c7
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
7 行增加
和
9 行删除
+7
-9
CourseIndex.vue
src/modules/course/views/CourseIndex.vue
+6
-8
CourseView.vue
src/modules/course/views/CourseView.vue
+1
-1
没有找到文件。
src/modules/course/views/CourseIndex.vue
浏览文件 @
e526ac67
<
script
setup
lang=
"ts"
>
<
script
setup
lang=
"ts"
>
import
CourseListSearch
from
'../components/CourseListSearch.vue'
import
CourseListItem
from
'../components/CourseListItem.vue'
import
CourseView
from
'./CourseView.vue'
import
CourseView
from
'./CourseView.vue'
import
type
{
CourseListParamsType
,
CourseListItemType
}
from
'../types'
import
type
{
CourseListParamsType
,
CourseListItemType
}
from
'../types'
import
{
getCourseList
}
from
'../api'
import
{
getCourseList
}
from
'../api'
...
@@ -23,7 +21,12 @@ function fetchList() {
...
@@ -23,7 +21,12 @@ function fetchList() {
elective_types
:
listParams
.
elective_types
?.
length
?
JSON
.
stringify
(
listParams
.
elective_types
)
:
''
elective_types
:
listParams
.
elective_types
?.
length
?
JSON
.
stringify
(
listParams
.
elective_types
)
:
''
})
})
getCourseList
(
params
).
then
(
res
=>
{
getCourseList
(
params
).
then
(
res
=>
{
courseList
=
res
.
data
.
data
courseList
=
res
.
data
.
data
.
map
((
item
:
any
,
index
:
number
)
=>
{
item
.
length
=
res
.
data
.
data
?.
length
item
.
index
=
index
return
item
})
console
.
log
(
courseList
,
'courseList'
)
const
[
first
]
=
courseList
const
[
first
]
=
courseList
// 进入第一个课程详情页
// 进入第一个课程详情页
if
(
first
&&
route
.
path
===
'/course'
&&
!
mobile
.
value
)
{
if
(
first
&&
route
.
path
===
'/course'
&&
!
mobile
.
value
)
{
...
@@ -31,11 +34,6 @@ function fetchList() {
...
@@ -31,11 +34,6 @@ function fetchList() {
}
}
})
})
}
}
// 筛选
function
handleSearch
(
params
:
CourseListParamsType
)
{
Object
.
assign
(
listParams
,
params
)
fetchList
()
}
onMounted
(()
=>
{
onMounted
(()
=>
{
fetchList
()
fetchList
()
})
})
...
...
src/modules/course/views/CourseView.vue
浏览文件 @
e526ac67
...
@@ -84,7 +84,7 @@ function handleStudy() {
...
@@ -84,7 +84,7 @@ function handleStudy() {
courseViewChapterRef
.
value
.
study
()
courseViewChapterRef
.
value
.
study
()
}
}
let
detailFlag
=
$ref
(
false
)
let
detailFlag
=
$ref
(
props
.
data
?.
length
>
1
&&
props
.
data
?.
index
===
0
?
true
:
false
)
const
handleDetail
=
function
()
{
const
handleDetail
=
function
()
{
router
.
push
({
router
.
push
({
path
:
'/course/view'
,
path
:
'/course/view'
,
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论