Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
educationStu
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
向伟
educationStu
Commits
18d31f24
Commit
18d31f24
authored
Jan 11, 2022
by
Mac
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
接口修改
parent
276e6eea
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
75 deletions
+36
-75
study.js
src/api/study.js
+1
-45
index.vue
src/pages/study/index.vue
+35
-30
No files found.
src/api/study.js
View file @
18d31f24
import
request
from
'../utils/request.js'
/**
* 获取我的课程列表
* @param {JSON参数} data
*/
export
function
getMyStudyCourseList
(
data
)
{
return
request
({
url
:
'/AppletIndex/GetMyStudyCourseList'
,
method
:
'post'
,
data
})
}
/**
* 获取我的课程章节列表
...
...
@@ -22,37 +12,3 @@ export function GetMyStudyCourseChapterList(data) {
data
})
}
/**
* 获取学习中心详情
* @param {JSON参数} data
*/
export
function
getMyStudyCourseInfo
(
data
)
{
return
request
({
url
:
'/AppletIndex/GetMyStudyCourseInfo'
,
method
:
'post'
,
data
})
}
/**
* 获取视频地址id
* @param {JSON参数} data
*/
export
function
getVideoPlayAuth
(
data
)
{
return
request
({
url
:
'/Video/GetVideoPlayAuth'
,
method
:
'post'
,
data
})
}
/**
* 获取视频地址
* @param {JSON参数} data
*/
export
function
getPlayInfo
(
data
)
{
return
request
({
url
:
'/Video/GetPlayInfo'
,
method
:
'post'
,
data
})
}
\ No newline at end of file
src/pages/study/index.vue
View file @
18d31f24
...
...
@@ -416,12 +416,6 @@
import
carousel
from
'./components/vear-carousel/vear-carousel.vue'
import
bottom
from
'../../components/bottom.vue'
import
{
ref
,
reactive
,
toRefs
,
toRef
,
getCurrentInstance
,
watch
,
computed
,
onMounted
,
provide
,}
from
"vue"
;
import
{
getMyStudyCourseList
,
//课程列表
getMyStudyCourseInfo
,
//详情
getVideoPlayAuth
,
//视频id
getPlayInfo
,
//视频地址
}
from
"../../api/study.js"
;
export
default
{
components
:
{
indexNo
,
...
...
@@ -429,6 +423,9 @@
carousel
},
setup
(
props
)
{
let
{
proxy
}
=
getCurrentInstance
();
let
data
=
reactive
({
CourseList
:[],
//课程列表
statusBarHeight
:
0
,
...
...
@@ -442,29 +439,34 @@
})
let
methods
=
{
async
getCourseList
()
{
let
res
=
await
getMyStudyCourseList
({});
if
(
res
.
Code
==
1
)
{
data
.
CourseList
=
res
.
Data
if
(
data
.
CourseList
.
length
>
0
){
data
.
CourseInfoMsg
.
ClassId
=
data
.
CourseList
[
0
].
ClassId
;
data
.
CourseInfoMsg
.
GuestId
=
data
.
CourseList
[
0
].
GuestId
;
that
.
getCourseInfo
()
}
}
getCourseList
()
{
proxy
.
$request
(
"/AppletIndex/GetMyStudyCourseList"
,
{}).
then
(
res
=>
{
if
(
res
.
Code
==
1
)
{
data
.
CourseList
=
res
.
Data
if
(
data
.
CourseList
.
length
>
0
){
data
.
CourseInfoMsg
.
ClassId
=
data
.
CourseList
[
0
].
ClassId
;
data
.
CourseInfoMsg
.
GuestId
=
data
.
CourseList
[
0
].
GuestId
;
that
.
getCourseInfo
()
}
}
})
},
async
getCourseInfo
()
{
//详情
let
res
=
await
getMyStudyCourseInfo
(
data
.
CourseInfoMsg
);
if
(
res
.
Code
==
1
)
{
getCourseInfo
()
{
//详情
proxy
.
$request
(
"/AppletIndex/GetMyStudyCourseInfo"
,
data
.
CourseInfoMsg
).
then
(
res
=>
{
if
(
res
.
Code
==
1
)
{
data
.
InfoData
=
res
.
Data
if
(
res
.
Data
&&
res
.
Data
.
Review
.
length
>
0
){
data
.
InfoData
.
Review
.
forEach
(
x
=>
{
x
.
videolist
=
[]
})
that
.
getvideo
()
}
}
}
}
})
},
selectedBanner
(
index
){
//切换轮播图的时候 调取接口
data
.
CourseInfoMsg
.
ClassId
=
data
.
CourseList
[
index
].
ClassId
;
...
...
@@ -486,26 +488,29 @@
}
}
},
async
getvideoId
(
x
,
y
)
{
//获取视频id
getvideoId
(
x
,
y
)
{
//获取视频id
if
(
x
.
VideoUrl
){
//判断是否有视频id
let
res
=
await
getVideoPlayAuth
({
strVid
:
x
.
VideoUrl
});
if
(
res
.
Code
==
1
)
{
that
.
getvideourl
(
res
.
Data
,
y
)
}
proxy
.
$request
(
"/Video/GetVideoPlayAuth"
,
{
strVid
:
x
.
VideoUrl
}).
then
(
res
=>
{
if
(
res
.
Code
==
1
)
{
that
.
getvideourl
(
res
.
Data
,
y
)
}
})
}
else
{
data
.
loading
=
false
}
},
async
getvideourl
(
x
,
y
)
{
//获取视频地址
let
res
=
await
getPlayInfo
({
strVid
:
x
.
VideoMeta
.
VideoId
});
if
(
res
.
Code
==
1
)
{
//地址赋值
proxy
.
$request
(
"/Video/GetPlayInfo"
,
{
strVid
:
x
.
VideoMeta
.
VideoId
}).
then
(
res
=>
{
if
(
res
.
Code
==
1
)
{
//地址赋值
data
.
InfoData
.
Review
[
data
.
current
].
videolist
.
push
(
res
.
Data
)
if
(
y
+
1
==
data
.
InfoData
.
Review
[
data
.
current
].
List
.
length
){
data
.
loading
=
false
}
}
}
})
},
swiperChange
(){
//当前选择视频全部暂停
let
trailer
=
data
.
InfoData
.
Review
[
data
.
current
].
videolist
// 获取视频列表
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment