ssfg 4 лет назад
Родитель
Сommit
ed645323e9

+ 9 - 7
app.json

@@ -1,6 +1,12 @@
 {
   "pages": [
     "pages/welcome/welcome",
+    "pages/Identitycopy/Identitycopy",
+    "pages/Identity/Identity",
+    "pages/dbDetails/dbDetails",
+    "pages/demandCourses/demandCourses",
+    "pages/myInteractions/myInteractions",
+    "pages/testAnswer/testAnswer",
     "pages/myMission/myMission",
     "pages/myClass/myClass",
     "pages/studentList/studentList",
@@ -8,9 +14,7 @@
     "pages/userGuide/userGuide",
     "pages/groupsList/groupsList",
     "pages/schoolIntrouce/schoolIntrouce",
-    "pages/testAnswer/testAnswer",
     "pages/InteractiveQA/InteractiveQA",
-    "pages/demandCourses/demandCourses",
     "pages/studentRegistration/studentRegistration",
     "pages/zbDetails/zbDetails",
     "pages/last/last",
@@ -26,19 +30,17 @@
     "pages/evaluationCourseDetail/evaluationCourseDetail",
     "pages/historyClass/historyClass",
     "pages/onlineClass/onlineClass",
-    "pages/dbDetails/dbDetails",
     "pages/dbVideo/dbVideo",
     "pages/myNotice/myNotice",
-    "pages/myInteractions/myInteractions",
-    
     "pages/exhibitionList/exhibitionList",
     "pages/startClass/startClass",
     "pages/myInteractionsDetais/myInteractionsDetais",
     "pages/myPoints/myPoints",
-    "pages/Identity/Identity",
+  
     "pages/myTraining/myTraining",
     "pages/agoClass/agoClass",
-    "pages/grade/grade"
+    "pages/grade/grade",
+    "pages/livePlayback/livePlayback"
   ],
   "window": {
     "backgroundTextStyle": "light",

BIN
images/rsww.png


+ 23 - 5
pages/Identity/Identity.js

@@ -1,6 +1,7 @@
 const app = require('../../utils/util.js');
 const tools = require('../../utils/tools.js');
 import WxValidate from '../../utils/WxValidate';
+const COS = require('../../utils/cos.js');
 Page({
   data: {
     isRz: 0,
@@ -9,7 +10,9 @@ Page({
     card: "",
     isInput1: false,
     isInput2: false,
-    isInput3: false
+    isInput3: false,
+    carWin_img: '', //存放照片路径的
+    cosPath: "" //腾讯云上传的路径
   },
   // 错误信息回显
   showModal(error) {
@@ -18,6 +21,22 @@ Page({
       showCancel: false,
     })
   },
+  openCamera() {
+    wx.chooseImage({
+      count: 1,
+      sizeType: ['original', 'compressed'],
+      sourceType: ['', 'camera'],
+      success:(res)=> {
+        console.log(res)
+        let path = res.tempFilePaths[0];
+        // tempFilePath可以作为img标签的src属性显示图片
+        console.log(path)
+        this.setData({
+          carWin_img: path
+        })
+      }
+    })
+  },
   // 提交
   tj(sessionKey, params) {
     wx.request({
@@ -43,8 +62,7 @@ Page({
               }
             }
           })
-        } 
-        else {
+        } else {
           wx.showModal({
             showCancel: false,
             content: res.data.msg
@@ -86,7 +104,7 @@ Page({
       data: {
         sessionKey: sessionKey
       },
-      success:  (res)=> {
+      success: (res) => {
         if (res.data.code == 0) {
           if (res.data.data !== null || res.data.data !== "") {
             this.setData({
@@ -106,7 +124,7 @@ Page({
     this.getInformation(sessionKey);
     this.initValidate();
   },
-   // 验证字段的规则
+  // 验证字段的规则
   initValidate() {
     const rules = {
       userName: {

+ 7 - 0
pages/Identity/Identity.wxml

@@ -12,6 +12,13 @@
 			<image src='/images/shenfen4.png' mode="aspectFit" class="icon1"></image>
 			<input style='width:80%;display:inline-block;height:60%;' disabled="{{isInput3}}" placeholder-style='font-size:30rpx;' placeholder='请输入身份证号' name="card" value="{{card}}"></input>
 		</view>
+		<!-- <view class="pyp_box1">
+			<view class="add_text">上传本人照片</view>
+			<image src="../../images/camera.png" class="xj" wx:if="{{carWin_img==''}}"  bindtap="openCamera"></image>
+			<image src="{{carWin_img}}" class="xj" bindtap="openCamera" wx:if="{{carWin_img!=''}}"></image>
+			<van-button type="primary" block color="#eb3f33" custom-style="width:614rpx;border-radius:10rpx;margin-top:20rpx;" bindtap="submitImgToTxy">提交</van-button>
+			<van-button type="primary" block color="#eb3f33" custom-style="width:614rpx;border-radius:10rpx;margin-top:20rpx;" bindtap="openCamera">重新拍摄</van-button>
+		</view> -->
 		<button class="qrrz" formType="submit">前往认证</button>
 	</form>
 </view>

+ 22 - 2
pages/Identity/Identity.wxss

@@ -16,7 +16,7 @@
   color: #d72f1d;
   font-size: 24rpx;
   font-weight: 900;
-  border: 1px solid #d72f1d;
+  /* border: 1px solid #d72f1d; */
   border-radius: 30rpx;
   width: 150rpx;
   height: 50rpx;
@@ -36,5 +36,25 @@
   box-shadow: 5px 5px 5px #eea390; 
   margin-bottom: 20rpx;
   text-align: center;
-  margin-top: 300rpx;
+  margin-top: 200rpx;
+}
+.pyp_box1 {
+  width: 680rpx;
+  height: 500rpx;
+  margin-left: 35rpx;
+  margin-top: 20rpx;
+  background-color: #fff;
+  border-radius: 30rpx;
+}
+.add_text {
+  margin-left: 260rpx;
+  padding-top: 20rpx;
+  color: #000
+}
+.xj{
+  width: 614rpx;
+  height: 393rpx;
+  margin-top: 20rpx;
+  margin-left: 30rpx;
+  /* border: 1px solid red; */
 }

+ 161 - 0
pages/Identitycopy/Identitycopy.js

@@ -0,0 +1,161 @@
+const app = require('../../utils/util.js');
+const tools = require('../../utils/tools.js');
+import WxValidate from '../../utils/WxValidate';
+const COS = require('../../utils/cos.js');
+Page({
+  data: {
+    isRz: 0,
+    userName: "",
+    phone: "",
+    card: "",
+    isInput1: false,
+    isInput2: false,
+    isInput3: false,
+    carWin_img: '', //存放照片路径的
+    cosPath: "" //腾讯云上传的路径
+  },
+  // 错误信息回显
+  showModal(error) {
+    wx.showModal({
+      content: error.msg,
+      showCancel: false,
+    })
+  },
+  openCamera() {
+    wx.chooseImage({
+      count: 1,
+      sizeType: ['original', 'compressed'],
+      sourceType: ['', 'camera'],
+      success:(res)=> {
+        console.log(res)
+        let path = res.tempFilePaths[0];
+        // tempFilePath可以作为img标签的src属性显示图片
+        console.log(path)
+        this.setData({
+          carWin_img: path
+        })
+      }
+    })
+  },
+  // 提交
+  tj(sessionKey, params) {
+    wx.request({
+      url: app.globalData.publicUrl + '/wx/student/uthentication',
+      method: "post",
+      data: {
+        studentName: params.userName,
+        studentCard: params.card,
+        phone: params.phone,
+        sessionKey: sessionKey
+      },
+      success: function (res) {
+        wx.hideLoading()
+        if (res.data.code == 0) {
+          wx.showModal({
+            showCancel: false,
+            content: "提交成功啦",
+            success(res) {
+              if (res.confirm) {
+                wx.switchTab({
+                  url: '../index/index'
+                })
+              }
+            }
+          })
+        } else {
+          wx.showModal({
+            showCancel: false,
+            content: res.data.msg
+          })
+        }
+      }
+    })
+  },
+  // 表单提交 跳转tj()
+  async formSubmit(e) {
+    wx.showLoading({
+      mask: true,
+      title: '加载中',
+    })
+    if (this.data.isRz == 0) {
+      const params = e.detail.value
+      if (!this.WxValidate.checkForm(params)) {
+        const error = this.WxValidate.errorList[0]
+        this.showModal(error)
+        wx.hideLoading()
+        return false
+      }
+      const sessionKey = await tools.checkSessionAndLogin();
+      this.tj(sessionKey, params);
+    } else {
+      wx.hideLoading()
+      wx.showModal({
+        showCancel: false,
+        content: "您已经认证过了"
+      })
+    }
+  },
+  // 如果有就把信息回显出来
+  getInformation(sessionKey) {
+    // let _this = this;
+    wx.request({
+      url: app.globalData.publicUrl + '/wx/student/selStudentSessionKeyEcho',
+      method: "post",
+      data: {
+        sessionKey: sessionKey
+      },
+      success: (res) => {
+        if (res.data.code == 0) {
+          if (res.data.data !== null || res.data.data !== "") {
+            this.setData({
+              isRz: 1,
+              userName: res.data.data.miniName,
+              phone: res.data.data.miniPhone,
+              card: res.data.data.studentCard,
+              isInput3: true
+            })
+          }
+        }
+      }
+    })
+  },
+  async onLoad() {
+    const sessionKey = await tools.checkSessionAndLogin();
+    this.getInformation(sessionKey);
+    this.initValidate();
+  },
+  // 验证字段的规则
+  initValidate() {
+    const rules = {
+      userName: {
+        required: true
+      },
+      phone: {
+        required: true,
+        tel: true,
+      },
+      card: {
+        required: true,
+        idcard: true,
+      }
+    }
+
+    // 验证字段的提示信息,若不传则调用默认的信息
+    const messages = {
+      userName: {
+        required: '请输入姓名'
+      },
+      phone: {
+        required: '请输入手机号',
+        tel: '请输入正确的手机号',
+      },
+      card: {
+        required: '请输入身份证号码',
+        idcard: '请输入正确的身份证号码',
+      }
+    }
+
+    // 创建实例对象
+    this.WxValidate = new WxValidate(rules, messages)
+  }
+})

+ 4 - 0
pages/Identitycopy/Identitycopy.json

@@ -0,0 +1,4 @@
+{
+  "navigationBarTitleText":"身份认证拷贝",
+  "usingComponents": {}
+}

+ 27 - 0
pages/Identitycopy/Identitycopy.wxml

@@ -0,0 +1,27 @@
+<view class='container'>
+	<form bindsubmit="formSubmit">
+		<view class="form_item">
+			<image src='/images/shenfen1.png' mode="aspectFit" class="icon1"></image>
+			<input style='display:inline-block;height:60%;' disabled="{{isInput1}}" placeholder-style='font-size:30rpx;' placeholder='请输入姓名' name='userName' value="{{userName}}"></input>
+		</view>
+		<!-- <view class="form_item">
+			<image src='/images/shenfen2.png' mode="aspectFit" class="icon1"></image>
+			<input style='display:inline-block;height:60%;' disabled="{{isInput2}}" placeholder-style='font-size:30rpx;' placeholder='请输入手机号' name='phone' type='number' value="{{phone}}"></input>
+		</view> -->
+		<view class="form_item">
+			<image src='/images/shenfen4.png' mode="aspectFit" class="icon1"></image>
+			<input style='width:80%;display:inline-block;height:60%;' disabled="{{isInput3}}" placeholder-style='font-size:30rpx;' placeholder='请输入身份证号' name="card" value="{{card}}"></input>
+		</view>
+		<view class="pyp_box1">
+			
+			<image src="../../images/camera.png" class="xj" wx:if="{{carWin_img==''}}"  bindtap="openCamera"></image>
+			<view class="add_text" wx:if="{{carWin_img==''}}" >点我上传本人照片</view>
+			<image src="{{carWin_img}}" class="xj" bindtap="openCamera" wx:if="{{carWin_img!=''}}"></image>
+			<view style="display:flex;">
+			<van-button   plain size="small" block  custom-style="width:250rpx;border-radius:10rpx;margin-top:20rpx;margin-left:70rpx" bindtap="submitImgToTxy">点我确认照片</van-button>
+			<van-button plain size="small" block custom-style="width:250rpx;border-radius:10rpx;margin-top:20rpx;margin-left:30rpx" bindtap="openCamera">重新拍摄</van-button>
+			</view>
+		</view>
+		<button class="qrrz" formType="submit" style="width:500rpx">前往认证</button>
+	</form>
+</view>

+ 69 - 0
pages/Identitycopy/Identitycopy.wxss

@@ -0,0 +1,69 @@
+.form_item {
+  width: 600rpx;
+  margin-left: 75rpx;
+  height: 80rpx;
+  display: flex;
+  align-items: center;
+  border-bottom: 1px solid #cdcdcd;
+  margin-top: 30rpx;
+}
+
+.icon1 {
+  width: 43rpx;
+  height: 30rpx;
+  margin-right: 20rpx;
+}
+
+.getyzm {
+  color: #d72f1d;
+  font-size: 24rpx;
+  font-weight: 900;
+  /* border: 1px solid #d72f1d; */
+  border-radius: 30rpx;
+  width: 150rpx;
+  height: 50rpx;
+  line-height: 50rpx;
+  text-align: center;
+}
+
+.qrrz {
+  height: 77rpx;
+  margin-left: 95rpx;
+  border-radius: 40rpx;
+  font-size: 29rpx;
+  font-weight: 600;
+  color: #fff;
+  background: -webkit-linear-gradient(left, #d7301d, #f99c30);
+  box-shadow: 5px 5px 5px #eea390;
+  margin-bottom: 20rpx;
+  text-align: center;
+  margin-top: 200rpx;
+  /* border: 1px solid red; */
+}
+
+.pyp_box1 {
+  width: 680rpx;
+  height: 500rpx;
+  margin-left: 35rpx;
+  margin-top: 20rpx;
+  background-color: #fff;
+  border-radius: 30rpx;
+}
+
+.add_text {
+  /* margin-left: 260rpx;
+  padding-top: 20rpx; */
+  color: #f9720d;
+  /* font-weight: 900; */
+  position: absolute;
+  top: 500rpx;
+  left: 255rpx;
+}
+.xj {
+  width: 500rpx;
+  height: 303rpx;
+  margin-top: 20rpx;
+  margin-left: 85rpx;
+
+  /* border: 1px solid red; */
+}

+ 13 - 13
pages/answerAfterclasses/answerAfterclasses.js

@@ -120,19 +120,19 @@ Page({
     })
     wx.setStorageSync('titleINDEX' + wx.getStorageSync('answersId'), this.data.index);
   },
-  onShow: function () {
-    if (wx.getStorageSync('questionList' + wx.getStorageSync('answersId'))) {
-      const questionList = wx.getStorageSync('questionList' + wx.getStorageSync('answersId'));
-      this.setData({
-        questionList: questionList,
-        index: wx.getStorageSync('titleINDEX' + wx.getStorageSync('answersId')),
-        answersId: wx.getStorageSync('answersId' + wx.getStorageSync('answersId')),
-        chooseValue: wx.getStorageSync('chooseValue' + wx.getStorageSync('answersId')),
-      })
-    } else {
-      this.allShi(this.data.id, this.data.paperId, this.data.sessionKey);
-    }
-  },
+  // onShow: function () {
+  //   if (wx.getStorageSync('questionList' + wx.getStorageSync('answersId'))) {
+  //     const questionList = wx.getStorageSync('questionList' + wx.getStorageSync('answersId'));
+  //     this.setData({
+  //       questionList: questionList,
+  //       index: wx.getStorageSync('titleINDEX' + wx.getStorageSync('answersId')),
+  //       answersId: wx.getStorageSync('answersId' + wx.getStorageSync('answersId')),
+  //       chooseValue: wx.getStorageSync('chooseValue' + wx.getStorageSync('answersId')),
+  //     })
+  //   } else {
+  //     this.allShi(this.data.id, this.data.paperId, this.data.sessionKey);
+  //   }
+  // },
   async onLoad(options) {
     const sessionKey = await tools.checkSessionAndLogin();
     wx.setStorageSync('answersId', options.answersId);

+ 82 - 29
pages/dbDetails/dbDetails.js

@@ -12,7 +12,53 @@ Page({
     intervalTime: 0, //隔五分钟清空重新计时 弹出信息确认在不在
     video_real_time: 0, //实时播放进度
     intervalCtx: null,
-    videoContext: null
+    videoContext: null,
+    classInfo: {},
+    showWW: false
+  },
+  isClass(sessionKey) {
+    wx.request({
+      url: app.globalData.publicUrl + '/wx/student/selMyClas',
+      method: "post",
+      data: {
+        sessionKey
+      },
+      success: (res) => {
+        if (res.data.code == 0) {
+          this.setData({
+            classInfo: res.data.data
+          })
+        } else {
+          if (res.data.msg == "运行时异常:学员不可同时存在两个班级中。") {
+            wx.showModal({
+              content: "学员不可同时存在多个班级中哦",
+              showCancel: false,
+              success(res) {
+                if (res.confirm) {
+                  wx.switchTab({
+                    url: '../index/index'
+                  })
+                }
+              }
+            })
+            return false;
+          } else {
+            wx.showModal({
+              content: "您当前还没有正在开放的班级!",
+              showCancel: false,
+              success(res) {
+                if (res.confirm) {
+                  wx.switchTab({
+                    url: '../index/index'
+                  })
+                }
+              }
+            })
+            return false;
+          }
+        }
+      }
+    })
   },
   // 视频出错了
   videoErrorCallback: function (e) {
@@ -28,17 +74,18 @@ Page({
     if (_this.data.intervalTime > 300) {
       _this.data.videoContext.pause()
       this.setData({
-        intervalTime: 0
-      })
-      wx.showModal({
-        showCancel: false,
-        content: "您还在吗,请点击确定继续观看视频哦",
-        success(res) {
-          if (res.confirm) {
-            _this.data.videoContext.play()
-          }
-        }
+        intervalTime: 0,
+        showWW: true
       })
+      // wx.showModal({
+      //   showCancel: false,
+      //   content: "您还在吗,请点击确定继续观看视频哦",
+      //   success(res) {
+      //     if (res.confirm) {
+      //       _this.data.videoContext.play()
+      //     }
+      //   }
+      // })
     }
   },
   // 点击开始播放视频
@@ -49,6 +96,12 @@ Page({
       }, 5000)
     })
   },
+  startbf() {
+    this.setData({
+      showWW: false
+    })
+    this.data.videoContext.play()
+  },
   // 视频暂停
   bindpause() {
     clearInterval(this.data.intervalCtx)
@@ -108,24 +161,23 @@ Page({
     this.setData({
       [studyTime]: currentTime
     })
-    // _this.setData({
-    //   currentTime:currentTime
-    // })
-    let aa = 1;
-    let jump_time;
-    if (_this.data.video_real_time == 0) {
-      jump_time = parseInt(_this.data.playVideoDuration) + parseInt(_this.data.video_real_time)
-    } else {
-      jump_time = parseInt(_this.data.video_real_time)
-    }
-    if (aa == 1) {
-      if (currentTime > jump_time && currentTime - jump_time > 3) {
-        _this.data.videoContext.seek(_this.data.video_real_time)
-        wx.showToast({
-          title: '未完整看完该视频,不能快进',
-          icon: 'none',
-          duration: 2000,
-        })
+    if (this.data.classInfo.id != -1) {
+      let aa = 1;
+      let jump_time;
+      if (_this.data.video_real_time == 0) {
+        jump_time = parseInt(_this.data.playVideoDuration) + parseInt(_this.data.video_real_time)
+      } else {
+        jump_time = parseInt(_this.data.video_real_time)
+      }
+      if (aa == 1) {
+        if (currentTime > jump_time && currentTime - jump_time > 3) {
+          _this.data.videoContext.seek(_this.data.video_real_time)
+          wx.showToast({
+            title: '未完整看完该视频,不能快进',
+            icon: 'none',
+            duration: 2000,
+          })
+        }
       }
     }
     _this.setData({
@@ -207,6 +259,7 @@ Page({
       videoContext: wx.createVideoContext('myVideo')
     })
     const sessionKey = await tools.checkSessionAndLogin();
+    this.isClass(sessionKey);
     this.getStudyLog(sessionKey);
     this.getdbArr(sessionKey);
   }

+ 6 - 0
pages/dbDetails/dbDetails.wxml

@@ -7,4 +7,10 @@
 		<view class="zw">{{message}}
 		</view>
 	</view>
+	<view wx:if="{{showWW}}" class="rsww" bindtap="startbf">
+		<image src="../../images/rsww.png" class="rsimg"></image>
+		<view class="text">
+			学习累了么?不要溜号呦,点我继续学习吧!
+		</view>
+	</view>
 </view>

+ 23 - 0
pages/dbDetails/dbDetails.wxss

@@ -24,4 +24,27 @@ border-bottom: 1px solid #dbdbdb;
   font-size: 25rpx;
   margin-top: 40rpx;
   line-height: 40rpx;
+}
+.rsww{
+  width: 100%;
+  height: 100vh;
+  background-color: rgba(0,0,0,0.5);
+  position: fixed;
+  top: 0;
+}
+.rsimg{
+  width: 400rpx;
+  height: 429rpx;
+  position: absolute;
+  top: 20%;
+  left: 175rpx;
+}
+.text{
+  width: 180rpx;
+  height: 150rpx;
+  position: absolute;
+  top: 270rpx;
+  left: 365rpx;
+  font-size: 25rpx;
+  line-height: 40rpx;
 }

+ 64 - 12
pages/demandCourses/demandCourses.js

@@ -11,22 +11,29 @@ Page({
   // 点击按跳转
   goIn(e) {
     let id = e.currentTarget.dataset.item.id
-    if (this.data.currentId != null) {
-      // 没学或者没学完
-      if (e.currentTarget.dataset.item.isDone == 0) {
-        if (id == this.data.currentId) {
+    console.log(this.data.classId)
+    if (this.data.classId != -1) {
+      if (this.data.currentId != null) {
+        // 没学或者没学完
+        if (e.currentTarget.dataset.item.isDone == 0) {
+          if (id == this.data.currentId) {
+            wx.navigateTo({
+              url: '../dbDetails/dbDetails?id=' + id
+            })
+          } else {
+            // 有未完成的但不是我 就不能跳转
+            wx.showModal({
+              showCancel: false,
+              content: "您的" + this.data.currentName + "课还未学完,快去学习吧"
+            })
+          }
+        } else {
+          // 我看完了这个视频 还能看
           wx.navigateTo({
             url: '../dbDetails/dbDetails?id=' + id
           })
-        } else {
-          // 有未完成的但不是我 就不能跳转
-          wx.showModal({
-            showCancel: false,
-            content: "您的" + this.data.currentName + "课还未学完,快去学习吧"
-          })
         }
       } else {
-        // 我看完了这个视频 还能看
         wx.navigateTo({
           url: '../dbDetails/dbDetails?id=' + id
         })
@@ -125,8 +132,53 @@ Page({
     const hoursValue = hours % 60; //小时
     return `${hoursValue}时${minutesValue}分${secondValue}秒`;
   },
+  isClass(sessionKey) {
+    wx.request({
+      url: app.globalData.publicUrl + '/wx/student/selMyClas',
+      method: "post",
+      data: {
+        sessionKey
+      },
+      success: (res) => {
+        if (res.data.code == 0) {
+          this.setData({
+            classId: res.data.data.id
+          })
+          this.getArr(sessionKey)
+        } else {
+          if (res.data.msg == "运行时异常:学员不可同时存在两个班级中。") {
+            wx.showModal({
+              content: "学员不可同时存在多个班级中哦",
+              showCancel: false,
+              success(res) {
+                if (res.confirm) {
+                  wx.switchTab({
+                    url: '../index/index'
+                  })
+                }
+              }
+            })
+            return false;
+          } else {
+            wx.showModal({
+              content: "您当前还没有正在开放的班级!",
+              showCancel: false,
+              success(res) {
+                if (res.confirm) {
+                  wx.switchTab({
+                    url: '../index/index'
+                  })
+                }
+              }
+            })
+            return false;
+          }
+        }
+      }
+    })
+  },
   async onShow() {
     const sessionKey = await tools.checkSessionAndLogin();
-    this.getArr(sessionKey)
+    this.isClass(sessionKey)
   }
 })

+ 1 - 166
pages/feedBack/feedBack.js

@@ -1,5 +1,3 @@
-//index.js
-//获取应用实例
 const app = require('../../utils/util.js');
 const tools = require('../../utils/tools.js');
 Page({
@@ -35,170 +33,7 @@ Page({
       }
       return value;
     },
-    questionList: [
-      // {
-      //   "QuestType": "6",
-      //   "Id": 11,
-      //   name: 'ccccc',
-      //   QuestStem: '时间选择',
-      //   QuestAnswer: ''
-      // },
-      // {
-      //   "QuestType": "5",
-      //   "Id": 11,
-      //   name: 'dddd',
-      //   QuestStem: '姓名输入',
-      //   QuestAnswer: ''
-      // },
-      // {
-      //   "QuestType": "6",
-      //   "Id": 11,
-      //   name: 'username111',
-      //   QuestStem: '时间2',
-      //   QuestAnswer: ''
-      // },
-      // {
-      //   "QuestType": "5",
-      //   "Id": 11,
-      //   name: 'address',
-      //   QuestStem: '姓名输入',
-      //   QuestAnswer: ''
-      // },
-      // {
-      //   "QuestType": "0",
-      //   "QuestChoice": [{
-      //       value: 'USA',
-      //       name: '美国'
-      //     },
-      //     {
-      //       value: 'CHN',
-      //       name: '中国',
-      //       checked: 'true'
-      //     },
-      //     {
-      //       value: 'BRA',
-      //       name: '巴西'
-      //     },
-      //     {
-      //       value: 'JPN',
-      //       name: '日本'
-      //     },
-      //     {
-      //       value: 'ENG',
-      //       name: '英国'
-      //     },
-      //     {
-      //       value: 'FRA',
-      //       name: '法国'
-      //     },
-      //   ],
-      //   "Id": 36,
-      //   name: 'sex',
-      //   QuestStem: '性别单选'
-      // },
-      // {
-      //   "QuestType": "0",
-      //   "QuestChoice": [{
-      //       value: '男',
-      //       name: '男',
-      //       checked: false,
-      //     },
-      //     {
-      //       value: '女',
-      //       name: '女',
-      //       checked: false,
-      //     },
-      //   ],
-      //   "Id": 36,
-      //   name: 'sex111',
-      //   QuestStem: '性别单选2222'
-      // },
-      // {
-      //   "QuestType": "1",
-      //   "QuestAnswer": "equals ()||\nhashCode()||",
-      //   "QuestChoice": [{
-      //       value: 'USA',
-      //       name: '美国'
-      //     },
-      //     {
-      //       value: 'CHN',
-      //       name: '中国',
-      //       checked: false
-      //     },
-      //     {
-      //       value: 'FRA',
-      //       name: '法国'
-      //     }
-      //   ],
-      //   "Id": 38,
-      //   name: 'alls',
-      //   QuestStem: '多选'
-      // },
-
-      // {
-      //   "QuestType": "2",
-      //   "QuestStem": "1+1=2",
-      //   "QuestAnswer": "是",
-      //   "QuestChoice": [{
-      //       value: 'USA',
-      //       name: '是'
-      //     },
-      //     {
-      //       value: 'CHN',
-      //       name: '中国',
-      //       checked: false
-      //     },
-      //   ],
-      //   "Id": 42,
-      //   name: 'lllll',
-      //   QuestStem: '判断1'
-      // },
-      // {
-      //   "QuestType": "2",
-      //   "QuestStem": "1+1=2",
-      //   "QuestAnswer": "是",
-      //   "QuestChoice": [{
-      //       value: 'USA',
-      //       name: '是'
-      //     },
-      //     {
-      //       value: 'CHN',
-      //       name: '中国',
-      //       checked: false
-      //     },
-      //   ],
-      //   "Id": 42,
-      //   name: 'lllll',
-      //   QuestStem: '判断2'
-      // },
-      // {
-      //   "QuestType": "2",
-      //   "QuestStem": "1+1=2",
-      //   "QuestAnswer": "是",
-      //   "QuestChoice": [{
-      //       value: 'USA',
-      //       name: '是'
-      //     },
-      //     {
-      //       value: 'CHN',
-      //       name: '中国',
-      //       checked: false
-      //     },
-      //   ],
-      //   "Id": 42,
-      //   name: 'lllll',
-      //   QuestStem: '判断3'
-      // },
-      // {
-      //   "QuestType": "3",
-      //   "QuestStem": "世纪大厦的萨科技的哈市(解答)",
-      //   "QuestAnswer": "",
-      //   "QuestChoice": "",
-      //   "Id": 39,
-      //   name: 'textarea',
-      // },
-
-    ],
+    questionList: [],
     answersId: '', // 提交答案用到
     sessionKey: '',
     paperId: '',

+ 1 - 6
pages/feedBackDetail/feedBackDetail.js

@@ -1,10 +1,7 @@
-
 const app = require('../../utils/util.js');
 Page({
   data: {
-    gridArr: [
-    ],
-
+    gridArr: [],
   },
   chengji(sessionKey, answersId) {
     wx.request({
@@ -27,7 +24,5 @@ Page({
     let answersId = options.answersId;
     const sessionKey = 'yoa0rZTt2bAiTVDsiRjysw==';
     this.chengji(sessionKey, answersId);
-
   },
-
 })

+ 73 - 0
pages/livePlayback/livePlayback.js

@@ -0,0 +1,73 @@
+// pages/livePlayback/livePlayback.js
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    url: "",
+    title:"",
+    message:""
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+    console.log(options)
+    this.setData({
+      url: options.courseUrl,
+      title:options.courseName,
+      message:options.courseInfo
+    })
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload: function () {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh: function () {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom: function () {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage: function () {
+
+  }
+})

+ 4 - 0
pages/livePlayback/livePlayback.json

@@ -0,0 +1,4 @@
+{
+  "usingComponents": {},
+  "navigationBarTitleText":"直播回放"
+}

+ 9 - 0
pages/livePlayback/livePlayback.wxml

@@ -0,0 +1,9 @@
+<view class="home">
+	<video src="{{url}}" show-play-btn="ture" show-mute-btn="true" controls id="myVideo">
+	</video>
+	<view class="text_box">
+		<view class="title"  wx:if="{{title}}">{{title}}</view>
+		<view class="zw" wx:if="{{message!='null'}}">{{message}}
+		</view>
+	</view>
+</view>

+ 27 - 0
pages/livePlayback/livePlayback.wxss

@@ -0,0 +1,27 @@
+#myVideo{
+  width: 100%;
+}
+.text_box{
+width: 90%;
+margin-left: 5%;
+}
+.title{
+  font-size: 32rpx;
+  margin-top: 50rpx;
+}
+.bfnum{
+color: #999999;
+font-size: 25rpx;
+margin-top: 10rpx;
+height: 50rpx;
+border-bottom: 1px solid #dbdbdb;
+}
+.zj{
+  font-size: 32rpx;
+  margin-top: 20rpx;
+}
+.zw{
+  font-size: 25rpx;
+  margin-top: 40rpx;
+  line-height: 40rpx;
+}

+ 418 - 230
pages/myClass/myClass.js

@@ -71,7 +71,7 @@ Page({
         } else {
           if (res.data.msg == "运行时异常:学员不可同时存在两个班级中。") {
             wx.showModal({
-              content: "学员不可同时存在个班级中哦",
+              content: "学员不可同时存在个班级中哦",
               showCancel: false,
               success(res) {
                 if (res.confirm) {
@@ -140,6 +140,11 @@ Page({
       }
     })
   },
+  moreThink() {
+    wx.switchTab({
+      url: '../index/index'
+    })
+  },
   // 检查班级群是否加了 && 学员登记任务check
   checkTaskList(sessionKey) {
     wx.request({
@@ -231,23 +236,29 @@ Page({
   },
   // 学员登记表
   goWrite() {
-    if (!this.data.istask) {
-      wx.showModal({
-        showCancel: false,
-        content: "请先去扫描二维码加入班级群吧",
-        success(res) {
-          if (res.confirm) {
-            wx.switchTab({
-              url: '../myMission/myMission'
-            })
+    if (this.data.classInfo.id == -1) {
+      wx.navigateTo({
+        url: '../studentRegistration/studentRegistration'
+      })
+    } else {
+      if (!this.data.istask) {
+        wx.showModal({
+          showCancel: false,
+          content: "请先去扫描二维码加入班级群吧",
+          success(res) {
+            if (res.confirm) {
+              wx.switchTab({
+                url: '../myMission/myMission'
+              })
+            }
           }
-        }
+        })
+        return false
+      }
+      wx.navigateTo({
+        url: '../studentRegistration/studentRegistration'
       })
-      return false
     }
-    wx.navigateTo({
-      url: '../studentRegistration/studentRegistration'
-    })
   },
   // 学院介绍
   toAdd1() {
@@ -276,6 +287,7 @@ Page({
         sessionKey: sessionKey
       },
       success: (res) => {
+        console.log(res, "我的课程")
         this.setData({
           kcArr: res.data.list,
           istask2: res.data.allDone,
@@ -348,100 +360,99 @@ Page({
   },
   // 去学习
   goStudy(e) {
-    if (!this.data.istask) {
-      wx.showModal({
-        showCancel: false,
-        content: "请先去扫描二维码加入班级群吧",
-        success(res) {
-          if (res.confirm) {
-            wx.switchTab({
-              url: '../myMission/myMission'
-            })
-          }
-        }
-      })
-      return false
-    }
-    if (!this.data.istask1) {
-      wx.showModal({
-        showCancel: false,
-        content: "请先填写学员登记表再来学习哦!"
-      })
-      return false
-    }
     let id = e.currentTarget.dataset.item.id //此课程的id
-    // 直播
-    if (e.currentTarget.dataset.item.isLive == 1) {
-      if (e.currentTarget.dataset.item.isActive == 1) {
+    let courseUrl = e.currentTarget.dataset.item.courseUrl //此课程的id
+    let courseName = e.currentTarget.dataset.item.courseName //此课程的id
+    let courseInfo = e.currentTarget.dataset.item.courseInfo //此课程的id
+    if (this.data.classInfo.id == -1) {
+      if (e.currentTarget.dataset.item.isLive == 1) {
+        if (e.currentTarget.dataset.item.isActive == 1) {
+          wx.navigateTo({
+            url: '../zbDetails/zbDetails?id=' + id
+          })
+        } else {
+          wx.showModal({
+            showCancel: false,
+            content: "直播还未开始哦"
+          })
+          return false;
+        }
+      } else {
         wx.navigateTo({
-          url: '../zbDetails/zbDetails?id=' + id
+          url: '../dbDetails/dbDetails?id=' + id
         })
-      } else {
+      }
+    } else {
+      if (!this.data.istask) {
         wx.showModal({
           showCancel: false,
-          content: "直播还未开始哦"
+          content: "请先去扫描二维码加入班级群吧",
+          success(res) {
+            if (res.confirm) {
+              wx.switchTab({
+                url: '../myMission/myMission'
+              })
+            }
+          }
         })
-        return false;
+        return false
       }
-    } else {
-      if (this.data.currentId != null) {
-        // 没学或者没学完
-        if (e.currentTarget.dataset.item.isDone == 0) {
-          if (id == this.data.currentId) {
+      if (!this.data.istask1) {
+        wx.showModal({
+          showCancel: false,
+          content: "请先填写学员登记表再来学习哦!"
+        })
+        return false
+      }
+      // 直播
+      if (e.currentTarget.dataset.item.isLive == 1) {
+        if (e.currentTarget.dataset.item.isActive == 1) {
+          wx.navigateTo({
+            url: '../zbDetails/zbDetails?url=' + id
+          })
+        } else if (e.currentTarget.dataset.item.isActive == -1) {
+          wx.navigateTo({
+            url: '../livePlayback/livePlayback?courseName=' + courseName + '&courseUrl=' + courseUrl + '&courseInfo=' + courseInfo
+          })
+        } else {
+          wx.showModal({
+            showCancel: false,
+            content: "直播还未开始哦"
+          })
+          return false;
+        }
+      } else {
+        if (this.data.currentId != null) {
+          // 没学或者没学完
+          if (e.currentTarget.dataset.item.isDone == 0) {
+            if (id == this.data.currentId) {
+              wx.navigateTo({
+                url: '../dbDetails/dbDetails?id=' + id
+              })
+            } else {
+              // 有未完成的但不是我 就不能跳转
+              wx.showModal({
+                showCancel: false,
+                content: "您的" + this.data.currentName + "课还未学完,快去学习吧"
+              })
+            }
+          } else {
+            // 我看完了这个视频 还能看
             wx.navigateTo({
               url: '../dbDetails/dbDetails?id=' + id
             })
-          } else {
-            // 有未完成的但不是我 就不能跳转
-            wx.showModal({
-              showCancel: false,
-              content: "您的" + this.data.currentName + "课还未学完,快去学习吧"
-            })
           }
         } else {
-          // 我看完了这个视频 还能看
           wx.navigateTo({
             url: '../dbDetails/dbDetails?id=' + id
           })
         }
-      } else {
-        wx.navigateTo({
-          url: '../dbDetails/dbDetails?id=' + id
-        })
       }
     }
   },
   // 去考试
   gokhAnswer(e) {
-    if (!this.data.istask) {
-      wx.showModal({
-        showCancel: false,
-        content: "请先去扫描二维码加入班级群吧",
-        success(res) {
-          if (res.confirm) {
-            wx.switchTab({
-              url: '../myMission/myMission'
-            })
-          }
-        }
-      })
-      return false
-    }
-    if (!this.data.istask1) {
-      wx.showModal({
-        showCancel: false,
-        content: "请先填写学员登记表再来学习哦!"
-      })
-      return false
-    }
-    let isStudyDone = e.currentTarget.dataset.item.isStudyDone
-    if (isStudyDone != 1) {
-      wx.showModal({
-        showCancel: false,
-        content: "您当前的学习课程还未完成哦,请先完成再来考试吧!"
-      })
-      return false
-    } else {
+    if (this.data.classInfo.id == -1) {
       wx.request({
         url: app.globalData.publicUrl + '/wx/exam/examList',
         method: "post",
@@ -469,39 +480,69 @@ Page({
           }
         }
       })
+    } else {
+      if (!this.data.istask) {
+        wx.showModal({
+          showCancel: false,
+          content: "请先去扫描二维码加入班级群吧",
+          success(res) {
+            if (res.confirm) {
+              wx.switchTab({
+                url: '../myMission/myMission'
+              })
+            }
+          }
+        })
+        return false
+      }
+      if (!this.data.istask1) {
+        wx.showModal({
+          showCancel: false,
+          content: "请先填写学员登记表再来学习哦!"
+        })
+        return false
+      }
+      let isStudyDone = e.currentTarget.dataset.item.isStudyDone
+      if (isStudyDone != 1) {
+        wx.showModal({
+          showCancel: false,
+          content: "您当前的学习课程还未完成哦,请先完成再来考试吧!"
+        })
+        return false
+      } else {
+        wx.request({
+          url: app.globalData.publicUrl + '/wx/exam/examList',
+          method: "post",
+          data: {
+            sessionKey: this.data.sessionKey,
+            courseId: e.currentTarget.dataset.item.id,
+            clasId: this.data.classInfo.id
+          },
+          success: (res) => {
+            if (res.data.code == 0) {
+              if (res.data.list.length == 0) {
+                wx.showModal({
+                  showCancel: false,
+                  content: '老师还未出考试题哦'
+                })
+              } else {
+                if (res.data.list[0]) {
+                  if (res.data.list[0].answersId) {
+                    this.toPath(res.data.list[0].id, res.data.list[0].paperId, res.data.list[0].answersId, 'answerAfterclass');
+                  } else {
+                    this.beginKao(res.data.list[0].id, res.data.list[0].paperId, this.data.sessionKey, 'answerAfterclass');
+                  }
+                }
+              }
+            }
+          }
+        })
+      }
     }
   },
   //去评价
   gopjClass(e) {
-    if (!this.data.istask) {
-      wx.showModal({
-        showCancel: false,
-        content: "请先去扫描二维码加入班级群吧",
-        success(res) {
-          if (res.confirm) {
-            wx.switchTab({
-              url: '../myMission/myMission'
-            })
-          }
-        }
-      })
-      return false
-    }
-    if (!this.data.istask1) {
-      wx.showModal({
-        showCancel: false,
-        content: "请先填写学员登记表再来学习哦!"
-      })
-      return false
-    }
-    let isStudyDone = e.currentTarget.dataset.item.isStudyDone
-    if (isStudyDone != 1) {
-      wx.showModal({
-        showCancel: false,
-        content: "您的学习课程还未完成哦,请先完成再来评价吧!"
-      })
-      return false
-    } else {
+    if (this.data.classInfo.id == -1) {
       wx.request({
         url: app.globalData.publicUrl + '/wx/exam/quesExamList',
         method: "post",
@@ -529,6 +570,64 @@ Page({
           }
         }
       })
+    } else {
+      if (!this.data.istask) {
+        wx.showModal({
+          showCancel: false,
+          content: "请先去扫描二维码加入班级群吧",
+          success(res) {
+            if (res.confirm) {
+              wx.switchTab({
+                url: '../myMission/myMission'
+              })
+            }
+          }
+        })
+        return false
+      }
+      if (!this.data.istask1) {
+        wx.showModal({
+          showCancel: false,
+          content: "请先填写学员登记表再来学习哦!"
+        })
+        return false
+      }
+      let isStudyDone = e.currentTarget.dataset.item.isStudyDone
+      if (isStudyDone != 1) {
+        wx.showModal({
+          showCancel: false,
+          content: "您的学习课程还未完成哦,请先完成再来评价吧!"
+        })
+        return false
+      } else {
+        wx.request({
+          url: app.globalData.publicUrl + '/wx/exam/quesExamList',
+          method: "post",
+          data: {
+            sessionKey: this.data.sessionKey,
+            courseId: e.currentTarget.dataset.item.id,
+            clasId: this.data.classInfo.id
+          },
+          success: (res) => {
+            if (res.data.code == 0) {
+              if (res.data.list.length == 0) {
+                wx.showModal({
+                  showCancel: false,
+                  content: '老师还未出评价模板哦'
+                })
+              } else {
+                if (res.data.list[0]) {
+                  if (res.data.list[0].answersId) {
+                    this.toPath(res.data.list[0].id, res.data.list[0].paperId, res.data.list[0].answersId, 'evaluationCourse');
+                  } else {
+                    this.beginKao(res.data.list[0].id, res.data.list[0].paperId, this.data.sessionKey, 'evaluationCourse');
+                  }
+                }
+              }
+            }
+          }
+        })
+      }
     }
   },
   // 查看详情成绩
@@ -569,73 +668,122 @@ Page({
   },
   // 期末考试
   goQmks() {
-    if (!this.data.istask) {
-      wx.showModal({
-        showCancel: false,
-        content: "请先去扫描二维码加入班级群吧",
-        success(res) {
-          if (res.confirm) {
-            wx.switchTab({
-              url: '../myMission/myMission'
-            })
+    if (this.data.classInfo.id == -1) {
+      wx.request({
+        url: app.globalData.publicUrl + '/wx/exam/examList',
+        method: "post",
+        data: {
+          sessionKey: this.data.sessionKey,
+          clasId: this.data.classInfo.id
+        },
+        success: (res) => {
+          if (res.data.code == 0) {
+            if (res.data.list.length == 0) {
+              wx.showModal({
+                showCancel: false,
+                content: '期末考试还未开始哦!'
+              })
+            } else {
+              if (res.data.list[0].answersId) {
+                if (res.data.list[0].status == '1') {
+                  wx.request({
+                    url: app.globalData.publicUrl + '/wx/answer/detail',
+                    method: "post",
+                    data: {
+                      answersId: res.data.list[0].answersId
+                    },
+                    success: (res1) => {
+                      if (res1.data.list[0].answerScore >= 0 && res1.data.list[0].answerScore != null) {
+                        wx.navigateTo({
+                          url: '/pages/grade/grade?answersId=' + res.data.list[0].answersId,
+                        })
+                      } else {
+                        wx.showModal({
+                          showCancel: false,
+                          content: '当前老师批阅中,请耐心等待'
+                        })
+                      }
+                    }
+                  })
+                } else {
+                  this.toPath(res.data.list[0].id, res.data.list[0].paperId, res.data.list[0].answersId, 'answerAfterclass');
+                }
+              } else {
+                this.beginKao(res.data.list[0].id, res.data.list[0].paperId, this.data.sessionKey, 'answerAfterclass');
+              }
+            }
           }
         }
       })
-      return false
-    }
-    if (!this.data.istask2) {
-      wx.showModal({
-        showCancel: false,
-        content: "您的课程任务还未全部完成哦!请先去完成再来期末考试吧!"
-      })
-      return false
-    }
-    wx.request({
-      url: app.globalData.publicUrl + '/wx/exam/examList',
-      method: "post",
-      data: {
-        sessionKey: this.data.sessionKey,
-        clasId: this.data.classInfo.id
-      },
-      success: (res) => {
-        if (res.data.code == 0) {
-          if (res.data.list.length == 0) {
-            wx.showModal({
-              showCancel: false,
-              content: '期末考试还未开始哦!'
-            })
-          } else {
-            if (res.data.list[0].answersId) {
-              if (res.data.list[0].status == '1') {
-                wx.request({
-                  url: app.globalData.publicUrl + '/wx/answer/detail',
-                  method: "post",
-                  data: {
-                    answersId: res.data.list[0].answersId
-                  },
-                  success: (res1) => {
-                    if (res1.data.list[0].answerScore >= 0 && res1.data.list[0].answerScore != null) {
-                      wx.navigateTo({
-                        url: '/pages/grade/grade?answersId=' + res.data.list[0].answersId,
-                      })
-                    } else {
-                      wx.showModal({
-                        showCancel: false,
-                        content: '当前老师批阅中,请耐心等待'
-                      })
+    } else {
+      if (!this.data.istask) {
+        wx.showModal({
+          showCancel: false,
+          content: "请先去扫描二维码加入班级群吧",
+          success(res) {
+            if (res.confirm) {
+              wx.switchTab({
+                url: '../myMission/myMission'
+              })
+            }
+          }
+        })
+        return false
+      }
+      if (!this.data.istask2) {
+        wx.showModal({
+          showCancel: false,
+          content: "您的课程任务还未全部完成哦!请先去完成再来期末考试吧!"
+        })
+        return false
+      }
+      wx.request({
+        url: app.globalData.publicUrl + '/wx/exam/examList',
+        method: "post",
+        data: {
+          sessionKey: this.data.sessionKey,
+          clasId: this.data.classInfo.id
+        },
+        success: (res) => {
+          if (res.data.code == 0) {
+            if (res.data.list.length == 0) {
+              wx.showModal({
+                showCancel: false,
+                content: '期末考试还未开始哦!'
+              })
+            } else {
+              if (res.data.list[0].answersId) {
+                if (res.data.list[0].status == '1') {
+                  wx.request({
+                    url: app.globalData.publicUrl + '/wx/answer/detail',
+                    method: "post",
+                    data: {
+                      answersId: res.data.list[0].answersId
+                    },
+                    success: (res1) => {
+                      if (res1.data.list[0].answerScore >= 0 && res1.data.list[0].answerScore != null) {
+                        wx.navigateTo({
+                          url: '/pages/grade/grade?answersId=' + res.data.list[0].answersId,
+                        })
+                      } else {
+                        wx.showModal({
+                          showCancel: false,
+                          content: '当前老师批阅中,请耐心等待'
+                        })
+                      }
                     }
-                  }
-                })
+                  })
+                } else {
+                  this.toPath(res.data.list[0].id, res.data.list[0].paperId, res.data.list[0].answersId, 'answerAfterclass');
+                }
               } else {
-                this.toPath(res.data.list[0].id, res.data.list[0].paperId, res.data.list[0].answersId, 'answerAfterclass');
+                this.beginKao(res.data.list[0].id, res.data.list[0].paperId, this.data.sessionKey, 'answerAfterclass');
               }
-            } else {
-              this.beginKao(res.data.list[0].id, res.data.list[0].paperId, this.data.sessionKey, 'answerAfterclass');
             }
           }
         }
-      }
-    })
+      })
+    }
   },
   // 综合反馈表
   goWrite2() {
@@ -704,65 +852,105 @@ Page({
   },
   // 领取结业证
   lq() {
-    if (!this.data.istask) {
-      wx.showModal({
-        showCancel: false,
-        content: "请先去扫描二维码加入班级群吧",
-        success(res) {
-          if (res.confirm) {
-            wx.switchTab({
-              url: '../myMission/myMission'
-            })
-          }
+    if (this.data.classInfo.id == -1) {
+      wx.showLoading({
+        mask: true,
+        title: '加载中',
+      })
+      this.setData({
+        myCanvasId: this.data.myCanvasId + 1
+      })
+      let str = this.data.studentName + "同志于" + this.data.classInfo.beginDate + " 至 " + this.data.classInfo.endDate + "参加学习完成规定培训内容,准予结业,特发此证。"
+      let strArr = [];
+      let a = str.slice(0, 16);
+      let b = str.slice(16, 36);
+      let c = str.slice(36, 56);
+      strArr.push(a, b, c);
+      const ctx = wx.createCanvasContext(this.data.myCanvasId);
+      ctx.drawImage(this.data.byzsbj, 0, 0, 300, 415); //里面的参数无非就是图片放置的位置即图片的横纵坐标,图片的宽高
+      ctx.setFillStyle("#000");
+      ctx.setFontSize(16); //字大小
+      ctx.setTextAlign('left'); //是否居中显示,参考点画布中线
+      let leftPositionAarr = [60, 30, 30, 30]
+      for (let i = 0; i < strArr.length; i++) {
+        ctx.fillText(strArr[i], leftPositionAarr[i], 160 + i * 30);
+      }
+      // ctx.fillText(str, 150, 160); //150:canvas画布宽300,取1/2,中间,280:纵向位置
+      ctx.draw();
+      wx.hideLoading();
+      this.setData({
+        showzs: true
+      });
+      wx.request({
+        url: app.globalData.publicUrl + '/wx/student/wxGraduation',
+        method: "post",
+        data: {
+          sessionKey: this.data.sessionKey
+        },
+        success: (res) => {
+          console.log(res.data, "领取结业证提交")
         }
       })
-      return false
-    }
-    if (!this.data.istask3) {
-      wx.showModal({
-        showCancel: false,
-        content: "您的期末考试还未完成哦!"
+    } else {
+      if (!this.data.istask) {
+        wx.showModal({
+          showCancel: false,
+          content: "请先去扫描二维码加入班级群吧",
+          success(res) {
+            if (res.confirm) {
+              wx.switchTab({
+                url: '../myMission/myMission'
+              })
+            }
+          }
+        })
+        return false
+      }
+      if (!this.data.istask3) {
+        wx.showModal({
+          showCancel: false,
+          content: "您的期末考试还未完成哦!"
+        })
+        return false
+      }
+      wx.showLoading({
+        mask: true,
+        title: '加载中',
       })
-      return false
-    }
-    wx.showLoading({
-      mask: true,
-      title: '加载中',
-    })
-    this.setData({
-      myCanvasId: this.data.myCanvasId + 1
-    })
-    let str = this.data.studentName + "同志于" + this.data.classInfo.beginDate + " 至 " + this.data.classInfo.endDate + "参加学习完成规定培训内容,准予结业,特发此证。"
-    let strArr = [];
-    let a = str.slice(0, 16);
-    let b = str.slice(16, 36);
-    let c = str.slice(36, 56);
-    strArr.push(a, b, c);
-    const ctx = wx.createCanvasContext(this.data.myCanvasId);
-    ctx.drawImage(this.data.byzsbj, 0, 0, 300, 415); //里面的参数无非就是图片放置的位置即图片的横纵坐标,图片的宽高
-    ctx.setFillStyle("#000");
-    ctx.setFontSize(16); //字大小
-    ctx.setTextAlign('left'); //是否居中显示,参考点画布中线
-    let leftPositionAarr = [60, 30, 30, 30]
-    for (let i = 0; i < strArr.length; i++) {
-      ctx.fillText(strArr[i], leftPositionAarr[i], 160 + i * 30);
-    }
-    // ctx.fillText(str, 150, 160); //150:canvas画布宽300,取1/2,中间,280:纵向位置
-    ctx.draw();
-    wx.hideLoading();
-    this.setData({
-      showzs: true
-    });
-    wx.request({
-      url: app.globalData.publicUrl + '/wx/student/wxGraduation',
-      method: "post",
-      data: {
-        sessionKey: this.data.sessionKey
-      },
-      success: (res) => {
-        console.log(res.data, "领取结业证提交")
+      this.setData({
+        myCanvasId: this.data.myCanvasId + 1
+      })
+      let str = this.data.studentName + "同志于" + this.data.classInfo.beginDate + " 至 " + this.data.classInfo.endDate + "参加学习完成规定培训内容,准予结业,特发此证。"
+      let strArr = [];
+      let a = str.slice(0, 16);
+      let b = str.slice(16, 36);
+      let c = str.slice(36, 56);
+      strArr.push(a, b, c);
+      const ctx = wx.createCanvasContext(this.data.myCanvasId);
+      ctx.drawImage(this.data.byzsbj, 0, 0, 300, 415); //里面的参数无非就是图片放置的位置即图片的横纵坐标,图片的宽高
+      ctx.setFillStyle("#000");
+      ctx.setFontSize(16); //字大小
+      ctx.setTextAlign('left'); //是否居中显示,参考点画布中线
+      let leftPositionAarr = [60, 30, 30, 30]
+      for (let i = 0; i < strArr.length; i++) {
+        ctx.fillText(strArr[i], leftPositionAarr[i], 160 + i * 30);
       }
-    })
+      ctx.draw();
+      wx.hideLoading();
+      this.setData({
+        showzs: true
+      });
+      wx.request({
+        url: app.globalData.publicUrl + '/wx/student/wxGraduation',
+        method: "post",
+        data: {
+          sessionKey: this.data.sessionKey
+        },
+        success: (res) => {
+          console.log(res.data, "领取结业证提交")
+        }
+      })
+    }
   },
   // 存储结业证
   saveZs() {

+ 2 - 2
pages/myClass/myClass.wxml

@@ -1,7 +1,7 @@
 <view class="container">
 	<van-popup show="{{ show }}" bind:close="onClose">
 		<view class="nr_box">
-			<view class="title">学员须知</view>
+			<view class="title">学员培训协议</view>
 			<view class="zw">
 				<view class="dl">欢迎您来到吉林长春社区干部学院,我们将为您开
 					启一次温馨难忘、受益良多的学习与心灵之旅。现就有
@@ -85,7 +85,7 @@
 			</view>
 			<view class="agree_text">点击按钮即表示同意<text style="color:red">《学员培训协议》</text></view>
 			<view class="agree_btn" bindtap="hidePopup">同意协议并进入我的班级</view>
-			<view class="thinking">我再想想</view>
+			<view class="thinking" bindtap="moreThink">我再想想</view>
 		</view>
 	</van-popup>
 	<view class="notice" bindtap="gomyNotice">

+ 2 - 1
pages/myInteractions/myInteractions.wxss

@@ -60,7 +60,7 @@
 .tip {
   display: flex;
   width: 670rpx;
-  height: 100rpx;
+  /* height: 100rpx; */
   margin-top: 30rpx;
   border-bottom: 1px solid #f2f2f2;
 }
@@ -69,6 +69,7 @@
   color: #1e3058;
   font-size: 28rpx;
   margin-left: 30rpx;
+  width: 600rpx;
 }
 
 .jj {

+ 46 - 18
pages/myMission/myMission.js

@@ -55,12 +55,14 @@ Page({
   },
   //保存班级二维码
   saveImg() {
+    console.log(this.data.classInfo.codeImg)
     wx.showLoading({
       title: '保存中...'
     })
     wx.downloadFile({
       url: this.data.classInfo.codeImg,
-      success: function (res) {
+      success: (res) => {
+        console.log(res)
         //图片保存到本地
         wx.saveImageToPhotosAlbum({
           filePath: res.tempFilePath,
@@ -73,6 +75,7 @@ Page({
             })
           },
           fail: (err) => {
+            console.log(err, "我保存失败了")
             if (err.errMsg === "saveImageToPhotosAlbum:fail:auth denied" || err.errMsg === "saveImageToPhotosAlbum:fail auth deny") {
               wx.showModal({
                 title: '提示',
@@ -85,7 +88,7 @@ Page({
                       if (settingdata.authSetting['scope.writePhotosAlbum']) {
                         wx.showModal({
                           title: '提示',
-                          content: '获取权限成功,再次点击图片即可保存',
+                          content: '获取权限成功,再次点击即可保存',
                           showCancel: false,
                         })
                       } else {
@@ -106,13 +109,11 @@ Page({
                 }
               })
             }
-          },
-          complete(res) {
-            wx.hideLoading()
           }
         })
       },
-      fail: () => {
+      fail: (res) => {
+        console.log(res,"我下载失败了")
         wx.hideLoading()
         wx.showModal({
           title: '提示',
@@ -204,18 +205,33 @@ Page({
           this.checkTaskList4(sessionKey, res.data.data.id)
           this.checkTaskList5(sessionKey, res.data.data.id)
         } else {
-          wx.showModal({
-            content: "您当前还没有开放的班级!",
-            showCancel: false,
-            success(res) {
-              if (res.confirm) {
-                wx.switchTab({
-                  url: '../index/index'
-                })
+          if (res.data.msg == "运行时异常:学员不可同时存在两个班级中。") {
+            wx.showModal({
+              content: "学员不可同时存在多个班级中哦",
+              showCancel: false,
+              success(res) {
+                if (res.confirm) {
+                  wx.switchTab({
+                    url: '../index/index'
+                  })
+                }
               }
-            }
-          })
-          return false;
+            })
+            return false;
+          } else {
+            wx.showModal({
+              content: "您当前还没有正在开放的班级!",
+              showCancel: false,
+              success(res) {
+                if (res.confirm) {
+                  wx.switchTab({
+                    url: '../index/index'
+                  })
+                }
+              }
+            })
+            return false;
+          }
         }
       }
     })
@@ -245,6 +261,11 @@ Page({
       }
     })
   },
+  moreThink(){
+    wx.switchTab({
+      url: '../index/index'
+    })
+  },
   // 点击同意协议 并且记一下
   hidePopup() {
     wx.request({
@@ -355,6 +376,10 @@ Page({
   },
   // 去学习
   goStudy(e) {
+    let id = e.currentTarget.dataset.item.id //此课程的id
+    let courseUrl = e.currentTarget.dataset.item.courseUrl //此课程的id
+    let courseName = e.currentTarget.dataset.item.courseName //此课程的id
+    let courseInfo = e.currentTarget.dataset.item.courseInfo //此课程的id
     if (!this.data.istask2) {
       wx.showModal({
         showCancel: false,
@@ -362,13 +387,16 @@ Page({
       })
       return false
     }
-    let id = e.currentTarget.dataset.item.id //此课程的id
     // 直播
     if (e.currentTarget.dataset.item.isLive == 1) {
       if (e.currentTarget.dataset.item.isActive == 1) {
         wx.navigateTo({
           url: '../zbDetails/zbDetails?id=' + id
         })
+      }else if (e.currentTarget.dataset.item.isActive == -1) {
+        wx.navigateTo({
+          url: '../livePlayback/livePlayback?courseName=' + courseName + '&courseUrl=' + courseUrl + '&courseInfo=' + courseInfo
+        })
       } else {
         wx.showModal({
           showCancel: false,

+ 1 - 1
pages/myMission/myMission.wxml

@@ -85,7 +85,7 @@
 			</view>
 			<view class="agree_text">点击按钮即表示同意<text style="color:red">《学员培训协议》</text></view>
 			<view class="agree_btn" bindtap="hidePopup">同意协议并进入我的班级</view>
-			<view class="thinking">我再想想</view>
+			<view class="thinking" bindtap="moreThink">我再想想</view>
 		</view>
 	</van-popup>
 	<view class="step" style="margin-top:20rpx">

+ 3 - 22
pages/pyip/pyip.js

@@ -51,27 +51,13 @@ Page({
       mask: true,
       title: '上传中',
     })
-    // var CosAuth = require('./cos-auth'); //  COS 签名方法 https://unpkg.com/cos-js-sdk-v5/demo/common/cos-auth.min.js
     var Bucket = 'bucketnj1-1254259530';
     var Region = 'ap-nanjing';
-    var ForcePathStyle = false; // 是否使用后缀式,涉及签名计算和域名白名单配置,后缀式说明看上文
-    // var uploadFile = function () {
-    // 请求用到的参数
+    var ForcePathStyle = false;
     var prefix = 'https://' + Bucket + '.cos.' + Region + '.myqcloud.com/';
     if (ForcePathStyle) {
-      // 后缀式请求在签名时域名使用地域域名,而不是存储桶域名,具体说明见本文上述“3.后缀式请求”
       prefix = 'https://cos.' + Region + '.myqcloud.com/' + Bucket + '/';
     }
-    // 对更多字符编码的 url encode 格式
-    // var camSafeUrlEncode = function (str) {
-    //   return encodeURIComponent(str)
-    //     .replace(/!/g, '%21')
-    //     .replace(/'/g, '%27')
-    //     .replace(/\(/g, '%28')
-    //     .replace(/\)/g, '%29')
-    //     .replace(/\*/g, '%2A');
-    // };
-    // 获取临时密钥
     var stsCache;
     var getCredentials = function (callback) {
       if (stsCache && Date.now() / 1000 + 30 < stsCache.expiredTime) {
@@ -80,7 +66,7 @@ Page({
       }
       wx.request({
         method: 'POST',
-        url: app.globalData.publicUrl + '/wx/course/getSts', // 服务端签名,参考上文说的获取临时密钥
+        url: app.globalData.publicUrl + '/wx/course/getSts',
         // dataType: 'json',
         success: function (result) {
           var credentials = result.data.credential.credentials;
@@ -119,12 +105,9 @@ Page({
       });
     };
     // 上传文件
-    // var uploadFile = function (filePath) {
     var Key = this.data.carWin_img.substr(this.data.carWin_img.lastIndexOf('/') + 1); // 这里指定上传的文件名
-    // var Key = '456abcd.png';
-    var signPathname = '/'; // PostObject 接口 Key 是放在 Body 传输,所以请求路径和签名路径是 /
+    var signPathname = '/';
     if (ForcePathStyle) {
-      // 后缀式请求在签名时用的路径,要包含存储桶名称,具体说明见本文上述“3.后缀式请求”
       signPathname = '/' + Bucket + '/';
     }
     getAuthorization({
@@ -143,8 +126,6 @@ Page({
           'Content-Type': '',
         },
         success: (res) => {
-          console.log(res.header.Location, "11111111111111")
-          // var url = prefix + camSafeUrlEncode(Key).replace(/%2F/g, '/');
           if (/^2\d\d$/.test('' + res.statusCode)) {
             wx.request({
               method: 'PUT',

+ 7 - 4
pages/testAnswer/testAnswer.js

@@ -3,15 +3,16 @@ const app = require('../../utils/util.js');
 Page({
   data: {
     showNull: false,
-    dataArr: [
-
-    ],
+    dataArr: [],
     sessionKey: '',
   },
   startAnswer(e) {
+    console.log(e);
+    
     let id = e.currentTarget.dataset.idx;
     let paperId = e.currentTarget.dataset.paperid;
     let answersId = e.currentTarget.dataset.answersid;
+    console.log(answersId,"9999999")
     if (answersId) {
       this.toPath(id, paperId, answersId);
     } else {
@@ -74,6 +75,8 @@ Page({
         allDone
       },
       success: (res) => {
+        console.log(res,"ssdsdsads");
+        
         if (res.data.code == 0 && res.data.list.length != 0) {
           this.setData({
             dataArr: res.data.list
@@ -95,7 +98,7 @@ Page({
         sessionKey: sessionKey
       },
       success: (res) => {
-        console.log(res.data.allDone)
+        console.log(res)
         this.getBanner(sessionKey, res.data.allDone)
       }
     })

+ 2 - 2
utils/util.js

@@ -1,6 +1,6 @@
 const globalData = {
-  publicUrl: 'https://sqdx.jiaxintech.com'//测试地址
-  // publicUrl: 'https://sqpx.jiaxintech.com',//正式地址
+  // publicUrl: 'https://sqdx.jiaxintech.com'//测试地址
+  publicUrl: 'https://sqpx.jiaxintech.com'//正式地址
   // publicUrl:'http://10.16.10.139'//ly
   // publicUrl:'http://10.16.4.19:80'//hyb
   // publicUrl:'http://10.16.4.26:80'//zxq