roose 5 年之前
父节点
当前提交
e778fd22f9

+ 4 - 1
app.json

@@ -1,8 +1,11 @@
 {
   "pages": [
-
     "pages/myClass/myClass",
     "pages/studentRegistration/studentRegistration",
+  
+   
+    "pages/last/last",
+
 
     "pages/evaluationCourse/evaluationCourse",
 

+ 2 - 1
pages/feedBack/feedBack.js

@@ -229,7 +229,8 @@ Page({
     wx.setStorageSync('questionList' + wx.getStorageSync('answersId'), this.data.questionList);
     wx.setStorageSync('chooseValue' + wx.getStorageSync('answersId'), this.data.chooseValue);
     console.log(this.data.questionList);
-
+    console.log( this.data.chooseValue,"0000");
+    
     // this.data.questionList[this.data.index].checked = e.detail.value;
 
     // this.setData({

+ 15 - 18
pages/feedBack/feedBack.wxml

@@ -1,15 +1,24 @@
 <view class="home">
 	<view wx:for="{{questionList}}">
-		<view class='fwb' wx:if="{{ item.QuestType == 3}}">
+		<view class='fwb' wx:if="{{ item.QuestType == 3 &&  item.QuestStem.length <5}}">
 			<view class="red-image">
 				<image src="/images/quan.png" style="width:20rpx;height:20rpx"> </image>
 			</view>
 			<view class="xingbie">{{item.QuestStem}}</view>
 			<view class='weui-input'>
 				<input name="{{item.name}}" value="{{item.QuestAnswer}}" data-index='{{index}}' data-questTypes='{{item.QuestType}}' data-idx='{{item.Id}}' bindinput='bindTextAreaBlur' placeholder="请输入" />
-				<!-- <view class="{{nameIsTrue?'error':'noerror'}}">请输入姓名</view> -->
+				<view class="{{nameIsTrue?'error':'noerror'}}">请输入姓名</view>
 			</view>
 		</view>
+		<view class='fwt' wx:if="{{ item.QuestType == 3  &&  item.QuestStem.length >= 5 }}">
+			<view class="red-image">
+				<image src="/images/quan.png" style="width:20rpx;height:20rpx"> </image>
+			</view>
+			<view class="flex-flex">
+				<view class=" xingbie moreTitle">{{item.QuestStem}}</view>
+				<textarea value="{{item.QuestAnswer}}" name="{{item.name}}" data-index='{{index}}' data-questTypes='{{item.QuestType}}' data-idx='{{item.Id}}' bindinput='bindTextAreaBlur' placeholder="请输入" maxlength='500' />
+				</view>
+			</view>
 		<view class='fwb' wx:if="{{ item.QuestType == 0}}">
 			<view class="red-image">
 				<image src="/images/quan.png" style="width:20rpx;height:20rpx"> </image>
@@ -54,32 +63,20 @@
 				<!-- <view class="{{nameIsTrue?'error':'noerror'}}">请输入姓名</view> -->
 			</view>
 		</view>
-		<view class='fwt' wx:if="{{ item.QuestStem.length > 10}}">
-			<view class="red-image">
-				<image src="/images/quan.png" style="width:20rpx;height:20rpx"> </image>
-			</view>
-			<view class="flex-flex">
-				<view class=" xingbie moreTitle">{{item.QuestStem}}</view>
-				<textarea value="{{item.QuestAnswer}}" name="{{item.name}}" data-index='{{index}}' data-questTypes='{{item.QuestType}}' data-idx='{{item.Id}}' bindinput='bindTextAreaBlur' placeholder="请输入" maxlength='500' />
-				</view>
-			</view>
-
-
-				<view class='fwb' wx:if="{{ item.QuestType == 6}}"> 
+		
+		<view class='fwb' wx:if="{{ item.QuestType == 6}}"> 
 				<view class="red-image">
 					<image src="/images/quan.png" style="width:20rpx;height:20rpx;"> </image>
 				</view>
 				<view class="xingbie">{{item.QuestStem}}</view>
-				<view class='weui-input' style="font-size: 26rpx;  line-height: 56rpx;"  data-index = '{{index}}' data-names='{{item.name}}'  catchtap="share1" name="{{item.name}}">
+			<view class='weui-input' style="font-size: 26rpx;  line-height: 56rpx;"  data-index = '{{index}}' data-names='{{item.name}}'  catchtap="share1" name="{{item.name}}">
 					<!-- QuestAnswer   chooseValue[index].currentAnswer -->
 			{{questionList[index].QuestAnswer}}<view wx:if='{{!questionList[index].QuestAnswer}}' style="color:#808080;display: inline-block;height:60rpx;line-height:60rpx;font-size:25rpx" >请选择</view>
 					<!-- <view class="{{renzhishijianIsTrue?'error':'noerror'}}">请输入任职时间</view> -->
 				</view>
-				 <cover-view>
-					<van-popup  show="{{ postshow[index] }}" position="bottom" custom-style="height: 50%;">
+				<van-popup  show="{{ postshow[index] }}" position="bottom" custom-style="height: 50%;">
 					<van-datetime-picker  data-index='{{index}}' data-questTypes='{{item.QuestType}}' data-idx = '{{item.Id}}'  bind:confirm="onConfirm" bind:cancel='onClose'  type="date" value="{{ currentDate }}" bind:input="onInput" min-date="{{ minDate }}" formatter="{{ formatter }}" />
 				</van-popup>
-					 </cover-view>
 			</view>
 
 		</view>

+ 168 - 0
pages/last/last.js

@@ -0,0 +1,168 @@
+//logs.js
+// const util = require('../../utils/util.js')
+const tools = require('../../utils/tools.js');
+const app = require('../../utils/util.js');
+Page({
+  data: {
+    dataArr: [
+      // {
+      //   "image": "/images/scdj1.jpg",
+      //   "name": "长春市社区工作者线上培训班",
+      //   "lecturer": "李老师",
+      //   "examBegin": "2020年07月10日",
+      //   examBegin:'2020202020222222'
+      // },{
+      //   "image": "/images/scdj2.jpg",
+      //   "name": "长春市专职党务工作者线上培训班",
+      //   "lecturer": "刘老师",
+      //   "examBegin": "2020年07月12日"
+      // },{
+      //   "image": "/images/scdj4.jpg",
+      //   "name": "区域党建联盟",
+      //   "lecturer": "王老师",
+      //   "examBegin": "2020年07月15日"
+      // },{
+      //   "image": "/images/scdj3.jpg",
+      //   "name": "小区党组织建设",
+      //   "lecturer": "张老师",
+      //   "examBegin": "2020年07月30日"
+      // }
+    ],
+    sessionKey: '',
+  },
+  checkboxChange() {
+
+  },
+  startAnswer(e) {
+    let id = e.currentTarget.dataset.idx;
+    let paperId = e.currentTarget.dataset.paperid;
+    let answersId = e.currentTarget.dataset.answersid;
+    console.log(this.data.sessionKey, "787878");
+
+    if (answersId) {
+      this.toPath(id, paperId, answersId);
+    } else {
+      // 获取answerid
+      this.beginKao(id, paperId, this.data.sessionKey);
+    }
+  },
+  toPath(id, paperId, answersId) {
+    wx.navigateTo({
+      url: '/pages/answerAfterclass/answerAfterclass?id=' + id + '&paperId=' + paperId + '&answersId=' + answersId,
+    })
+  },
+  beginKao(id, paperId, sessionKey) {
+    console.log(paperId, "8888888");
+    wx.request({
+      url: app.globalData.publicUrl + '/wx/exam/begin',
+      method: "post",
+      data: {
+        sessionKey: sessionKey,
+        id: id,
+        paperId: paperId
+      },
+      success: (res) => {
+        console.log(res);
+        if (res.data.code == 0) {
+          console.log(res, "为我么我们微妙"); // 提交答案是后
+          this.toPath(id, paperId, res.data.answersId);
+        }
+      }
+    })
+  },
+  lookAnswer(e) {
+    console.log("00000");
+    let answersId = e.currentTarget.dataset.answersid;
+    wx.request({
+      url: app.globalData.publicUrl + '/wx/answer/detail',
+      method: "post",
+      data: {
+        sessionKey: this.data.sessionKey,
+        answersId: answersId
+      },
+      success: (res) => {
+        console.log(res);
+        
+        if (res.data.code == 0) {
+          console.log(res, "suoyoude");
+          // wx.navigateTo({
+          //   url: '/pages/grade/grade?answersId=' + answersId,
+          // })
+          if (res.data.list[0].answerScore) {
+            wx.navigateTo({
+              url: '/pages/grade/grade?answersId=' + answersId,
+            })
+          } else {
+            wx.showModal({
+              title: '提示',
+              content: '当前老师批阅中,请耐心等待',
+              showCancel: false,
+
+            })
+          }
+          // res.data.list[0].forEach(item => {
+          //   if (item.answerScore) {
+          //     wx.navigateTo({
+          //       url: '/pages/grade/grade?answersId=' + answersId,
+          //     })
+          //   } else {
+          //     wx.showModal({
+          //       showCancel: false,
+          //       content: '当前老师批阅中,请耐心等待',
+          //       success(res) {}
+          //     })
+          //     // wx.showModal({
+          //     //   title: '提示',
+          //     //   content: '当前老师批阅中,请耐心等待',
+          //     //   showCancel: false,
+
+          //     // })
+          //   }
+          // })
+        }
+      }
+    })
+
+  },
+  async onLoad() {
+    const sessionKey = await tools.checkSessionAndLogin();
+    //const sessionKey = 'yoa0rZTt2bAiTVDsiRjysw==';
+    this.setData({
+      sessionKey: sessionKey
+    })
+    //....................
+    // if (wx.getStorageSync('questionList')) {
+    //   console.log("缓存锕锕66666666666666666666666666666666666666666666666666666");
+    //   this.setData({
+    //     questionList: wx.getStorageSync('questionList'),
+    //     index: wx.getStorageSync('titleINDEX'),
+    //     answersId:wx.getStorageSync('answersId'),
+    //     chooseValue:wx.getStorageSync('chooseValue'),
+    //   })
+    // } else {
+    //   console.log("请求了锕66666666666666666666666666666666666666666666666666666");
+
+    // }
+    this.getBanner(sessionKey);
+    //....................
+  },
+  getBanner(sessionKey) {
+    console.log(sessionKey, "sessionKey");
+    wx.request({
+      url: app.globalData.publicUrl + '/wx/exam/list',
+      method: "post",
+      data: {
+        sessionKey: sessionKey,
+      },
+      success: (res) => {
+        if (res.data.code == 0) {
+          console.log(res, "suoyoude");
+          this.setData({
+            dataArr: res.data.list
+          })
+          console.log(this.data.dataArr, ":000000");
+        }
+      }
+    })
+  },
+})

+ 3 - 0
pages/last/last.json

@@ -0,0 +1,3 @@
+{
+  "usingComponents": {}
+}

+ 15 - 0
pages/last/last.wxml

@@ -0,0 +1,15 @@
+<view class="container">
+	<view class="class_box" wx:for="{{dataArr}}" wx:for-index="idx" wx:for-item="item">
+		<image src="{{item.image}}" mode='aspectFill' class="scimg"></image>
+		<view class="sctext">
+			<view class="t1">{{item.examName}}</view>
+			<!-- {{ times(item.examBegin)}} -->
+			<view class="t2">主讲人: {{item.lecturer}} <text style="margin-left:20rpx"></text>{{ item.examBegin}}</view>
+			<view wx:if='{{item.status == 0}}' class="t3" bindtap="startAnswer" data-answersId='{{item.answersId}}' data-idx='{{item.id}}' data-paperId='{{item.paperId}}'>开始答题</view>
+			<view  wx:if='{{item.status == 1}}' class="t3"  bindtap="lookAnswer" data-answersId='{{item.answersId}}'>查看答案</view>
+			<!-- <view class="t3" bindtap="startAnswer" data-idx='{{item.id}}' data-paperId='{{item.paperId}}'>继续答题</view> -->
+		</view>
+		<view wx:if='{{item.status == 0}}' class="isanswertag">未答题</view>
+		<view wx:else class="isanswertag" class="isanswertag isanswertag1">已答题</view>
+	</view>
+</view>

+ 63 - 0
pages/last/last.wxss

@@ -0,0 +1,63 @@
+.class_box {
+  width: 710rpx;
+  margin-left: 20rpx;
+  height: 165rpx;
+  padding-bottom: 30rpx;
+  /* border: 1px solid red; */
+  /* margin-top: 30rpx; */
+  position: relative;
+  /* border: 1px solid red; */
+  border-bottom: 1px solid #d4d4d4;
+}
+
+.scimg {
+  width: 150rpx;
+  height: 141rpx;
+  float: left;
+  margin-top: 20rpx;
+}
+.sctext{
+float: right;
+height: 165rpx;
+width: 530rpx;
+/* border: 1px solid red;   */
+}
+.t1{
+  color: #000;
+  font-size: 28rpx;
+  margin-top: 45rpx;
+  font-weight: 700;
+}
+.t2{
+  color: #999999;
+  font-size: 24rpx;
+  margin-top: 10rpx;
+}
+.t3{
+  color: #fff;
+  font-size: 24rpx;
+  line-height: 30rpx;
+  margin-top: 10rpx;
+  width: 140rpx;
+  border-radius: 20rpx;
+  background-color: rgba(255,125,127);
+  text-align: center;
+  display: inline-block;
+ 
+}
+.isanswertag{
+  width: 140rpx;
+  background-color: #b9b9b9;
+  height: 40rpx;
+  line-height: 40rpx;
+  border-radius: 0 0 20rpx 20rpx;
+  position: absolute;
+  top: 0;
+  right: 0;
+  color: #fff;
+  font-size: 24rpx;
+  text-align: center;
+}
+.isanswertag1 {
+  background-color: #EC725D;
+}

+ 7 - 4
pages/personInfo/personInfo.js

@@ -25,10 +25,13 @@ Page({
     })
   },
   hqgz() {
-    wx.showModal({
-      showCancel: false,
-      content: "此功能暂时还未开放哦",
-      success(res) {}
+    // wx.showModal({
+    //   showCancel: false,
+    //   content: "此功能暂时还未开放哦",
+    //   success(res) {}
+    // })
+    wx.navigateTo({
+      url: '/pages/last/last',
     })
   }
 })

+ 37 - 12
pages/studentRegistration/studentRegistration.js

@@ -20,14 +20,17 @@ Page({
     peixunText: '请选择培训时间',
     radio: '1',
     username: 'asdsadsad',
+    info: {},
     parameter: [{
       id: 1,
       name: '男',
-      checked: true
+      value: '1',
+      checked: false
     }, {
       id: 2,
       name: '女',
-      checked: false
+      checked: false,
+      value: '0',
     }],
     renzhiDate: '',
     postshow: false,
@@ -243,12 +246,28 @@ Page({
     console.log(this.data.peixunTime, "培训时间000");
     console.log(sex, "性别的");
     e.detail.value.tenure = this.data.tenure;
-    e.detail.value.peixunTime = this.data.peixunTime;
-    e.detail.value.sex = sex;
-    e.detail.value.sessionKey = '00000000';
+    e.detail.value.sessionKey = this.data.sessionKey;
     console.log(e.detail.value, "我是合并后的锕");
-
-
+    let aa = e.detail.value
+    wx.request({
+      url: app.globalData.publicUrl + '/wx/upStudent/upStudent',
+      method: "post",
+      data: {
+  
+        studentDept: aa.studentDept,
+        culture: aa.culture,
+        school: aa.school,
+        studentDuty:aa.studentDuty,
+        tenure:aa.tenure,
+        studentPhone:aa.studentPhone,
+        sessionKey: this.data.sessionKey,
+        major:aa.major,
+      },
+      success: (res) => {
+        console.log(res);
+        
+      }
+    })
 
   },
 
@@ -273,7 +292,7 @@ Page({
   onReady: function () {},
   async onLoad() {
     const sessionKey = await tools.checkSessionAndLogin();
-    console.log(sessionKey,"000000");
+    console.log(sessionKey, "000000");
     this.setData({
       sessionKey: sessionKey
     })
@@ -290,12 +309,18 @@ Page({
       success: (res) => {
         if (res.data.code == 0) {
           console.log(res, "suoyoude");
-          // this.setData({
-          //   dataArr: res.data.list
-          // })
+          this.data.parameter.forEach(item => {
+            if (item.value == res.data.data.studentSex) {
+              item.checked = true;
+            }
+          })
+          console.log(this.data.parameter);
+          this.setData({
+            info: res.data.data,
+            parameter: this.data.parameter
+          })
         }
       }
     })
   },
-
 })

+ 3 - 3
pages/studentRegistration/studentRegistration.wxml

@@ -8,7 +8,7 @@
 				</view>
 				<view class="xingbie">姓名</view>
 				<view class='weui-input'>
-					<input name="username" disabled value="{{ username }}" placeholder="请输入姓名" placeholder-style="font-size:25rpx" />
+					<input name="username" disabled value="{{ info.miniName }}" placeholder="请输入姓名" placeholder-style="font-size:25rpx" />
 					<!-- <view class="{{nameIsTrue?'error':'noerror'}}">请输入姓名</view> -->
 				</view>
 			</view>
@@ -35,7 +35,7 @@
 					<view class="{{errorIsTrue?'error':'noerror'}}">请选择性别</view>
 				</view> -->
 					<radio-group name="{{item.name}}" data-index='{{index}}' data-idx='{{item.Id}}' data-questTypes='{{item.QuestType}}' >
-						<label class="checkbox my-choosebox {{ item.checked?'checkboxbox':''}}" wx:for-index="idx" wx:for="{{parameter}}">
+						<label class="checkbox my-choosebox {{ item.checked?'checkboxbox':''}}" checked="{{item.checked}}"  wx:for-index="idx" wx:for="{{parameter}}">
 							<radio value="{{ item.value }}" />{{item.name}}
 						</label>
 					</radio-group>
@@ -97,7 +97,7 @@
 				</view>
 				<view class="xingbie">现任职务</view>
 				<view class='weui-input'>
-					<input class="" name="post" value="{{ post }}" placeholder="请输入现任职务" placeholder-style="font-size:25rpx"/>
+					<input class="" name="studentDuty" value="{{ studentDuty }}" placeholder="请输入现任职务" placeholder-style="font-size:25rpx"/>
 					<!-- <view class="{{postIsTrue?'error':'noerror'}}">请输入现任职务</view> -->
 				</view>
 			</view>