ssfg 5 years ago
parent
commit
e101176557
4 changed files with 58 additions and 71 deletions
  1. 26 3
      pages/index/index.js
  2. 19 32
      pages/myClass/myClass.js
  3. 12 35
      pages/myMission/myMission.js
  4. 1 1
      pages/testAnswer/testAnswer.js

+ 26 - 3
pages/index/index.js

@@ -128,6 +128,29 @@ Page({
       }
     })
   },
+  // 防止图片闪烁在onshow中调用这个判断一下
+  getBanner1(sessionKey) {
+    wx.request({
+      url: app.globalData.publicUrl + '/wx/student/selAllClas',
+      method: "post",
+      data: {
+        sessionKey: sessionKey
+      },
+      success: (res) => {
+        console.log(this.data.bnrUrl,res.data.data.claList)
+        if (this.data.bnrUrl.sort().toString() == res.data.data.claList.sort().toString()) {
+          console.log("我和上次一样")
+        } else {
+          console.log("我和上次不一样")
+          if (res.data.data.claList.length != 0) {
+            this.setData({
+              bnrUrl: res.data.data.claList
+            })
+          }
+        }
+      }
+    })
+  },
   // 即将开班
   getjjLength(sessionKey) {
     wx.request({
@@ -185,8 +208,6 @@ Page({
       url: app.globalData.publicUrl + '/wx/course/listCategory',
       method: "post",
       success: (res) => {
-        // console.log(JSON.stringify(this.data.xczsArr))
-        // console.log(JSON.stringify(res.data.list))
         if (this.data.xczsArr.sort().toString() == res.data.list.sort().toString()) {
           console.log("我和上次一样")
         } else {
@@ -253,7 +274,7 @@ Page({
   onReady: function () {},
   async onShow() {
     const sessionKey = await tools.checkSessionAndLogin();
-    this.getBanner(sessionKey);
+    this.getBanner1(sessionKey);
     this.getjjLength(sessionKey);
     this.getwqLength(sessionKey);
     this.getRedPoint1(sessionKey);
@@ -261,7 +282,9 @@ Page({
     this.getfour1();
   },
   async onLoad() {
+    const sessionKey = await tools.checkSessionAndLogin();
     // console.log("我调用了onShow")
     this.getfour();
+    this.getBanner(sessionKey);
   },
 })

+ 19 - 32
pages/myClass/myClass.js

@@ -23,7 +23,6 @@ Page({
   },
   // 查询我是否有班&&班级名字
   isClass(sessionKey) {
-    // let _this = this;
     wx.request({
       url: app.globalData.publicUrl + '/wx/student/selMyClas',
       method: "post",
@@ -42,7 +41,7 @@ Page({
           this.isAgree(sessionKey);
         } else {
           wx.showModal({
-            content: "您当前还没有开放的班级!",
+            content: "您当前还没有正在开放的班级!",
             showCancel: false,
             success(res) {
               if (res.confirm) {
@@ -392,13 +391,6 @@ Page({
   },
   // 去学习
   goStudy(e) {
-    if (!this.data.istask1) {
-      wx.showModal({
-        showCancel: false,
-        content: "请按照任务顺序执行哦!"
-      })
-      return false
-    }
     if (!this.data.istask) {
       wx.showModal({
         showCancel: false,
@@ -413,6 +405,13 @@ Page({
       })
       return false
     }
+    if (!this.data.istask1) {
+      wx.showModal({
+        showCancel: false,
+        content: "请先填写学员登记表再来学习哦!"
+      })
+      return false
+    }
     let id = e.currentTarget.dataset.item.id //此课程的id
     if (this.data.IngCourseArr.length == 0) {
       if (e.currentTarget.dataset.item.isLive == 1) {
@@ -478,7 +477,7 @@ Page({
     if (!this.data.istask1) {
       wx.showModal({
         showCancel: false,
-        content: "请按照任务顺序执行哦!"
+        content: "请先填写学员登记表再来学习哦!"
       })
       return false
     }
@@ -486,7 +485,7 @@ Page({
     if (isStudyDone != 1) {
       wx.showModal({
         showCancel: false,
-        content: "您的学习课程还未完成哦,请先完成学习任务后再来考试吧!"
+        content: "您的学习课程还未完成哦,请先完成再来考试吧!"
       })
       return false
     } else {
@@ -538,7 +537,7 @@ Page({
     if (!this.data.istask1) {
       wx.showModal({
         showCancel: false,
-        content: "请按照任务顺序执行哦!"
+        content: "请先填写学员登记表再来学习哦!"
       })
       return false
     }
@@ -546,7 +545,7 @@ Page({
     if (isStudyDone != 1) {
       wx.showModal({
         showCancel: false,
-        content: "您的学习课程还未完成哦,请先完成学习任务后再来评价吧!"
+        content: "您的学习课程还未完成哦,请先完成再来评价吧!"
       })
       return false
     } else {
@@ -634,7 +633,7 @@ Page({
     if (!this.data.istask2) {
       wx.showModal({
         showCancel: false,
-        content: "请按照任务顺序执行哦!"
+        content: "您的课程任务还未全部完成哦!请先去完成再来期末考试吧!"
       })
       return false
     }
@@ -690,20 +689,6 @@ Page({
   },
   // 综合反馈表
   goWrite2() {
-    if (!this.data.istask) {
-      wx.showModal({
-        showCancel: false,
-        content: "请先去扫描二维码加入班级群吧",
-        success(res) {
-          if (res.confirm) {
-            wx.switchTab({
-              url: '../myMission/myMission'
-            })
-          }
-        }
-      })
-      return false
-    }
     if (this.data.istask4) {
       wx.request({
         url: app.globalData.publicUrl + '/wx/exam/quesExamList',
@@ -786,7 +771,7 @@ Page({
     if (!this.data.istask3) {
       wx.showModal({
         showCancel: false,
-        content: "请按照任务顺序执行哦!"
+        content: "您的期末考试还未完成哦!"
       })
       return false
     }
@@ -888,18 +873,19 @@ Page({
           this.setData({
             status: res.data.status
           })
-          this.toPath(id, paperId, res.data.answersId, address, );
+          this.toPath(id, paperId, res.data.answersId, address);
         }
       }
     })
   },
   async onShow() {
     const sessionKey = await tools.checkSessionAndLogin();
-    this.isClass(sessionKey);
+    this.setData({
+      sessionKey: sessionKey
+    })
     this.getMycourse1(sessionKey);
     this.getMynotice(sessionKey);
     this.checkTaskList1(sessionKey)
-
   },
   async onLoad() {
     const sessionKey = await tools.checkSessionAndLogin();
@@ -907,5 +893,6 @@ Page({
       sessionKey: sessionKey
     })
     this.getMycourse(sessionKey);
+    this.isClass(sessionKey);
   }
 })

+ 12 - 35
pages/myMission/myMission.js

@@ -330,7 +330,7 @@ Page({
     if (this.data.istask1 == false) {
       wx.showModal({
         showCancel: false,
-        content: "请按照任务顺序执行哦!"
+        content: "请先去扫描班级二维码加入班级群吧!"
       })
       return false
     }
@@ -340,24 +340,10 @@ Page({
   },
   // 去学习
   goStudy(e) {
-    if (!this.data.istask1) {
+    if (!this.data.istask2) {
       wx.showModal({
         showCancel: false,
-        content: "请按照任务顺序执行哦!"
-      })
-      return false
-    }
-    if (!this.data.istask) {
-      wx.showModal({
-        showCancel: false,
-        content: "请先去扫描二维码加入班级群吧",
-        success(res) {
-          if (res.confirm) {
-            wx.switchTab({
-              url: '../myMission/myMission'
-            })
-          }
-        }
+        content: "请先去填写学院登记表吧!"
       })
       return false
     }
@@ -409,10 +395,10 @@ Page({
   },
   // 去考试
   gokhAnswer(e) {
-    if (this.data.istask2 == false) {
+    if (!this.data.istask2) {
       wx.showModal({
         showCancel: false,
-        content: "请按照任务顺序执行哦!"
+        content: "请先去填写学院登记表吧!"
       })
       return false
     }
@@ -455,10 +441,10 @@ Page({
   },
   //去评价
   gopjClass(e) {
-    if (this.data.istask2 == false) {
+    if (!this.data.istask2) {
       wx.showModal({
         showCancel: false,
-        content: "请按照任务顺序执行哦!"
+        content: "请先去填写学院登记表吧!"
       })
       return false
     }
@@ -504,10 +490,10 @@ Page({
   },
   // 期末考试
   goQmks() {
-    if (this.data.istask3 == false) {
+    if (!this.data.istask3) {
       wx.showModal({
         showCancel: false,
-        content: "请按照任务顺序执行哦!"
+        content: "请先完成所有的课程再来期末考试吧!"
       })
       return false
     }
@@ -562,15 +548,6 @@ Page({
   },
   // 综合反馈表
   goWrite2() {
-    // if (this.data.istask4 == false) {
-    //   wx.showModal({
-    //     showCancel: false,
-    //     content: "请按照任务顺序执行哦!"
-    //   })
-    //   return false
-    // }
-    // console.log(this.data.sessionKey, "dayin");
-    // console.log(this.data.classInfo.id);
     wx.request({
       url: app.globalData.publicUrl + '/wx/exam/quesExamList',
       method: "post",
@@ -637,10 +614,10 @@ Page({
   },
   // 领取结业证
   lq() {
-    if (this.data.istask4 == false) {
+    if (!this.data.istask4) {
       wx.showModal({
         showCancel: false,
-        content: "请按照任务顺序执行哦!"
+        content: "请先去期末考试再来领取结业证吧!"
       })
       return false
     }
@@ -680,7 +657,7 @@ Page({
     wx.hideLoading();
     this.setData({
       showzs: true,
-      istask5: true
+      istask6: true
     });
     wx.request({
       url: app.globalData.publicUrl + '/wx/student/wxGraduation',

+ 1 - 1
pages/testAnswer/testAnswer.js

@@ -125,7 +125,7 @@ Page({
     })
 
   },
-  async onLoad() {
+  async onShow() {
     const sessionKey = await tools.checkSessionAndLogin();
     //const sessionKey = 'yoa0rZTt2bAiTVDsiRjysw==';
     this.setData({