|
@@ -457,6 +457,7 @@ Page({
|
|
|
let courseUrl = e.currentTarget.dataset.item.courseUrl //此课程的id
|
|
|
let courseName = e.currentTarget.dataset.item.courseName //此课程的id
|
|
|
let courseInfo = e.currentTarget.dataset.item.courseInfo //此课程的id
|
|
|
+ let courseitem=e.currentTarget.dataset.item
|
|
|
if (!this.data.istask2) {
|
|
|
wx.showModal({
|
|
|
showCancel: false,
|
|
@@ -499,9 +500,16 @@ Page({
|
|
|
// 没学或者没学完
|
|
|
if (e.currentTarget.dataset.item.isDone == 0) {
|
|
|
if (id == this.data.currentId) {
|
|
|
- wx.navigateTo({
|
|
|
- url: '../dbDetails/dbDetails?id=' + id
|
|
|
- })
|
|
|
+ if(courseitem.courseStart!=null&&this.checkStartTime(courseitem.courseStart)){
|
|
|
+ wx.showModal({
|
|
|
+ showCancel: false,
|
|
|
+ content: "课程学习的时间还没到"
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ wx.navigateTo({
|
|
|
+ url: '../dbDetails/dbDetails?id=' + id
|
|
|
+ })
|
|
|
+ }
|
|
|
} else {
|
|
|
wx.showModal({
|
|
|
showCancel: false,
|
|
@@ -515,12 +523,28 @@ Page({
|
|
|
})
|
|
|
}
|
|
|
} else {
|
|
|
- wx.navigateTo({
|
|
|
- url: '../dbDetails/dbDetails?id=' + id
|
|
|
- })
|
|
|
+ if(courseitem.courseStart!=null&&this.checkStartTime(courseitem.courseStart)){
|
|
|
+ wx.showModal({
|
|
|
+ showCancel: false,
|
|
|
+ content: "课程学习的时间还没到"
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ wx.navigateTo({
|
|
|
+ url: '../dbDetails/dbDetails?id=' + id
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
+ //checkStartTime
|
|
|
+ checkStartTime(str){
|
|
|
+ let date=Date.parse(str);
|
|
|
+ let t=new Date(date)
|
|
|
+ let n=new Date(Date.now());
|
|
|
+
|
|
|
+ return n<t;
|
|
|
+ },
|
|
|
// 去考试
|
|
|
gokhAnswer(e) {
|
|
|
if (!this.data.istask2) {
|