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
df37306d
Commit
df37306d
authored
Jan 10, 2022
by
zhengke
Browse files
Options
Browse Files
Download
Plain Diff
1
parents
f0f33742
b09fe3e9
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
654 additions
and
20 deletions
+654
-20
study.js
src/api/study.js
+34
-0
indexassembly.vue
src/pages/index/components/indexassembly.vue
+5
-3
index.vue
src/pages/index/index.vue
+13
-7
vear-carousel.vue
src/pages/study/components/vear-carousel/vear-carousel.vue
+201
-0
index.vue
src/pages/study/index.vue
+401
-10
xingxing.png
src/static/image/xingxing.png
+0
-0
No files found.
src/api/study.js
View file @
df37306d
...
...
@@ -18,6 +18,40 @@ export function getMyStudyCourseList(data) {
export
function
GetMyStudyCourseChapterList
(
data
)
{
return
request
({
url
:
'/AppletIndex/GetMyStudyCourseChapterList'
,
method
:
'post'
,
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
})
...
...
src/pages/index/components/indexassembly.vue
View file @
df37306d
<
template
>
<view
class=
"indexassembly"
>
<view>
登录
<slot>
登录
</slot>
<button
class=
"hotsopt"
style=
""
open-type=
"getUserInfo"
@
tap=
"getUserProfile()"
></button>
</view>
...
...
@@ -133,7 +135,7 @@
})
if
(
res
&&
res
.
Data
.
phoneNumber
)
{
data
.
obj
.
phoneNum
=
res
.
Data
.
phoneNumber
// data.obj.phoneNum = '1
9138490577
'
// data.obj.phoneNum = '1
8328620563
'
data
.
obj
.
openid
=
res
.
Data
.
openid
data
.
obj
.
unionid
=
res
.
Data
.
unionid
that
.
phoneNumLogin
()
...
...
@@ -205,7 +207,7 @@
</
script
>
<
style
scoped
>
.indexassembly
{
width
:
200
rpx
;
/* width: 200rpx; */
height
:
60
rpx
;
line-height
:
60
rpx
;
}
...
...
src/pages/index/index.vue
View file @
df37306d
...
...
@@ -6,10 +6,16 @@
首页
</view>
<view
class=
"loginBox"
>
<image
src=
"https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/login2x.png"
mode=
"aspectFit"
class=
"loginIcon"
id=
"loadImg"
></image>
登录
<indexassembly
@
success=
'againdata'
>
<view
class=
"flex_start_center"
>
<image
src=
"https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/login2x.png"
mode=
"aspectFit"
class=
"loginIcon"
id=
"loadImg"
></image>
登录
</view>
</indexassembly>
</view>
<view
class=
"scanBox"
>
<image
src=
"https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/scan2x.png"
mode=
"aspectFit"
class=
"scanIcon"
></image>
...
...
@@ -97,10 +103,10 @@
</view>
<view
class=
"gardenCon"
v-for=
"(item1,index1) in item.List"
:key=
"index1"
id=
"img"
>
<image
:src=
"item1.Img"
mode=
"aspectFill"
style=
"width: 100%;height:100%;border-radius: 24rpx 24rpx 0 0;"
></image>
style=
"width: 100%;height:100%;border-radius: 24rpx 24rpx 0 0;"
></image>
<view
class=
"gardenTextBox"
:style=
"
{background:'linear-gradient(0deg,'+getColor(item1.Img)}">
<view
class=
"gardenTitle one_line"
>
<!--
{{
item1
.
Title
}}
-->
{{
item1
.
Title
}}
{{
getColor
(
item1
.
Img
)
}}
</view>
<view
class=
"gardenDigest one_line"
>
...
...
@@ -178,8 +184,8 @@
})
},
async
getColor
(
src
)
{
let
res
=
await
getImageColor
(
'myCanvas'
,
'img'
,
src
)
const
formatres
=
`rgba(
${
res
.
r
}
,
${
res
.
g
}
,
${
res
.
b
}
)`
let
res
=
await
getImageColor
(
'myCanvas'
,
'img'
,
src
)
const
formatres
=
`rgba(
${
res
.
r
}
,
${
res
.
g
}
,
${
res
.
b
}
)`
console
.
log
(
168
,
formatres
)
return
formatres
}
...
...
src/pages/study/components/vear-carousel/vear-carousel.vue
0 → 100644
View file @
df37306d
<
template
>
<swiper
class=
"image-container"
previous-margin=
"45rpx"
next-margin=
"45rpx"
:indicator-dots=
"true"
indicator-active-color=
'#4C50E7'
@
change=
"swiperChange"
>
<swiper-item
:class=
"currentIndex == index ? 'swiper-item' : 'swiper-item-side'"
v-for=
"(item, index) in imgList"
:key=
"item[urlKey]"
>
<!--
<image
@
click=
"clickImg(item)"
:class=
"currentIndex == index ? 'item-img' : 'item-img-side'"
:src=
"item[urlKey]"
lazy-load
:style=
"dontFirstAnimation ? 'animation: none;' : ''"
mode=
"aspectFill"
></image>
-->
<view
class=
"box"
:class=
"currentIndex == index ? 'item-img' : 'item-img-side'"
:style=
"
{background:item.B2BBackground ? getOpacityColor(item.B2BBackground,0.3):'#FFF',}">
<view
class=
"box-state"
>
<span
v-if=
"item.ClassStatus==1"
>
未开班
</span>
<span
v-if=
"item.ClassStatus==2"
>
学习中
</span>
<span
v-if=
"item.ClassStatus==3"
>
已结课
</span>
</view>
<view
class=
"box-center"
>
<view
class=
"box-center-l"
:style=
"
{background:item.B2BBackground ? getOpacityColor(item.B2BBackground,0.7):'#FFF',}">
<image
mode=
'widthFix'
:src=
"item.B2BIcon"
></image>
</view>
<view
class=
"box-center-r"
>
<view>
<view
style=
"font-size: 15px;font-weight: bold;"
>
{{
item
.
CourseName
}}
</view>
<view
style=
"font-size: 12px;font-weight: 500;margin-top: 5px;"
>
{{
item
.
ClassName
}}
</view>
<view
class=
"row"
style=
"font-size: 12px;margin-top: 5px;"
>
<view
class=
"row"
>
总计
<span
style=
"color: #4C50E7;margin:0 3px;font-weight: bold;"
>
{{
item
.
TotalHours
}}
</span>
课时
</view>
<view
style=
"width: 1px;height: 15px;background-color:#999999;margin: 0 10px;"
></view>
<view
class=
"row"
>
剩余
<span
style=
"color: #4C50E7;margin:0 3px;font-weight: bold;"
>
{{
item
.
SurplusHours
}}
</span>
课时
</view>
</view>
</view>
<view>
<view
class=
"row"
style=
"justify-content: space-between;font-size: 11px;"
>
<span>
已学课程
</span>
<span>
{{
item
.
CompleteHours
}}
/
{{
item
.
TotalHours
}}
</span>
</view>
<van-progress
:percentage=
"(item.CompleteHours/item.TotalHours)*100"
:showPivot=
'false'
/>
</view>
</view>
</view>
</view>
</swiper-item>
</swiper>
</
template
>
<
script
>
export
default
{
props
:
{
imgList
:
{
type
:
Array
,
default
()
{
return
[]
}
},
urlKey
:
{
type
:
String
,
default
()
{
return
''
}
},
},
data
()
{
return
{
currentIndex
:
0
,
dontFirstAnimation
:
true
}
},
methods
:
{
swiperChange
(
e
)
{
this
.
dontFirstAnimation
=
false
this
.
currentIndex
=
e
.
detail
.
current
;
this
.
$emit
(
'selected'
,
this
.
currentIndex
)
},
clickImg
(
item
)
{
this
.
$emit
(
'selected'
,
item
,
this
.
currentIndex
)
},
getOpacityColor
(
thisColor
,
thisOpacity
){
var
theColor
=
thisColor
.
toLowerCase
();
//十六进制颜色值的正则表达式
var
r
=
/^#
([
0-9a-fA-f
]{3}
|
[
0-9a-fA-f
]{6})
$/
;
// 如果是16进制颜色
if
(
theColor
&&
r
.
test
(
theColor
))
{
if
(
theColor
.
length
===
4
)
{
var
sColorNew
=
"#"
;
for
(
var
i
=
1
;
i
<
4
;
i
+=
1
)
{
sColorNew
+=
theColor
.
slice
(
i
,
i
+
1
).
concat
(
theColor
.
slice
(
i
,
i
+
1
));
}
theColor
=
sColorNew
;
}
//处理六位的颜色值
var
sColorChange
=
[];
for
(
var
i
=
1
;
i
<
7
;
i
+=
2
)
{
sColorChange
.
push
(
parseInt
(
"0x"
+
theColor
.
slice
(
i
,
i
+
2
)));
}
return
"rgba("
+
sColorChange
.
join
(
","
)
+
","
+
thisOpacity
+
")"
;
// return "rgba(" + sColorChange.join(",") + ", 0.7)";
}
return
theColor
;
}
}
}
</
script
>
<
style
scoped
>
.image-container
{
width
:
750
rpx
;
height
:
350
rpx
;
}
.item-img
{
width
:
630
rpx
;
height
:
300
rpx
;
border-radius
:
14
rpx
;
animation
:
to-big
.3s
;
}
.swiper-item
{
width
:
630
rpx
;
height
:
300
rpx
;
display
:
flex
;
justify-content
:
center
;
align-items
:
center
;
}
.item-img-side
{
width
:
630
rpx
;
height
:
260
rpx
;
border-radius
:
14
rpx
;
animation
:
to-mini
.3s
;
}
.swiper-item-side
{
width
:
630
rpx
;
height
:
260
rpx
;
display
:
flex
;
justify-content
:
center
;
align-items
:
center
;
}
.box
{
position
:
relative
;
display
:
flex
;
align-items
:
center
;
justify-content
:
center
;
/* padding: 0 20rpx; */
}
.box-center
{
display
:
flex
;
align-items
:
center
;
justify-content
:
space-between
;
width
:
calc
(
100%
-
36
rpx
);
}
.box-center-l
{
width
:
162
rpx
;
height
:
208
rpx
;
border-radius
:
6px
;
position
:
relative
;
}
.box-center-l
image
{
position
:
absolute
;
bottom
:
10
rpx
;
right
:
10
rpx
;
max-width
:
100
rpx
;
height
:
auto
;
}
.box-center-r
{
flex
:
1
;
margin-left
:
12px
;
min-height
:
208
rpx
;
display
:
flex
;
flex-direction
:
column
;
justify-content
:
space-between
;
}
.row
{
display
:
flex
;
align-items
:
center
;
}
.box-state
{
width
:
36
rpx
;
height
:
88
rpx
;
position
:
absolute
;
right
:
17px
;
top
:
0
;
background
:
#5DE3A6
;
font-size
:
20
rpx
;
color
:
#333333
;
text-align
:
center
;
}
@keyframes
to-mini
{
from
{
height
:
300
rpx
;
}
to
{
height
:
260
rpx
;
}
}
@keyframes
to-big
{
from
{
height
:
260
rpx
;
}
to
{
height
:
300
rpx
;
}
}
</
style
>
src/pages/study/index.vue
View file @
df37306d
...
...
@@ -3,23 +3,178 @@
width
:
100%
;
height
:
100vh
;
background
:
#F5F5F5
;
overflow-y
:
auto
;
}
.row
{
display
:
flex
;
align-items
:
center
;
}
.page-title
{
font-size
:
44
rpx
;
font-family
:
PingFang
SC
;
font-weight
:
bold
;
color
:
#0f1b35
;
}
.curriculum
{
width
:
100%
;
}
.box
{
padding
:
100
rpx
0
rpx
50
rpx
;
}
.box-top
{
width
:
100%
;
}
.box_t
{
padding
:
18px
;
}
.box_tb
{
height
:
388
rpx
;
background
:
#FFFFFF
;
border-radius
:
12px
;
padding
:
15px
;
}
.box_tb_c
{
width
:
50%
;
display
:
flex
;
flex-direction
:
column
;
align-items
:
center
;
padding
:
46
rpx
;
}
.box_tb_c
span
{
font-size
:
12px
;
color
:
#666666
;
}
.box_tb_c
text
{
font-size
:
11px
;
color
:
#111111
;
font-weight
:
bold
;
}
.box_tb_b
{
display
:
flex
;
flex-direction
:
column
;
align-items
:
center
;
margin-top
:
5px
;
}
.box_tb_b
.btn
{
width
:
130
rpx
;
height
:
50
rpx
;
display
:
flex
;
align-items
:
center
;
justify-content
:
center
;
font-size
:
11px
;
border-radius
:
26
rpx
;
background
:
#4C50E7
;
color
:
#FFFFFF
;
margin-top
:
7px
;
}
.box_review
{
background
:
#EBEBEB
;
padding
:
18px
;
margin-top
:
10px
;
}
.box_review_date_item
{
width
:
calc
((
100vw
-
36px
)/
7
);
display
:
flex
;
flex-direction
:
column
;
align-items
:
center
;
justify-content
:
center
;
font-size
:
17px
;
color
:
#999999
;
height
:
140
rpx
;
border-radius
:
12px
12px
0px
0px
;
}
.box_review_date_item2
{
background
:
#4C50E7
;
color
:
#FFF
;
font-weight
:
bold
;
}
.box_review_sp
{
height
:
420
rpx
;
border-radius
:
12px
;
background
:
linear-gradient
(
to
bottom
,
#4C50E7
,
#FFFFFF
);
padding
:
5px
;
margin-top
:
-5px
;
}
.box_review_box
{
background
:
#000000
;
display
:
flex
;
align-items
:
center
;
justify-content
:
center
;
font-size
:
14px
;
color
:
#FFF
;
height
:
100%
;
border-radius
:
12px
;
}
.box_review_swiper
{
width
:
calc
(
100vw
-
36px
-
10px
);
height
:
380
rpx
;
}
.myVideo
{
width
:
100%
;
height
:
100%
;
}
.examination
{
margin-top
:
25px
;
}
.examination-box
{
background
:
#FFF
;
margin
:
10px
0
;
}
.examination-box-c
{
height
:
170
rpx
;
background
:
#F9F9F9
;
display
:
flex
;
padding
:
10px
0
;
}
.examination-box-c-item
{
width
:
200
rpx
;
height
:
100%
;
display
:
flex
;
flex-direction
:
column
;
align-items
:
center
;
justify-content
:
space-around
;
font-size
:
12px
;
color
:
#8F8F92
;
}
.examination-box-c-item
.item_o
{
color
:
#A3A3A3
;
}
.examination-box-c-item
.item_t
{
color
:
#A3A3A3
;
font-size
:
19px
;
font-weight
:
bold
;
}
.shuxian
{
width
:
1px
;
padding
:
20px
0
;
}
.examination-box-btnbox
{
width
:
100%
;
display
:
flex
;
align-items
:
center
;
justify-content
:
center
;
}
.examination-btn
{
width
:
150
rpx
;
height
:
60
rpx
;
border-radius
:
30
rpx
;
background
:
#4C50E7
;
display
:
flex
;
align-items
:
center
;
justify-content
:
center
;
font-size
:
12px
;
font-weight
:
bold
;
color
:
#FFF
;
margin
:
20px
0
;
}
</
style
>
<
template
>
<view
class=
"studyindex"
>
...
...
@@ -28,40 +183,272 @@
</van-nav-bar>
<view
class=
"curriculum"
>
<template
v-if=
"CourseList.length==0"
>
<!-- 无数据的显示 -->
<indexNo></indexNo>
</
template
>
<
template
v-if=
"CourseList.length>0"
>
<view
class=
"box"
:style=
"
{ 'margin-top': `${statusBarHeight}px` }">
<view
class=
"box-top"
>
<carousel
:img-list=
"CourseList"
url-key=
"B2BIcon"
@
selected=
'selectedBanner'
></carousel>
</view>
</view>
<view
class=
"box_t"
>
<view
class=
"box_tb"
>
<view
class=
"row"
style=
"justify-content: space-between;"
>
<view
class=
"row"
style=
"color: #111111;font-size: 14px;font-weight: bold;"
>
<view
>
单词积分
</view>
<view
style=
"margin-left: 5px;"
>
80
</view>
<image
style=
"width: 17px;height: 16px;margin-left: 10px;"
src=
"../../static/image/xingxing.png"
></image>
</view>
<view
style=
"font-size: 11px;color: #4C50E7;"
>
所有单词
</view>
</view>
<view
class=
"row"
style=
"justify-content: space-around;"
>
<view
class=
"box_tb_c"
>
<span>
下节单词
</span>
<view
class=
"row"
style=
"align-items: flex-end;"
>
<text
style=
"font-size: 78rpx;font-style: italic"
>
{{
InfoData
.
Words
.
NextWord
}}
</text>
<text
style=
"margin-left: 5px;margin-bottom: 10px;"
>
词
</text>
</view>
</view>
<view
class=
"box_tb_c"
>
<span>
需要复习
</span>
<view
class=
"row"
style=
"align-items: flex-end;"
>
<text
style=
"font-size: 78rpx;font-style: italic"
>
{{
InfoData
.
Words
.
ReviewWord
}}
</text>
<text
style=
"margin-left: 5px;margin-bottom: 10px;"
>
词
</text>
</view>
</view>
</view>
<view
class=
"box_tb_b"
>
<view
style=
"font-size: 11px;color: #999999;"
>
预计用时10分钟
</view>
<view
class=
"btn"
>
立即学习
</view>
</view>
</view>
</view>
<view
class=
"box_review"
v-if=
'InfoData'
>
<view
class=
"row"
style=
"justify-content: space-between;"
>
<view
class=
"row"
style=
"color: #111111;font-size: 14px;font-weight: bold;"
>
<view
>
课程回顾
</view>
<view
style=
"font-size: 10px;color: #999999;"
>
(最近7天课程)
</view>
</view>
<view
style=
"font-size: 11px;color: #4C50E7;"
>
所有课程
</view>
</view>
<view
class=
"box_review_date row"
style=
"margin-top: 20px;"
v-if=
'InfoData.Review'
>
<view
v-for=
"(x,y) in InfoData.Review"
:key=
'y'
>
<view
:class=
"
{'box_review_date_item2':current==y}" class="box_review_date_item" @click="goreview(x,y)">
<text>
{{
getdate
(
x
,
1
)
}}
</text>
<text
style=
"font-size: 11px;margin-top: 5px;"
>
{{
getdate
(
x
,
2
)
}}
</text>
</view>
</view>
</view>
<view
class=
"box_review_sp"
>
<view
class=
"box_review_box"
v-if=
"loading"
>
<van-loading
size=
"24px"
vertical
color=
"#FFF"
text-color=
"#FFF"
>
加载中...
</van-loading>
</view>
<view
class=
"box_review_box"
v-if=
"!loading"
>
<view
v-if=
"InfoData.Review[current].videolist.length==0"
>
暂无回顾视频...
</view>
<template
v-if=
"InfoData.Review[current].videolist.length>0"
>
<swiper
class=
"box_review_swiper"
@
change=
"swiperChange"
>
<swiper-item
style=
"width: 100%;height: 100%;"
v-for=
"(item, index) in InfoData.Review[current].videolist"
:key=
"index"
>
<video
class=
"myVideo"
:id=
"'Video'+current+'-'+index"
:src=
"item.URL"
controls
></video>
</swiper-item>
</swiper>
</
template
>
</view>
</view>
</view>
<view
class=
"examination"
v-if=
'InfoData'
>
<view
style=
"padding: 0 20px;"
>
<view
style=
"color: #666666;font-size: 14px;"
>
加油哦!
</view>
<view
class=
"row"
style=
"justify-content: space-between;margin-top: 9px;"
>
<view
class=
"row"
style=
"color: #111111;font-size: 23px;font-weight: bold;"
>
考试
</view>
<view
style=
"font-size: 14px;color: #4C50E7;"
>
更多试题
</view>
</view>
</view>
<view
v-for=
"(x,y) in InfoData.ExamList"
:key=
'y'
>
<view
class=
"examination-box"
>
<view
style=
"padding: 20px;"
>
<view
style=
"font-size: 18px;font-weight: bold;color: #111111;"
>
{{x.PaperName}}
</view>
<view
style=
"font-size: 12px;font-weight: 500;color: #999999;margin-top: 9px;"
>
测评次数:5次
</view>
</view>
<view
style=
"overflow-x:auto;width:100%;white-space:nowrap;"
>
<view
class=
"examination-box-c"
>
<view
class=
"examination-box-c-item"
>
<text
class=
"item_o"
>
我的排名
</text>
<text
class=
"item_t"
>
#{{x.MyRank}}
</text>
<text
class=
""
>
分数
</text>
</view>
<view
class=
"shuxian"
>
<view
style=
"width: 1px;height: 100%;background: #E1E1E1;"
></view></view>
<view
class=
"examination-box-c-item"
>
<text
class=
"item_o"
>
我的得分
</text>
<text
class=
"item_t"
>
{{x.TotalScore}}
</text>
<text
class=
""
>
分
</text>
</view>
<view
class=
"shuxian"
>
<view
style=
"width: 1px;height: 100%;background: #E1E1E1;"
></view></view>
<view
class=
"examination-box-c-item"
>
<text
class=
"item_o"
>
考试状态
</text>
<text
class=
"item_t"
style=
"font-size: 14px;"
>
{{x.ExamStatusStr}}
</text>
<text
class=
""
style=
"opacity: 0;"
>
.
</text>
</view>
<view
class=
"shuxian"
>
<view
style=
"width: 1px;height: 100%;background: #E1E1E1;"
></view></view>
<view
class=
"examination-box-c-item"
>
<text
class=
"item_o"
>
我的耗时
</text>
<text
class=
"item_t"
>
#{{x.ExamSecondTime}}
</text>
<text
class=
""
>
秒
</text>
</view>
<view
class=
"shuxian"
>
<view
style=
"width: 1px;height: 100%;background: #E1E1E1;"
></view></view>
<view
class=
"examination-box-c-item"
>
<text
class=
"item_o"
>
最高等分
</text>
<text
class=
"item_t"
>
#{{x.MaxScore}}
</text>
<text
class=
""
>
分
</text>
</view>
<view
class=
"shuxian"
>
<view
style=
"width: 1px;height: 100%;background: #E1E1E1;"
></view></view>
</view>
</view>
<view
class=
"examination-box-btnbox"
>
<view
class=
"examination-btn"
>
开始测试
</view>
</view>
</view>
</view>
</view>
</template>
</view>
<bottom></bottom>
</view>
</template>
<
script
>
import
indexNo
from
'./components/indexNo.vue'
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
,
bottom
,
carousel
},
setup
(
props
)
{
let
data
=
reactive
({
CourseList
:[],
//课程列表
statusBarHeight
:
0
,
CourseInfoMsg
:{
ClassId
:
0
,
GuestId
:
0
,
},
InfoData
:
null
,
current
:
0
,
loading
:
false
,
//获取视频加载中
})
let
methods
=
{
async
getCourseList
()
{
let
res
=
await
getMyStudyCourseList
({});
if
(
res
.
resultCode
==
1
)
{
console
.
log
(
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
)
{
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
;
that
.
getCourseInfo
()
},
goreview
(
x
,
y
){
//回顾选择
that
.
swiperChange
()
//让当前页面的视频暂停
data
.
current
=
y
;
that
.
getvideo
()
},
getvideo
(){
if
(
data
.
InfoData
.
Review
[
data
.
current
].
videolist
.
length
==
0
){
let
datalist
=
data
.
InfoData
.
Review
[
data
.
current
].
List
if
(
datalist
.
length
>
0
){
data
.
loading
=
true
datalist
.
forEach
((
x
,
y
)
=>
{
that
.
getvideoId
(
x
,
y
)
})
}
}
},
async
getvideoId
(
x
,
y
)
{
//获取视频id
if
(
x
.
VideoUrl
){
//判断是否有视频id
let
res
=
await
getVideoPlayAuth
({
strVid
:
x
.
VideoUrl
});
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
)
{
//地址赋值
data
.
InfoData
.
Review
[
data
.
current
].
videolist
.
push
(
res
.
Data
)
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
// 获取视频列表
if
(
trailer
.
length
>
0
){
trailer
.
forEach
((
item
,
index
)
=>
{
if
(
item
.
URL
!=
null
&&
item
.
URL
!=
''
){
let
temp
=
'Video'
+
data
.
current
+
'-'
+
index
;
// 暂停其他视频
uni
.
createVideoContext
(
temp
,
this
).
pause
()
}
})
}
},
getdate
(
x
,
type
){
//获取月和天
let
day
=
''
,
month
=
''
;
if
(
type
==
1
){
day
=
x
.
ClassDate
.
split
(
'-'
)[
2
]
return
day
}
else
{
month
=
x
.
ClassDate
.
split
(
'-'
)[
1
]
month
=
Number
(
month
)
+
'月'
return
month
}
}
}
onMounted
(()
=>
{
that
.
getCourseList
()
//我的课程列表
data
.
statusBarHeight
=
uni
.
getSystemInfoSync
().
statusBarHeight
;
})
let
that
=
methods
;
...
...
@@ -69,7 +456,11 @@
...
toRefs
(
data
),
...
methods
,
};
}
},
onShow
()
{
this
.
getCourseList
()
//我的课程列表
},
}
</
script
>
...
...
src/static/image/xingxing.png
0 → 100644
View file @
df37306d
944 Bytes
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