Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
thinkApp
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
游洁
thinkApp
Commits
8ea1f17e
Commit
8ea1f17e
authored
May 27, 2022
by
liudong1993
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://gitlab.oytour.com/youjie/thinkapp
parents
5d2331fa
90be3484
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
11 deletions
+19
-11
course-card.vue
src/components/index/course-card.vue
+19
-11
No files found.
src/components/index/course-card.vue
View file @
8ea1f17e
<
template
>
<view
class=
"course-card"
>
<view
class=
"course-item"
>
<view
class=
"course-item"
v-if=
"currentCourse"
>
<view
style=
"width:287rpx;"
>
<view
class=
"course-name"
>
{{
stuCourseList
[
0
]
.
CourseName
}}
{{
currentCourse
.
CourseName
}}
</view>
<van-progress
:percentage=
"calcPercentage(
stuCourseList[0]
)"
:show-pivot=
"false"
track-color=
"#EFEFEF"
color=
"#282828"
<van-progress
:percentage=
"calcPercentage(
currentCourse
)"
:show-pivot=
"false"
track-color=
"#EFEFEF"
color=
"#282828"
stroke-width=
"5"
/>
<view
class=
"course-progress"
>
上课进度
{{
stuCourseList
[
0
].
CompleteNum
}}
/
{{
stuCourseList
[
0
]
.
TotalClassNum
}}
上课进度
{{
currentCourse
.
CompleteNum
}}
/
{{
currentCourse
.
TotalClassNum
}}
</view>
<view
class=
"course-opera"
>
<van-button
@
click=
"exchangeItemHandler"
class-prefix=
"iconfont"
icon=
" icon-qiehuan1"
round
type=
"default"
size=
"mini"
...
...
@@ -16,8 +16,8 @@
</van-button>
</view>
</view>
<template
v-if=
"
stuCourseList[0]
.CoverImg"
>
<image
class=
"illustration"
:src=
"
stuCourseList[0]
.CoverImg"
mode=
"widthFix"
></image>
<template
v-if=
"
currentCourse
.CoverImg"
>
<image
class=
"illustration"
:src=
"
currentCourse
.CoverImg"
mode=
"widthFix"
></image>
</
template
>
<
template
v-else
>
<image
class=
"illustration"
src=
"https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Test/Upload/Goods/1653464014000_494.png"
...
...
@@ -27,7 +27,6 @@
</view>
<image
class=
"end"
src=
"https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Test/Upload/Goods/1653464014000_413.png"
mode=
"widthFix"
></image>
<van-popup
:show=
"showItems"
round
position=
"bottom"
@
click-overlay=
"hideExchangeBoxHandler"
custom-style=
"height: 60%"
>
<view
class=
"exchange-items"
>
<view
class=
"title-box"
>
...
...
@@ -61,9 +60,7 @@
</view>
</view>
</van-popup>
</view>
</template>
<
script
>
...
...
@@ -83,8 +80,9 @@
let
data
=
reactive
({
statusBarHeight
:
24
,
showItems
:
false
,
currentCourse
:{}
currentCourse
:
{}
});
let
methods
=
{
exchangeItemHandler
()
{
data
.
showItems
=
true
...
...
@@ -93,6 +91,7 @@
hideExchangeBoxHandler
(
item
)
{
//调用父页面方法
this
.
$parent
.
getStuHomeWorkAndExam
(
item
.
courseId
);
this
.
currentCourse
=
item
;
data
.
showItems
=
false
},
//计算完成百分比
...
...
@@ -104,8 +103,17 @@
}
}
return
percent
;
},
};
//监听属性数组
watch
(()
=>
props
[
"stuCourseList"
],
(
newValue
,
oldValue
)
=>
{
if
(
newValue
!=
oldValue
&&
newValue
&&
newValue
.
length
>
0
)
{
data
.
currentCourse
=
newValue
[
0
];
}
}
},
{
deep
:
true
,
});
return
{
...
toRefs
(
data
),
...
methods
...
...
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