ssfg 4 年之前
父節點
當前提交
edb05a6344

+ 1 - 3
app.json

@@ -37,9 +37,7 @@
     "pages/myPoints/myPoints",
     "pages/myTraining/myTraining",
     "pages/agoClass/agoClass",
-    "pages/videoPlayBack/videoPlayBack",
-    "pages/pyip/pyip",
-    "pages/InteractiveQA/InteractiveQA"
+    "pages/videoPlayBack/videoPlayBack"
   ],
   "window": {
     "backgroundTextStyle": "light",

+ 1 - 1
components/trtc-room/template/1v1/1v1.wxss

@@ -136,7 +136,7 @@
   width: 455rpx;
   height: 400rpx;
   margin: 50rpx auto;
-  border: 1px solid red;
+  /* border: 1px solid red; */
   position: relative;
   background-color: rgba(0, 0, 0, 0.3);
   z-index: 100;

+ 1 - 1
pages/Identity/Identity.js

@@ -88,7 +88,7 @@ Page({
       if (this.data.carWin_img == "" || this.data.carWin_img == null) {
         wx.hideLoading()
         wx.showModal({
-          title: '请点击上方选择照片或者视频哦',
+          title: '请点击上方开始拍照哦',
           showCancel: false
         });
         return false

+ 0 - 17
pages/InteractiveQA/InteractiveQA.js

@@ -1,17 +0,0 @@
-Page({
-  toPyip(){
-    wx.navigateTo({
-      url: '../pyip/pyip'
-    })
-  },
-  toWyiw(){
-    wx.navigateTo({
-      url: '../myInteractions/myInteractions'
-    })
-  },
-  toXyix(){
-    wx.navigateTo({
-      url: '/pages/exhibitionList/exhibitionList?id=2',
-    })
-  }
-})

+ 0 - 4
pages/InteractiveQA/InteractiveQA.json

@@ -1,4 +0,0 @@
-{
-  "usingComponents": {},
-  "navigationBarTitleText":"互动答疑"
-}

+ 0 - 14
pages/InteractiveQA/InteractiveQA.wxml

@@ -1,14 +0,0 @@
-<view>
-	<view class="block" bindtap="toPyip">
-		<image src="../../images/ic1.png" class="img1"></image>
-    <view>随手拍</view>
-	</view>
-  	<view class="block"  bindtap="toWyiw">
-		<image src="../../images/ic2.png" class="img2"></image>
-    <view>随时问</view>
-	</view>
-  	<view class="block" bindtap="toXyix">
-		<image src="../../images/ic3.png" class="img3"></image>
-    <view>随便学</view>
-	</view>
-</view>

+ 0 - 29
pages/InteractiveQA/InteractiveQA.wxss

@@ -1,29 +0,0 @@
-page {
-  background-color: #f2f2f2;
-}
-.block{
-  width: 650rpx;
-  height: 260rpx;
-  background-color: #fff;
-  border-radius: 20rpx;
-  margin-top: 40rpx;
-  margin-left: 50rpx;
-  display: flex;
-  justify-content:center;
-  align-items:center;
-}
-.img1{
-  width: 163rpx;
-  height:110rpx;
-  margin-right: 50rpx;
-}
-.img2{
-  width: 152rpx;
-  height:132rpx;
-  margin-right: 50rpx;
-}
-.img3{
-  width: 156rpx;
-  height:138rpx;
-  margin-right: 50rpx;
-}

+ 18 - 1
pages/answerAfterclass/answerAfterclass.js

@@ -36,8 +36,23 @@ Page({
    * 多选事件
    */
   checkboxChange: function (e) {
+    console.log(e)
+    const questionList = wx.getStorageSync('questionList' + wx.getStorageSync('answersId'));
+    console.log(questionList,'我是选项');
+    console.log(this.data.index)
+    let data=questionList[this.data.index].QuestChoice;
     let json = {};
-    let aa = e.detail.value.join("||")
+    let list=e.detail.value;
+    let valueData=[];
+    data.map(ite=>{
+      list.map(items=>{
+        if(ite.name==items)
+        {
+          valueData.push(ite.name)
+        }
+      })
+    })
+    let aa = valueData.join("||")
     json.currentAnswer = aa;
     json.questType = e.currentTarget.dataset.questtypes;
     json.id = e.currentTarget.dataset.idx;
@@ -120,6 +135,8 @@ Page({
     })
     if (wx.getStorageSync('questionList' + wx.getStorageSync('answersId'))) {
       const questionList = wx.getStorageSync('questionList' + wx.getStorageSync('answersId'));
+      console.log(questionList,"大阪烧");
+      
       const titleINDEX = wx.getStorageSync('titleINDEX' + wx.getStorageSync('answersId'));
       const chooseValue = wx.getStorageSync('chooseValue' + wx.getStorageSync('answersId'));
       console.log(wx.getStorageSync('questionList' + wx.getStorageSync('answersId')))

+ 40 - 1
pages/answerAfterclasses/answerAfterclasses.js

@@ -51,9 +51,48 @@ Page({
   /*
    * 多选事件
    */
+  // checkboxChange: function (e) {
+  //   let json = {};
+  //   let aa = e.detail.value.join("||")
+  //   json.currentAnswer = aa;
+  //   json.questType = e.currentTarget.dataset.questtypes;
+  //   json.id = e.currentTarget.dataset.idx;
+  //   this.data.chooseValue[this.data.index] = json;
+  //   const items = this.data.questionList[this.data.index].QuestChoice
+  //   const values = e.detail.value
+  //   for (let i = 0, lenI = items.length; i < lenI; ++i) {
+  //     items[i].checked = false
+  //     for (let j = 0, lenJ = values.length; j < lenJ; ++j) {
+  //       if (items[i].value === values[j]) {
+  //         items[i].checked = true
+  //         break
+  //       }
+  //     }
+  //   }
+  //   this.setData({
+  //     questionList: this.data.questionList
+  //   })
+  //   wx.setStorageSync('questionList' + wx.getStorageSync('answersId'), this.data.questionList);
+  //   wx.setStorageSync('titleINDEX' + wx.getStorageSync('answersId'), this.data.index);
+  //   wx.setStorageSync('chooseValue' + wx.getStorageSync('answersId'), this.data.chooseValue);
+  // },
   checkboxChange: function (e) {
+    const questionList = wx.getStorageSync('questionList' + wx.getStorageSync('answersId'));
+    console.log(questionList,'我是选项es');
+    console.log(this.data.index)
+    let data=questionList[this.data.index].QuestChoice;
     let json = {};
-    let aa = e.detail.value.join("||")
+    let list=e.detail.value;
+    let valueData=[];
+    data.map(ite=>{
+      list.map(items=>{
+        if(ite.name==items)
+        {
+          valueData.push(ite.name)
+        }
+      })
+    })
+    let aa = valueData.join("||")
     json.currentAnswer = aa;
     json.questType = e.currentTarget.dataset.questtypes;
     json.id = e.currentTarget.dataset.idx;

+ 123 - 106
pages/dbDetails/dbDetails.js

@@ -1,6 +1,6 @@
 const app = require('../../utils/util.js');
 const tools = require('../../utils/tools.js');
-var app1 = getApp();
+// var app1 = getApp();
 Page({
   data: {
     url: '', //播放地址
@@ -10,18 +10,18 @@ Page({
     playVideoDuration: 0, // 从这个时间点开始播放
     id: 0, //带过来的id
     studyLog: {}, //我得到的学习日志
-    intervalTime: 0, //隔五分钟清空重新计时 弹出信息确认在不在
+    // intervalTime: 0, //隔五分钟清空重新计时 弹出信息确认在不在
     video_real_time: 0, //实时播放进度
     intervalCtx: null,
     videoContext: null,
     classInfo: {},
-    showWW: false,
-    showChange: false,
-    showfullChange:false,
+    showWW: true,
+    showChange: true,
+    showfullChange: false,
     networkType: '',
     isAgree: false, //表示不同意用4G
-    fullScreen:false
-    
+    fullScreen: false,
+    spanTime: 0 //间隔时间弹窗小人
   },
   isClass(sessionKey) {
     wx.request({
@@ -72,29 +72,26 @@ Page({
     console.log('视频错误信息:', e.detail.errMsg)
   },
   // 计时 五分钟弹出一个弹框
-  calculateTime() {
-    console.log(this.data.intervalTime)
-    let _this = this;
-    this.setData({
-      intervalTime: _this.data.intervalTime + 5
-    })
-    if (_this.data.intervalTime > 300) {
-      _this.data.videoContext.pause()
-      this.setData({
-        intervalTime: 0,
-        showWW: true
-      })
-    }
-  },
+  // calculateTime() {
+  // console.log(this.data.alertTime)
+
+  // console.log(this.data.intervalTime)
+  // let _this = this;
+  // this.setData({
+  //   intervalTime: _this.data.intervalTime + 5
+  // })
+  // if (_this.data.intervalTime > 300) {
+  //   _this.data.videoContext.pause()
+  //   this.setData({
+  //     showWW: false,
+  //     intervalTime: 0
+  //   })
+  // }
+  // },
   // 点击开始播放视频
   async bindplay() {
-    // this.setData({
-    //   clickTime: this.data.clickTime + 1
-    // })
     this.setData({
-      intervalCtx: setInterval(() => {
-        this.calculateTime()
-      }, 5000)
+      showWW: true
     })
     const netStatus = await this.getNetStatus();
     this.setData({
@@ -102,63 +99,48 @@ Page({
     })
     if (netStatus != 'wifi' && !this.data.isAgree) {
       this.data.videoContext.pause()
-      if(this.data.fullScreen){
-        this.setData({
-          showfullChange: true
-        })
-      }else{
         this.setData({
-          showChange: true
+          showChange: false
         })
-      }
-     
     }
     wx.onNetworkStatusChange((res) => {
       if (this.data.networkType == "wifi" && res.networkType != "wifi" && !this.data.isAgree) {
         this.data.videoContext.pause()
-        if(this.data.fullScreen){
           this.setData({
-            showfullChange: true
+            showChange: false
           })
-        }else{
-          this.setData({
-            showChange: true
-          })
-        }
       }
     })
   },
   goclose() {
     this.setData({
-      showChange: false,
-      showfullChange:false,
+      showChange: true,
       isAgree: false
     })
   },
   goon() {
     this.setData({
-      showChange: false,
-      showfullChange:false,
+      showChange: true,
       isAgree: true
     })
     this.data.videoContext.play()
   },
   fullScreenChange(e) {
-    console.log(e.detail.fullScreen,"我是切换全屏的状态")
+    console.log(e.detail.fullScreen, "我是切换全屏的状态")
     this.setData({
-      fullScreen: e.detail.fullScreen
+      fullScreen: e.detail.fullScreen,
     })
   },
   startbf() {
     this.setData({
-      showWW: false
+      showWW: true
     })
     this.data.videoContext.play()
   },
   // 视频暂停
-  bindpause() {
-    clearInterval(this.data.intervalCtx)
-  },
+  // bindpause() {
+  //   clearInterval(this.data.intervalCtx)
+  // },
   // 得到录播列表
   getdbArr(sessionKey) {
     let _this = this;
@@ -176,7 +158,8 @@ Page({
           show: false,
           title: e.data.course.courseName,
           message: e.data.course.courseInfo,
-          playTimes: e.data.course.playTimes
+          playTimes: e.data.course.playTimes,
+          courseTime: e.data.course.courseTime
         })
       }
     })
@@ -189,12 +172,12 @@ Page({
       url: app.globalData.publicUrl + '/wx/course/getStudyLog',
       data: {
         sessionKey: sessionKey,
-        courseId: _this.data.id
+        courseId: _this.data.id,
       },
       success: (e) => {
         if (e.data.studyLog.isDone == 1) {
           _this.setData({
-            studyLog: e.data.studyLog
+            studyLog: e.data.studyLog,
           })
         } else {
           _this.setData({
@@ -207,70 +190,92 @@ Page({
   },
   // 设置不可快进
   timeUpdate: function (e) {
-    //实时播放进度 秒数
     let _this = this;
     let currentTime = parseInt(e.detail.currentTime) //当前播放秒数
+    console.log(currentTime)
+    if (currentTime != 0 && currentTime % 300 == 0) {
+      if (currentTime != this.data.spanTime) {
+        this.setData({
+          spanTime: currentTime,
+          showWW: false
+        })
+        _this.data.videoContext.pause()
+      }
+    }
     let studyTime = 'studyLog.studyTime'
-    this.setData({
-      [studyTime]: currentTime
-    })
-    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)
+    //实时给页面的学习记录赋值
+    let jump_time = parseInt(_this.data.video_real_time); //定义跳转的时间
+    if (this.data.studyLog.isStudyDone != 1) {
+      if (currentTime > jump_time && currentTime - jump_time > 3 && currentTime > _this.data.playVideoDuration) {
+        _this.data.videoContext.seek(_this.data.playVideoDuration)
+        this.setData({
+          video_real_time: _this.data.playVideoDuration, //实时播放进度
+        })
+        wx.showToast({
+          title: '该视频不可以快进哦!',
+          icon: 'none',
+          duration: 2000,
+        })
       }
-      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 (currentTime > jump_time && currentTime - jump_time < 3 && currentTime > _this.data.playVideoDuration) {
+        this.setData({
+          playVideoDuration: currentTime,
+          [studyTime]: currentTime
+        })
+      }
+      if (currentTime > jump_time && currentTime - jump_time < 3) {
+        _this.setData({
+          video_real_time: currentTime, //实时播放进度
+        })
       }
     }
-    _this.setData({
-      video_real_time: currentTime, //实时播放进度
-    })
   },
   // 修改学习进度
   chechEndStatus: function () {
+    let _this = this;
     if (this.data.classInfo.id != -1) {
-      let _this = this;
-      // let currentTime = parseInt(e.detail.currentTime)
-      let isDone = 'studyLog.isDone'
-      this.setData({
-        [isDone]: 1
-      })
-      wx.request({
-        method: "post",
-        url: app.globalData.publicUrl + '/wx/course/updateStudyLog',
-        data: {
-          studyLog: _this.data.studyLog
-        },
-        success: (e) => {
-          wx.showModal({
-            showCancel: false,
-            content: "该录播视频已经看完啦,快去完成其他任务吧!",
-            success(res) {
-              if (res.confirm) {
-                wx.navigateBack({
-                  delta: 1
-                })
+      if (this.data.video_real_time > this.data.courseTime / 1000 - 10) {
+        let isDone = 'studyLog.isDone'
+        this.setData({
+          [isDone]: 1
+        })
+        wx.request({
+          method: "post",
+          url: app.globalData.publicUrl + '/wx/course/updateStudyLog',
+          data: {
+            studyLog: _this.data.studyLog
+          },
+          success: (e) => {
+            wx.showModal({
+              showCancel: false,
+              content: "该录播视频已经看完啦,快去参与该节课的考试和评价吧!只有考试和评价都参与了,才可以继续进行下一节哦!",
+              success(res) {
+                if (res.confirm) {
+                  wx.navigateBack({
+                    delta: 1
+                  })
+                }
               }
-            }
-          })
-        }
-      })
+            })
+          }
+        })
+      }
     }
   },
   onUnload() {
     let _this = this;
-    clearInterval(_this.data.intervalCtx)
+    console.log(_this.data.studyLog.isDone, typeof (_this.data.studyLog.isDone))
+    console.log(_this.data.studyLog.studyTime)
+    console.log(_this.data.playVideoDuration)
+    if (_this.data.studyLog.isDone != '1') {
+      if (this.data.video_real_time > this.data.courseTime / 1000 - 10) {
+        let isDone = 'studyLog.isDone'
+        this.setData({
+          [isDone]: 1
+        })
+      }
+    }
+    // clearInterval(_this.data.intervalCtx)
     if (_this.data.classInfo.id != -1) {
       let stydyrecord = _this.data.playVideoDuration;
       if (stydyrecord == null) {
@@ -292,7 +297,18 @@ Page({
   },
   onHide() {
     let _this = this;
-    clearInterval(_this.data.intervalCtx)
+    console.log(_this.data.studyLog.isDone)
+    console.log(_this.data.studyLog.studyTime)
+    console.log(_this.data.playVideoDuration)
+    if (_this.data.studyLog.isDone != '1') {
+      if (this.data.video_real_time > this.data.courseTime / 1000 - 10) {
+        let isDone = 'studyLog.isDone'
+        this.setData({
+          [isDone]: 1
+        })
+      }
+    }
+    // clearInterval(_this.data.intervalCtx)
     if (_this.data.classInfo.id != -1) {
       let stydyrecord = _this.data.playVideoDuration;
       if (stydyrecord == null) {
@@ -324,6 +340,7 @@ Page({
   },
   async onLoad(options) {
     this.setData({
+      options: options,
       id: options.id,
       videoContext: wx.createVideoContext('myVideo')
     })
@@ -331,5 +348,5 @@ Page({
     this.isClass(sessionKey);
     this.getStudyLog(sessionKey);
     this.getdbArr(sessionKey);
-  },
+  }
 })

+ 17 - 22
pages/dbDetails/dbDetails.wxml

@@ -1,19 +1,21 @@
 <view class="home">
-	<video src="{{url}}" initial-time="{{playVideoDuration}}" bindplay="bindplay" bindpause="bindpause" enable-auto-rotation="true" binderror="videoErrorCallback" bindtimeupdate="timeUpdate" bindfullscreenchange="fullScreenChange" show-play-btn="ture" show-mute-btn="true" controls bindended="chechEndStatus" id="myVideo">
-		<cover-view wx:if="{{showChange}}" class="change" catchtouchmove='true'>
-			<cover-image src="../../images/netChange.png" class="change_box"></cover-image>
-			<cover-view class="change_text">您当前为非wifi网络</cover-view>
-			<cover-view class="change_text change_text1">请注意流量消耗哦!</cover-view>
-			<cover-view class="btn1" bindtap="goon">继续观看</cover-view>
-			<cover-view class="btn2" bindtap="goclose">关闭</cover-view>
-		</cover-view>
-		<cover-view wx:if="{{showfullChange}}" class="change1" catchtouchmove='true'>
-			<cover-image src="../../images/netChange.png" class="change_box1"></cover-image>
-			<cover-view class="change_text2">您当前为非wifi网络</cover-view>
-			<cover-view class="change_text2 change_text3">请注意流量消耗哦!</cover-view>
-			<cover-view class="btn3" bindtap="goon">继续观看</cover-view>
-			<cover-view class="btn4" bindtap="goclose">关闭</cover-view>
-		</cover-view>
+	<video style="z-index:1" src="{{url}}" initial-time="{{playVideoDuration}}" bindplay="bindplay" bindpause="bindpause" enable-auto-rotation="true" binderror="videoErrorCallback" bindtimeupdate="timeUpdate" bindfullscreenchange="fullScreenChange" show-play-btn="ture" show-mute-btn="true" controls bindended="chechEndStatus" id="myVideo">
+		<view hidden="{{showWW}}">
+			<image class="{{fullScreen?'rsww1':'rsww'}}" src="https://oss-sz2-1254259530.cos.ap-beijing.myqcloud.com/%E4%BA%BA%E5%8F%82%E5%A8%83%E5%A8%83.png" bindtap="startbf"></image>
+			<view class="{{fullScreen?'text1':'text'}}" style="z-index:9999" bindtap="startbf">学习累了么?不要溜号呦,点我继续学习吧!</view>
+		</view>
+		<!-- <view hidden="{{showChange}}">
+			<image src="https://bucketnj1-1254259530.cos.ap-nanjing.myqcloud.com/netChange.png" class="{{fullScreen?'change_box1':'change_box'}}"></image>
+		</view> -->
+		<view hidden="{{showChange}}">
+			<view catchtouchmove='true' class="{{fullScreen?'change1':'change'}}">
+				<image src="https://bucketnj1-1254259530.cos.ap-nanjing.myqcloud.com/netChange.png" class="{{fullScreen?'change_box1':'change_box'}}"></image>
+				<view class="{{fullScreen?'change_text2':'change_text'}}">您当前为非wifi网络</view>
+				<view class="{{fullScreen?'change_text3':'change_text1'}}">请注意流量消耗哦!</view>
+				<view class="{{fullScreen?'btn3':'btn1'}}" bindtap="goon">继续观看</view>
+				<view class="{{fullScreen?'btn4':'btn2'}}" bindtap="goclose">关闭</view>
+			</view>
+		</view>
 	</video>
 	<view class="text_box">
 		<view class="title">{{title}}</view>
@@ -21,11 +23,4 @@
 		<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>

+ 102 - 60
pages/dbDetails/dbDetails.wxss

@@ -30,45 +30,41 @@
   margin-top: 40rpx;
   line-height: 40rpx;
 }
-
-.rsww {
-  width: 100%;
+ .change {
+  width: 100vw;
   height: 100vh;
-  background-color: rgba(0, 0, 0, 0.5);
   position: fixed;
   top: 0;
-}
-
-.change {
-  width: 100vw;
-  height: 550rpx;
-  position: absolute;
-  top: 0;
+  left: 0;
+  z-index: 9;
 }
 .change1 {
-  width: 100vw;
-  height: 100vh;
-  position: absolute;
+  width: 100vh;
+  height: 100vw;
+  position: fixed;
   right: 0;
-  bottom: 0rpx;
+  bottom: 0;
+  z-index: 9;
 }
 .change_box {
   width: 354rpx;
   height: 365rpx;
-  position: absolute;
+  position: fixed;
   top: 50rpx;
   left: 198rpx;
+  z-index: 99;
 }
 .change_box1 {
+  position: fixed;
+  top: 100rpx;
+  left: 600rpx;
+  z-index: 99;
   width: 354rpx;
-  height: 365rpx;
-  position: absolute;
-  top: 200rpx;
-  left: 38%;
+  height: 365rpx
 }
 .change_text {
   width: 350rpx;
-  position: absolute;
+  position: fixed;
   top: 120rpx;
   left: 198rpx;
   display: block;
@@ -76,23 +72,43 @@
   word-wrap: break-word;
   word-break: normal;
   font-size: 26rpx;
+  z-index: 999;
 }
-.change_text2 {
-  width: 320rpx;
-  position: absolute;
-  top: 250rpx;
-  left: 39%;
+.change_text2{
+  width: 350rpx;
+  position: fixed;
+  top: 180rpx;
+  left: 600rpx;
   display: block;
   text-align: center;
   word-wrap: break-word;
   word-break: normal;
-  font-size: 26rpx; 
- }
+  font-size: 26rpx;
+  z-index: 999;
+}
 .change_text1 {
   top: 160rpx;
+  width: 350rpx;
+  position: fixed;
+  left: 198rpx;
+  display: block;
+  text-align: center;
+  word-wrap: break-word;
+  word-break: normal;
+  font-size: 26rpx;
+  z-index: 999;
 }
-.change_text3 {
-  top: 290rpx;
+.change_text3{
+  width: 350rpx;
+  position: fixed;
+  top: 220rpx;
+  left: 600rpx;
+  display: block;
+  text-align: center;
+  word-wrap: break-word;
+  word-break: normal;
+  font-size: 26rpx;
+  z-index: 999;
 }
 .btn1 {
   width: 200rpx;
@@ -103,73 +119,99 @@
   font-weight: 600;
   color: #fff;
   background-color: #e45824;
-  position: absolute;
+  position: fixed;
   top: 210rpx;
   text-align: center;
   left: 276rpx;
+  z-index: 999;
 }
-
-.btn2 {
+.btn3 {
   width: 200rpx;
-  height: 57rpx;
-  line-height: 57rpx;
+  height: 50rpx;
+  line-height: 50rpx;
   border-radius: 40rpx;
   font-size: 29rpx;
   font-weight: 600;
   color: #fff;
-  background-color: #999999;
-  position: absolute;
+  background-color: #e45824;
+  position: fixed;
   top: 280rpx;
   text-align: center;
-  left: 276rpx;
+  left: 680rpx;
+  z-index: 999;
 }
-.btn3 {
+.btn2 {
   width: 200rpx;
-  height: 50rpx;
-  line-height: 50rpx;
+  height: 57rpx;
+  line-height: 57rpx;
   border-radius: 40rpx;
   font-size: 29rpx;
   font-weight: 600;
   color: #fff;
-  background-color: #e45824;
-  position: absolute;
-  top: 350rpx;
+  background-color: #999999;
+  position: fixed;
+  top: 280rpx;
   text-align: center;
-  left: 44%;
+  left: 276rpx;
+  z-index: 999;
 }
-
 .btn4 {
   width: 200rpx;
-  height: 57rpx;
-  line-height: 57rpx;
+  height: 50rpx;
+  line-height: 50rpx;
   border-radius: 40rpx;
   font-size: 29rpx;
   font-weight: 600;
   color: #fff;
   background-color: #999999;
-  position: absolute;
-  top: 430rpx;
+  position: fixed;
+  top: 340rpx;
   text-align: center;
-  left: 44%;
+  left: 680rpx;
+  z-index: 999;
 }
-.rsimg {
-  width: 400rpx;
-  height: 429rpx;
-  position: absolute;
-  top: 300rpx;
+.rsww {
+  position: fixed;
+  top: 50rpx;
   left: 175rpx;
+  z-index: 2;
+  width: 400rpx;
+  height: 429rpx
+}
+.rsww1 {
+  position: fixed;
+  top: 100rpx;
+  left: 400rpx;
+  z-index: 2;
+  width: 400rpx;
+  height: 429rpx
 }
-
 .text {
+  color: #000;
   width: 180rpx;
   height: 150rpx;
-  position: absolute;
-  top: 330rpx;
+  position: fixed;
+  top: 80rpx;
   left: 365rpx;
   font-size: 25rpx;
   line-height: 40rpx;
+  overflow: auto;
+  white-space: normal;
+  z-index: 999;
+}
+.text1{
+  color: #000;
+  width: 180rpx;
+  height: 150rpx;
+  position: fixed;
+  top: 130rpx;
+  left: 590rpx;
+  font-size: 25rpx;
+  line-height: 40rpx;
+  overflow: auto;
+  white-space: normal;
+  z-index: 999;
 }
-
 page {
   background-color: #f2f2f2;
 }

+ 42 - 1
pages/demandCourses/demandCourses.js

@@ -6,10 +6,26 @@ Page({
     showNull: false,
     sfmArr: [],
     currentId: null,
-    currentName: ""
+    currentName: "",
+    istask: false,
+    istask1: false
   },
   // 点击按跳转
   goIn(e) {
+    if(!this.data.istask){
+      wx.showModal({
+        showCancel: false,
+        content: "您的班级二维码还未扫描哦"
+      })
+      return
+    }
+    if(!this.data.istask1){
+      wx.showModal({
+        showCancel: false,
+        content: "您的学员登记表还未填写哦"
+      })
+      return
+    }
     let id = e.currentTarget.dataset.item.id
     console.log(this.data.classId)
     if (this.data.classId != -1) {
@@ -177,8 +193,33 @@ Page({
       }
     })
   },
+  // 检查班级群是否加了 && 学员登记任务check
+  checkTaskList(sessionKey) {
+    wx.request({
+      url: app.globalData.publicUrl + '/wx/student/selStudentSessionKey',
+      method: "post",
+      data: {
+        sessionKey
+      },
+      success: (res) => {
+        if (res.data.code == 0) {
+          if (res.data.data.joinClas == 0) {
+            this.setData({
+              istask: true
+            })
+          }
+          if (res.data.data.register == 0) {
+            this.setData({
+              istask1: true
+            })
+          }
+        }
+      }
+    })
+  },
   async onShow() {
     const sessionKey = await tools.checkSessionAndLogin();
     this.isClass(sessionKey)
+    this.checkTaskList(sessionKey)
   }
 })

+ 1 - 1
pages/index/index.js

@@ -30,7 +30,7 @@ Page({
     goGridArr: [
       '/pages/onlineClass/onlineClass',
       '/pages/demandCourses/demandCourses',
-      '/pages/InteractiveQA/InteractiveQA',
+      '/pages/myInteractions/myInteractions',
       '/pages/testAnswer/testAnswer'
     ]
   },

+ 47 - 98
pages/myClass/myClass.js

@@ -459,7 +459,7 @@ Page({
               // 有未完成的但不是我 就不能跳转
               wx.showModal({
                 showCancel: false,
-                content: "您的" + this.data.currentName + "课还未学完,快去学习吧"
+                content: "请确认您的 ‘" + this.data.currentName + "’ 这节课中的学习、考试、评价是否都已完成?"
               })
             }
           } else {
@@ -478,6 +478,7 @@ Page({
   },
   // 去考试
   gokhAnswer(e) {
+    console.log(e)
     wx.showLoading({
       mask: true,
       title: '加载中',
@@ -509,6 +510,7 @@ Page({
         return false
       }
       let isStudyDone = e.currentTarget.dataset.item.isStudyDone
+      console.log(isStudyDone, '我是学习的')
       if (isStudyDone != 1) {
         wx.showModal({
           showCancel: false,
@@ -842,105 +844,52 @@ Page({
   },
   // 领取结业证
   lq() {
-    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, "领取结业证提交")
-        }
-      })
-    } 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: '加载中',
-      })
-      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, "领取结业证提交")
-        }
+    if (!this.data.istask3) {
+      wx.showModal({
+        showCancel: false,
+        content: "您的期末考试还未完成哦!"
       })
+      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 str1 = '准予结业,特发此证。'
+    let strArr = [];
+    let a = str.slice(0, 17);
+    let b = str.slice(17, 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(str1, 60, 250);
+    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() {

+ 6 - 6
pages/myMission/myMission.js

@@ -715,10 +715,11 @@ Page({
     this.setData({
       myCanvasId: this.data.myCanvasId + 1
     })
-    let str = this.data.studentName + "同志于" + this.data.classInfo.beginDate + " 至 " + this.data.classInfo.endDate + "参加学习完成规定培训内容,准予结业,特发此证。"
+    let str = this.data.studentName + "同志于" + this.data.classInfo.beginDate + " 至 " + this.data.classInfo.endDate + "参加学习完成规定培训内容。"
+    let str1 = '准予结业,特发此证。'
     let strArr = [];
-    let a = str.slice(0, 18);
-    let b = str.slice(16, 36);
+    let a = str.slice(0, 17);
+    let b = str.slice(17, 36);
     let c = str.slice(36, 56);
     strArr.push(a, b, c);
     const ctx = wx.createCanvasContext(this.data.myCanvasId);
@@ -730,12 +731,11 @@ Page({
     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.fillText(str1, 60, 250);
     ctx.draw();
     wx.hideLoading();
     this.setData({
-      showzs: true,
-      istask6: true
+      showzs: true
     });
     wx.request({
       url: app.globalData.publicUrl + '/wx/student/wxGraduation',

+ 57 - 47
pages/personInfo/personInfo.js

@@ -18,7 +18,7 @@ Page({
         img: "/images/person3.png",
         name: "我的互动",
         subname: "随时发布问题",
-        url: '/pages/InteractiveQA/InteractiveQA'
+        url: '/pages/myInteractions/myInteractions'
       }, {
         img: "/images/person4.png",
         name: "后期跟踪",
@@ -43,53 +43,63 @@ Page({
     ]
   },
   async goTurn(e) {
+    const sessionKey = await tools.checkSessionAndLogin();
     let _this = this;
     if (e.currentTarget.dataset.index != 6) {
       wx.navigateTo({
         url: this.data.dataArr[e.currentTarget.dataset.index].url,
       })
     } else {
-      wx.showLoading({
-        mask: true,
-        title: '退出中',
-      })
-      const sessionKey = await tools.checkSessionAndLogin();
-      wx.request({
-        url: app.globalData.publicUrl + '/wx/student/mini-info',
-        method: "DELETE",
-        data: {
-          sessionKey
-        },
-        success: (res) => {
-          wx.hideLoading();
-          if (res.data.code == 0) {
-            wx.showModal({
-              showCancel: false,
-              content: "退出登录成功!",
-              success(res) {
-                console.log(res)
-                if (res.confirm) {
-                  console.log("dianji")
-                  _this.setData({
-                    isRz: true
+      wx.showModal({
+        showCancel: true,
+        content: "您确认要退出吗?",
+        success(res) {
+          console.log(res)
+          if (res.confirm) {
+            wx.showLoading({
+              mask: true,
+              title: '退出中',
+            })
+
+            wx.request({
+              url: app.globalData.publicUrl + '/wx/student/mini-info',
+              method: "DELETE",
+              data: {
+                sessionKey
+              },
+              success: (res) => {
+                wx.hideLoading();
+                if (res.data.code == 0) {
+                  wx.showModal({
+                    showCancel: false,
+                    content: "退出登录成功!",
+                    success(res) {
+                      console.log(res)
+                      if (res.confirm) {
+                        console.log("dianji")
+                        _this.setData({
+                          isRz: true
+                        })
+                      }
+                    }
+                  })
+                } else {
+                  wx.showModal({
+                    content: "您已处于未登录状态啦",
+                    showCancel: false
                   })
                 }
+              },
+              fail: (res) => {
+                wx.hideLoading();
+                console.log(res)
+                wx.showModal({
+                  content: "退出登录失败",
+                  showCancel: false
+                })
               }
             })
-          } else {
-            wx.showModal({
-              content: "您已处于未登录状态啦",
-              showCancel: false
-            })
           }
-        },
-        fail: (res) => {
-          wx.hideLoading();
-          console.log(res)
-          wx.showModal({
-            content: "退出登录失败",
-            showCancel: false
-          })
         }
       })
     }
@@ -103,16 +113,16 @@ Page({
       },
       success: (res) => {
         console.log(res);
-          console.log(res.data.msg)
-          if (res.data.msg == '您尚未认证,请先进行身份认证!') {
-            this.setData({
-              isRz: true
-            })
-          }else{
-            this.setData({
-              isRz: false
-            })
-          }
+        console.log(res.data.msg)
+        if (res.data.msg == '您尚未认证,请先进行身份认证!') {
+          this.setData({
+            isRz: true
+          })
+        } else {
+          this.setData({
+            isRz: false
+          })
+        }
       }
     })
   },

+ 0 - 273
pages/pyip/pyip.js

@@ -1,273 +0,0 @@
-// pages/pyip/pyip.js
-const COS = require('../../utils/cos.js');
-const app = require('../../utils/util.js');
-const tools = require('../../utils/tools.js');
-Page({
-  /**
-   * 页面的初始数据
-   */
-  data: {
-    carWin_img_hidden: true, //展示照片的view是否隐藏
-    carWin_img: '', //存放照片路径的
-    carWin_img_type: 2, //是图片还是视频
-    cosPath: "" //腾讯云上传的路径
-  },
-  openCamera() {
-    wx.chooseMedia({
-      count: 1,
-      mediaType: ['image', 'video'],
-      sourceType: ['album', 'camera'],
-      maxDuration: 30,
-      camera: 'back',
-      success: (res) => {
-        console.log(res, "9999999999999999")
-        let path = res.tempFiles[0].tempFilePath
-        let uploadType = path.substring(path.length - 3)
-        if (uploadType == "jpg" || uploadType == "png") {
-          this.setData({
-            carWin_img: path,
-            carWin_img_hidden: false,
-            carWin_img_type: 0
-          })
-        } else if (uploadType == "mp4") {
-          this.setData({
-            carWin_img: path,
-            carWin_img_hidden: false,
-            carWin_img_type: 1
-          })
-        }
-      }
-    })
-  },
-  submitImgToTxy() {
-    if (this.data.carWin_img == "" || this.data.carWin_img == null) {
-      wx.showModal({
-        title: '请点击上方选择照片或者视频哦',
-        showCancel: false
-      });
-      return false
-    }
-    wx.showLoading({
-      mask: true,
-      title: '上传中',
-    })
-    var Bucket = 'bucketnj1-1254259530';
-    var Region = 'ap-nanjing';
-    var ForcePathStyle = false;
-    var prefix = 'https://' + Bucket + '.cos.' + Region + '.myqcloud.com/';
-    if (ForcePathStyle) {
-      prefix = 'https://cos.' + Region + '.myqcloud.com/' + Bucket + '/';
-    }
-    var stsCache;
-    var getCredentials = function (callback) {
-      if (stsCache && Date.now() / 1000 + 30 < stsCache.expiredTime) {
-        callback(data.credentials);
-        return;
-      }
-      wx.request({
-        method: 'POST',
-        url: app.globalData.publicUrl + '/wx/course/getSts',
-        // dataType: 'json',
-        success: function (result) {
-          var credentials = result.data.credential.credentials;
-          if (credentials) {
-            stsCache = result.data.credential
-          } else {
-            wx.hideLoading();
-            wx.showModal({
-              title: '临时密钥获取失败',
-              content: JSON.stringify(data),
-              showCancel: false
-            });
-          }
-          callback(stsCache && stsCache.credentials);
-        },
-        error: function (err) {
-          wx.hideLoading();
-          wx.showModal({
-            title: '临时密钥获取失败',
-            content: JSON.stringify(err),
-            showCancel: false
-          });
-        }
-      });
-    };
-    // 计算签名
-    var getAuthorization = function (options, callback) {
-      getCredentials(function (credentials) {
-        callback({
-          XCosSecurityToken: credentials.sessionToken,
-          Authorization: COS({
-            SecretId: credentials.tmpSecretId,
-            SecretKey: credentials.tmpSecretKey,
-            Method: options.Method,
-            Pathname: options.Pathname,
-          })
-        });
-      });
-    };
-    // 上传文件
-    var Key = this.data.carWin_img.substr(this.data.carWin_img.lastIndexOf('/') + 1); // 这里指定上传的文件名
-    var signPathname = '/';
-    if (ForcePathStyle) {
-      signPathname = '/' + Bucket + '/';
-    }
-    getAuthorization({
-      Method: 'POST',
-      Pathname: signPathname
-    }, (AuthData) => {
-      var requestTask = wx.uploadFile({
-        url: prefix,
-        name: 'file',
-        filePath: this.data.carWin_img,
-        formData: {
-          'key': "paiyipai/" + Key,
-          'success_action_status': 200,
-          'Signature': AuthData.Authorization,
-          'x-cos-security-token': AuthData.XCosSecurityToken,
-          'Content-Type': '',
-        },
-        success: (res) => {
-          if (/^2\d\d$/.test('' + res.statusCode)) {
-            wx.request({
-              method: 'PUT',
-              url: app.globalData.publicUrl + '/wx/shoot',
-              data: {
-                shootName: this.data.carWin_img,
-                shootCosName: Key,
-                sessionKey: this.data.sessionKey,
-                shootType: this.data.carWin_img_type
-              },
-              success: (res) => {
-                if (res.data.code == 0) {
-                  wx.hideLoading();
-                  wx.showModal({
-                    title: '上传成功',
-                    showCancel: false
-                  });
-                  this.setData({
-                    // cosPath: res.header.Location,
-                    carWin_img: "",
-                    carWin_img_type: 2,
-                    carWin_img_hidden: true
-                  })
-                  this.getArr(this.data.sessionKey)
-                } else {
-                  wx.hideLoading();
-                  wx.showModal({
-                    title: res.data.msg,
-                    showCancel: false
-                  });
-                }
-              }
-            });
-          } else {
-            wx.hideLoading();
-            wx.showModal({
-              title: '上传失败',
-              showCancel: false
-            });
-          }
-        },
-        fail: function () {
-          wx.hideLoading();
-          wx.showModal({
-            title: '上传失败',
-            showCancel: false
-          });
-        }
-      });
-      requestTask.onProgressUpdate(function (res) {
-        console.log('进度:', res);
-      });
-    });
-  },
-  getArr(sessionKey) {
-    wx.request({
-      url: app.globalData.publicUrl + '/wx/shoot',
-      method: "get",
-      data: {
-        sessionKey
-      },
-      success: (res) => {
-        console.log(res.data.imgList, "我是查到的照片视频列表")
-        console.log(res.data.videoList, "我是查到的照片视频列表")
-        this.setData({
-          imgList: res.data.imgList,
-          videoList: res.data.videoList
-        })
-        if (res.data.imgList && res.data.imgList.length != 0) {
-          this.setData({
-            isPhoto: true
-          })
-        }
-        if (res.data.videoList && res.data.videoList.length != 0) {
-          this.setData({
-            isVideo: true
-          })
-        }
-      }
-    })
-  },
-  /**
-   * 生命周期函数--监听页面加载
-   */
-  async onLoad() {
-    const sessionKey = await tools.checkSessionAndLogin();
-    this.setData({
-      sessionKey
-    })
-    this.getArr(sessionKey)
-    // this.getArr(sessionKey);
-  },
-  /**
-   * 生命周期函数--监听页面初次渲染完成
-   */
-  onReady: function () {
-    this.setData({
-      carWin_img_hidden: true,
-      carWin_img: ''
-    });
-  },
-  /**
-   * 生命周期函数--监听页面显示
-   */
-  onShow: function () {
-
-  },
-
-  /**
-   * 生命周期函数--监听页面隐藏
-   */
-  onHide: function () {
-
-  },
-
-  /**
-   * 生命周期函数--监听页面卸载
-   */
-  onUnload: function () {
-
-  },
-
-  /**
-   * 页面相关事件处理函数--监听用户下拉动作
-   */
-  onPullDownRefresh: function () {
-
-  },
-
-  /**
-   * 页面上拉触底事件的处理函数
-   */
-  onReachBottom: function () {
-
-  },
-
-  /**
-   * 用户点击右上角分享
-   */
-  onShareAppMessage: function () {
-
-  }
-})

+ 0 - 4
pages/pyip/pyip.json

@@ -1,4 +0,0 @@
-{
-  "usingComponents": {},
-  "navigationBarTitleText":"随手拍"
-}

+ 0 - 26
pages/pyip/pyip.wxml

@@ -1,26 +0,0 @@
-<view>
-	<view class="pyp_box1">
-		<view class="add_text">添加图片或视频</view>
-		<image src="../../images/camera.png" class="xj" wx:if="{{carWin_img_hidden}}" bindtap="openCamera"></image>
-		<image src="{{carWin_img}}" class="xj" bindtap="openCamera" wx:if="{{carWin_img_type==0}}"></image>
-		<video class="xj" src="{{carWin_img}}" wx:if="{{carWin_img_type==1}}" show-center-play-btn='{{false}}' show-play-btn="{{true}}" controls></video>
-		<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>
-	<view class="pyp_box2" wx:if="{{isPhoto}}">
-		<view class="add_text">历史上传照片</view>
-		<view style="display:flex;flex-wrap:wrap">
-			<view wx:for="{{imgList}}" wx:for-item="item">
-				<image src="{{item.filePath}}" class="slt"></image>
-			</view>
-		</view>
-	</view>
-	<view class="pyp_box2" style="margin-bottom:50rpx" wx:if="{{isVideo}}">
-		<view class="add_text">历史上传视频</view>
-		<view style="display:flex;flex-wrap:wrap">
-			<view wx:for="{{videoList}}" wx:for-item="item">
-				<video src="{{item.filePath}}" show-center-play-btn='{{false}}' show-play-btn="{{true}}" controls class="xj"></video>
-			</view>
-		</view>
-	</view>
-</view>

+ 0 - 37
pages/pyip/pyip.wxss

@@ -1,37 +0,0 @@
-page {
-  background-color: #f2f2f2;
-}
-.pyp_box1 {
-  width: 680rpx;
-  height: 760rpx;
-  margin-left: 35rpx;
-  margin-top: 20rpx;
-  background-color: #fff;
-  border-radius: 30rpx;
-}
-.add_text {
-  margin-left: 35rpx;
-  padding-top: 20rpx;
-  color: #000
-}
-.xj{
-  width: 614rpx;
-  height: 393rpx;
-  margin-top: 20rpx;
-  margin-left: 30rpx;
-}
-.pyp_box2 {
-  width: 680rpx;
-  /* height: 620rpx; */
-  margin-left: 35rpx;
-  margin-top: 20rpx;
-  background-color: #fff;
-  border-radius: 30rpx;
-}
-.slt{
-  width: 200rpx;
-  height: 200rpx;
-  margin-left: 20rpx;
-  padding-bottom: 30rpx;
-  margin-top: 20rpx;
-}

+ 27 - 120
pages/studentRegistration/studentRegistration.js

@@ -11,16 +11,22 @@ Page({
     dyztext: '请选择',
     gygtext: '请选择',
     kaihuList: [{
-        name: '高中'
+        name: '小学'
       },
       {
-        name: '大专'
+        name: '初中'
       },
       {
-        name: '本科'
+        name: '高中(职高、中专)'
       },
       {
-        name: '硕士'
+        name: '大专(高职)'
+      }, {
+        name: '本科'
+      }, {
+        name: '硕士研究生'
+      }, {
+        name: '博士研究生'
       },
     ],
     kaihuindex: 0,
@@ -81,6 +87,8 @@ Page({
       }
       return value;
     },
+    // maxDate: new Date().getTime(),
+    minDate: new Date(1949, 10, 1).getTime(),
   },
   // ontimeInput(e){
   //   this.setData({
@@ -220,121 +228,12 @@ Page({
     })
   },
   formSubmit(e) {
-    if (!e.detail.value.username) {
-      this.setData({
-        nameIsTrue: true
-      })
-    } else {
-      this.setData({
-        nameIsTrue: false
-      })
-    }
-    let sex = '';
-    if (this.data.parameter[0].checked) {
-      sex = this.data.parameter[0].name
-      this.setData({
-        errorIsTrue: false
-      })
-    } else if (this.data.parameter[1].checked) {
-      sex = this.data.parameter[1].name
-      this.setData({
-        errorIsTrue: false
-      })
-    } else {
-      this.setData({
-        errorIsTrue: true
-      })
-    }
-    if (!e.detail.value.work) {
-      this.setData({
-        workIsTrue: true
-      })
-    } else {
-      this.setData({
-        workIsTrue: false
-      })
-    }
-    if (!e.detail.value.culture) {
-      this.setData({
-        cultureIsTrue: true
-      })
-    } else {
-      this.setData({
-        cultureIsTrue: false
-      })
-    }
-
-    if (!e.detail.value.graduation) {
-      this.setData({
-        graduationIsTrue: true
-      })
-    } else {
-      this.setData({
-        graduationIsTrue: false
-      })
-    }
-
-    if (!e.detail.value.major) {
-      this.setData({
-        majorIsTrue: true
-      })
-    } else {
-      this.setData({
-        majorIsTrue: false
-      })
-    }
-
-    if (!e.detail.value.post) {
-      this.setData({
-        postIsTrue: true
-      })
-    } else {
-      this.setData({
-        postIsTrue: false
-      })
-    }
-    if (!e.detail.value.phone) {
-      this.setData({
-        phoneIsTrue: true
-      })
-    } else {
-      this.setData({
-        phoneIsTrue: false
-      })
-    }
-    if (!this.data.tenure) {
-      this.setData({
-        renzhishijianIsTrue: true
-      })
-    } else {
-      this.setData({
-        renzhishijianIsTrue: false
-      })
-    }
-    if (!this.data.peixunTime) {
-      this.setData({
-        peixunshijianTrue: true
-      })
-    } else {
-      this.setData({
-        peixunshijianTrue: false
-      })
-    }
-    console.log(this.data.jobArr, this.data.jobIndex, "55555555")
     e.detail.value.culture = this.data.kaihuList[this.data.kaihuindex].name;
-    // const jIndex = this.data.jobArr.findIndex(o => o.dictLabel == this.data.jobtext)
-    // console.log(this.data.jobArr[jIndex].dictValue, "000000000000000000")
-    e.detail.value.studentDuty = Number(this.data.zwIndex)+1;
-    // e.detail.value.studentDuty=
-    // e.detail.value.isdy = this.data.dyArr[dyIndex];
+    e.detail.value.studentDuty = this.data.jobArr[this.data.zwIndex].dictValue
     e.detail.value.tenure = this.data.tenure;
     e.detail.value.sessionKey = this.data.sessionKey;
-    // if (this.data.wgzIndex) {
-    //   e.detail.value.wgzIndex = this.data.wgzIndex
-    // }
     let aa = e.detail.value
-    console.log(aa, "00000000")
-    if (aa.culture && aa.school && aa.studentDuty && aa.tenure && aa.studentDept) {
+    if (aa.culture && aa.school && aa.studentDuty && aa.tenure && aa.studentDept && aa.studentPhone) {
       wx.request({
         url: app.globalData.publicUrl + '/wx/student/upStudent',
         method: "post",
@@ -352,7 +251,6 @@ Page({
           unitLeader: this.data.dyzIndex, //单元长
           welfarePosition: this.data.gygIndex, //公益岗位
           partyMember: this.data.dyIndex //党员
-          // isdy: aa.isdy
         },
         success: () => {
           wx.showModal({
@@ -423,19 +321,24 @@ Page({
         })
         this.getBanner(sessionKey);
         console.log(this.data.jobArr, '我是新组成的数组')
+      },
+      fail: () => {
+        wx.hideLoading();
       }
     })
   },
   onReady: function () {},
   async onLoad() {
+    wx.showLoading({
+      title: '加载中',
+      mask: true
+    })
     const sessionKey = await tools.checkSessionAndLogin();
     console.log(sessionKey, "000000");
     this.setData({
       sessionKey: sessionKey
     })
     this.getjob(sessionKey)
-    
-    
   },
   getBanner(sessionKey) {
     wx.request({
@@ -445,7 +348,7 @@ Page({
         sessionKey: sessionKey,
       },
       success: (res) => {
-        console.log(res.data.data.studentDuty)
+        console.log(res)
         if (res.data.code == 0) {
           this.data.parameter.forEach(item => {
             if (item.value == res.data.data.studentSex) {
@@ -459,7 +362,7 @@ Page({
             zwIndex: Number(res.data.data.studentDuty) - 1,
             // jobtext: res.data.data.studentDuty,
             kaihutext: res.data.data.culture,
-            major: res.data.data.major,
+            mcajor: res.data.data.mcajor,
             tenure: res.data.data.tenure,
             studentPhone: res.data.data.studentPhone,
             wgzIndex: res.data.data.gridLeader, //网格长
@@ -468,7 +371,11 @@ Page({
             gygIndex: res.data.data.welfarePosition, //公益岗位
             dyIndex: res.data.data.partyMember //党员
           })
+          wx.hideLoading();
         }
+      },
+      fail: () => {
+        wx.hideLoading();
       }
     })
   }

+ 3 - 3
pages/studentRegistration/studentRegistration.wxml

@@ -55,7 +55,7 @@
 			</view>
 			<view class="xingbie">所学专业</view>
 			<view class='weui-input'>
-				<input class="" name="mcajor" value="{{ info.mcajor }}" placeholder="请输入所学专业" placeholder-style="font-size:25rpx" />
+				<input class="" name="mcajor" value="{{info.mcajor}}" placeholder="请输入所学专业" placeholder-style="font-size:25rpx" />
 			</view>
 		</view>
 		<view class='fwb'>
@@ -129,7 +129,7 @@
 				<picker bindchange="dyzChange" range-key="{{item}}" name="isld" value="{{dyzIndex}}" range="{{dyzArr}}">
 					<view class="weui-input aaa">
 						<!-- {{dyztext == null?'请选择':dyztext}} -->
-							{{dyzArr[dyzIndex]}}
+						{{dyzArr[dyzIndex]}}
 					</view>
 				</picker>
 			</view>
@@ -160,7 +160,7 @@
 			</view>
 			<van-popup show="{{postshow}}" position="bottom" custom-style="height: 50%;">
 				<!-- <van-datetime-picker bind:confirm="onConfirm" bind:cancel='onClose' type="date" value="{{currentDate}}" bind:input="onInput" min-date="{{ minDate }}" formatter="{{ formatter }}" /> -->
-				<van-datetime-picker bind:confirm="onConfirm" bind:cancel='onClose' type="date" value="{{currentDate}}" formatter="{{formatter}}" />
+				<van-datetime-picker bind:confirm="onConfirm" bind:cancel='onClose' min-date="{{minDate}}" max-date="{{currentDate}}" type="date" value="{{currentDate}}" formatter="{{formatter}}" />
 			</van-popup>
 		</view>
 		<view class='fwb'>

+ 1 - 1
project.config.json

@@ -24,7 +24,7 @@
 			"disablePlugins": [],
 			"outputPath": ""
 		},
-		"useCompilerModule": false,
+		"useCompilerModule": true,
 		"userConfirmedUseCompilerModuleSwitch": false
 	},
 	"compileType": "miniprogram",