Commit 6cca94d2 authored by 黄奎's avatar 黄奎

页面修改

parent 69b2bcf5
...@@ -5,7 +5,8 @@ ...@@ -5,7 +5,8 @@
<view class="course-name"> <view class="course-name">
{{stuCourseList[0].CourseName}} {{stuCourseList[0].CourseName}}
</view> </view>
<van-progress percentage="75" :show-pivot="false" track-color="#EFEFEF" color="#282828" stroke-width="5" /> <van-progress :percentage="calcPercentage(stuCourseList[0])" :show-pivot="false" track-color="#EFEFEF" color="#282828"
stroke-width="5" />
<view class="course-progress"> <view class="course-progress">
上课进度 {{stuCourseList[0].CompleteNum}}/{{stuCourseList[0].TotalClassNum}} 上课进度 {{stuCourseList[0].CompleteNum}}/{{stuCourseList[0].TotalClassNum}}
</view> </view>
...@@ -44,7 +45,8 @@ ...@@ -44,7 +45,8 @@
<view class="one_line course-name"> <view class="one_line course-name">
{{item.CourseName}} {{item.CourseName}}
</view> </view>
<van-progress percentage="46" :show-pivot="false" track-color="#EFEFEF" color="#282828" stroke-width="5" /> <van-progress :percentage="calcPercentage(item)" :show-pivot="false" track-color="#EFEFEF" color="#282828"
stroke-width="5" />
<view class="course-progress"> <view class="course-progress">
上课进度 {{item.CompleteNum}}/{{item.TotalClassNum}} 上课进度 {{item.CompleteNum}}/{{item.TotalClassNum}}
</view> </view>
...@@ -81,15 +83,26 @@ ...@@ -81,15 +83,26 @@
let data = reactive({ let data = reactive({
statusBarHeight: 24, statusBarHeight: 24,
showItems: false, showItems: false,
}); });
let methods = { let methods = {
exchangeItemHandler() { exchangeItemHandler() {
data.showItems = true data.showItems = true
}, },
//点击切换课程
hideExchangeBoxHandler(item) { hideExchangeBoxHandler(item) {
//调用父页面方法
this.$parent.getStuHomeWorkAndExam(item.courseId); this.$parent.getStuHomeWorkAndExam(item.courseId);
data.showItems = false data.showItems = false
},
//计算完成百分比
calcPercentage(item) {
let percent = 0;
if (item) {
if (item.TotalClassNum > 0) {
percent = Number(item.CompleteNum / item.TotalClassNum) * 100
}
}
return percent;
} }
} }
return { return {
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
<view class="index-student-information"> <view class="index-student-information">
<template v-for="(item,index) in workList"> <template v-for="(item,index) in workList">
<JobComponents v-if="item.ResultType==1" :jobData="item"></JobComponents> <JobComponents v-if="item.ResultType==1" :jobData="item"></JobComponents>
<examComponents v-if="item.ResultType==2">></examComponents> <examComponents v-if="item.ResultType==2" :jobData="item"></examComponents>
<commentsComponents v-if="item.ResultType==3" :jobData="item"></commentsComponents> <commentsComponents v-if="item.ResultType==3" :jobData="item"></commentsComponents>
</template> </template>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment