Commit 4d27df41 authored by zhangjianqian's avatar zhangjianqian

过期判断

parent 460f791c
......@@ -254,7 +254,12 @@ public class TTrainCourseServiceImpl implements ITTrainCourseService
@Override
public TTrainUserCourse getUserCourse(Long userCourseId){
return tTrainUserCourseMapper.selectTTrainUserCourseById(userCourseId);
TTrainUserCourse userCourse = tTrainUserCourseMapper.selectTTrainUserCourseById(userCourseId);
TTrainCourse v = tTrainCourseMapper.selectTTrainCourseById(userCourse.getCourseId());
if(v.getTestEndTime()!=null&&v.getTestEndTime().getTime()<new Date().getTime()){
userCourse.setState(3);
}
return userCourse;
}
......
......@@ -11,7 +11,8 @@
<div class="top-title">
<div class="item allone">
<div class="text">{{ state != 2 ? "学习课程" : "查看课程" }}</div>
<div class="gotime">{{minute}}:{{calculation(second)}}/{{parseInt(lessonData.duration/60)}}:{{calculation(lessonData.duration%60)}}</div>
<div v-if="userlessonData.state!=3" class="gotime">{{minute}}:{{calculation(second)}}/{{parseInt(lessonData.duration/60)}}:{{calculation(lessonData.duration%60)}}</div>
<div v-if="userlessonData.state==3" style="background: red" class="gotime"> 已过期 </div>
</div>
<div class="bt flex fz14 border-bottom">
......@@ -190,10 +191,12 @@ export default {
getUserLessonById({"userCourseId":userCourseId}).then((res) => {
if (res.code == 200) {
this.userlessonData = res.data;
console.log(this.userlessonData);
this.second = this.userlessonData.finishDuration%60;
this.minute = parseInt( this.userlessonData.finishDuration/60);
this.dingshi = setInterval(this.goTime,1000);
if(this.userlessonData.state!=3){
this.dingshi = setInterval(this.goTime,1000);
}
}
});
......
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