roose 5 lat temu
rodzic
commit
d1743127a2

+ 8 - 8
app.json

@@ -1,14 +1,14 @@
 {
   "pages": [
+    "pages/welcome/welcome",
+    "pages/personInfo/personInfo",
+    "pages/last/last",
+    "pages/lastdetail/lastdetail",
+    "pages/lastdetailDetail/lastdetailDetail",
+    "pages/answerAfterclasses/answerAfterclasses",
     "pages/myClass/myClass",
     "pages/studentRegistration/studentRegistration",
-  
-   
-    "pages/last/last",
-
-
     "pages/evaluationCourse/evaluationCourse",
-
     "pages/studentRegistrationDeyail/studentRegistrationDeyail",
     "pages/feedBack/feedBack",
     "pages/index/index",
@@ -16,7 +16,7 @@
     "pages/answerAfterclass/answerAfterclass",
     "pages/feedBackDetail/feedBackDetail",
     "pages/evaluationCourseDetail/evaluationCourseDetail",
-    "pages/welcome/welcome",
+   
     "pages/onlineClass/onlineClass",
     "pages/dbDetails/dbDetails",
     "pages/dbVideo/dbVideo",
@@ -27,7 +27,7 @@
     "pages/exhibitionList/exhibitionList",
     "pages/startClass/startClass",
     "pages/demandCourses/demandCourses",
-    "pages/personInfo/personInfo",
+  
     "pages/myInteractionsDetais/myInteractionsDetais",
     "pages/myPoints/myPoints",
     "pages/Identity/Identity",

+ 368 - 0
pages/answerAfterclasses/answerAfterclasses.js

@@ -0,0 +1,368 @@
+const app = require('../../utils/util.js');
+const tools = require('../../utils/tools.js');
+Page({
+  data: {
+    index: 0, // 题目序列
+    chooseValue: [], // 选择的答案序列
+    questionList: [
+      // {
+      //   id: 10,
+      //   "QuestStem": "以下属于传统协同办公应用开发的典型问题的是?",
+      //   'QuestChoice': [{
+      //       name: 'a',
+      //       value: 'aaaaaaa',
+      //       checked: false
+      //     },
+      //     {
+      //       name: 'aa',
+      //       value: 'sdsdsd',
+      //       checked: false
+      //     },
+      //     {
+      //       name: 'a3',
+      //       value: 'ewewewe',
+      //       checked: false
+      //     },
+      //   ],
+      //   "QuestType": 1,
+      //   "checked": false
+      // },
+      // {
+      //   id: 12,
+      //   "QuestStem": "企业微信建立开放办公应用生态的主要策略是000?",
+      //   "QuestChoice": ['A', 'B'],
+      //   "QuestType": 2,
+      //   "scores": 10,
+      //   "checked": false
+      // },
+
+      // {
+      //   id: 123,
+      //   "QuestStem": "企业微信建立开放办公应用生态的主要策略是?",
+      //   "QuestType": 3,
+      //   "scores": 10,
+      //   "checked": false
+      // },
+    ],
+    totalScore: 0,
+    id: '', //考试主键id(可取list接口中id)
+    paperId: '', //试卷id(可取list接口中paperId)
+    answersId: '', // 提交答案
+    sessionKey: '',
+  },
+  /*
+   * 单选事件
+   */
+  radioChange: function (e) {
+    console.log('checkbox发生change事件,携带value值为:', e.detail.value)
+    let json = {};
+    json.currentAnswer = e.detail.value;
+    json.id = e.currentTarget.dataset.idx;
+    json.questType = e.currentTarget.dataset.questtypes;
+    console.log("题目", this.data.questionList)
+    this.data.chooseValue[this.data.index] = json;
+    this.data.questionList[this.data.index].checked = e.detail.value;
+
+    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) {
+    console.log('checkbox发生change事件,携带value值为:', e.detail.value)
+    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
+    })
+    console.log(this.data.questionList, "7878787878");
+
+    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);
+
+
+
+  },
+  /*
+   * 解答事件
+   */
+  bindTextAreaBlur(e) {
+    console.log(e.detail.value);
+    let json = {};
+    json.currentAnswer = e.detail.value;
+    json.id = e.currentTarget.dataset.idx;
+    json.questType = e.currentTarget.dataset.questtypes;
+    this.data.chooseValue[this.data.index] = json;
+    this.data.questionList[this.data.index].currentAnswer = e.detail.value;
+    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);
+
+  },
+  /*
+   * 下一题/提交 按钮
+   */
+  nextSubmit: function () {
+    // 判断是不是最后一题
+    if (this.data.index < this.data.questionList.length - 1) {
+      // 渲染下一题
+      this.setData({
+        index: this.data.index + 1
+      })
+      wx.setStorageSync('titleINDEX' + wx.getStorageSync('answersId'), this.data.index);
+    } else {
+      console.log(this.data.chooseValue);
+      if (wx.getStorageSync('chooseValue' + this.data.answersId)) {
+        this.setData({
+          chooseValue: wx.getStorageSync('chooseValue' + this.data.answersId)
+        })
+      }
+      this.submitAll(this.data.chooseValue);
+    }
+  },
+  upSubmit() {
+    this.setData({
+      index: this.data.index - 1
+    })
+    wx.setStorageSync('titleINDEX' + wx.getStorageSync('answersId'), this.data.index);
+    console.log(this.data.chooseValue, "88888888888888888888888888");
+    console.log(this.data.chooseValue[this.data.index]);
+
+    //this.data.chooseValue[this.data.index].currentAnswer
+
+  },
+  // onLoad: function (options) {
+  //   let a = [{
+  //       "QuestType": "3",
+  //       "QuestStem": "子类从父类那里继承什么方法和状态?",
+  //       "QuestAnswer": "",
+  //       "QuestChoice": "",
+  //       "Id": 39
+  //     },
+  //     {
+  //       "QuestType": "0",
+  //       "QuestStem": "MyObject 的什么方法会对if表达式的正确性产生影响\n     List l = new LinkedList();\n     l.add(new MyObject(\"A\"));\n    if(l.contains(new MyObject(\"A\"))){}",
+  //       "QuestAnswer": "equals ()",
+  //       "QuestChoice": "toString()||equals ()||hashCode()||clone()",
+  //       "Id": 36
+  //     },
+  //     {
+  //       "QuestType": "1",
+  //       "QuestStem": "MyObject 的什么方法会对if表达式的正确性产生影响(多选)   Map m = new HashMap;    m.add(new MyObject(\"A\"));    if(m.contains(new MyObject(\"A\"))){}",
+  //       "QuestAnswer": "equals ()||\nhashCode()||",
+  //       "QuestChoice": "toString()||\nequals ()||\nhashCode()||\nclone()||",
+  //       "Id": 38
+  //     },
+  //     {
+  //       "QuestType": "2",
+  //       "QuestStem": "1+1=2",
+  //       "QuestAnswer": "是",
+  //       "QuestChoice": "是||否",
+  //       "Id": 42
+  //     },
+
+  //   ];
+  //   let jsonArr = a.map(item => {
+  //     let json = {};
+  //     json.QuestType = item.QuestType;
+  //     json.id = item.Id;
+  //     json.QuestAnswer = item.QuestAnswer;
+  //     json.QuestStem = item.QuestStem;
+  //     if (item.QuestChoice) {
+  //       let arr = item.QuestChoice.split('||');
+  //       json.QuestChoice = arr;
+  //     }
+  //     return json;
+  //   })
+  //   this.setData({
+  //     questionList: jsonArr
+  //   })
+
+  // }
+  // onShow: function () {
+  //   console.log("show0000000000000000000000000000000000000000000000000000000000000000000000");
+  //   console.log(wx.getStorageSync('answersId'),"onshow  的 answeid");
+  //   // console.log(wx.getStorageSync('questionList'+((wx.getStorageSync('answersId'))),"78978978979877777");
+  //   if (wx.getStorageSync('questionList'+wx.getStorageSync('answersId'))) {
+  //     console.log("缓村了锕");
+  //     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')),
+  //     })
+  //     console.log(this.data.questionList,"show 缓存的数据");
+  //   }else{
+  //     this.allShi(this.data.id, this.data.paperId, this.data.sessionKey);
+  //     console.log(this.data.questionList,"show 没有缓存");
+  //   }
+  // },
+  async onLoad(options) {
+    // //const sessionKey = await tools.checkSessionAndLogin();
+    // console.log("onload..................................");
+    // wx.setStorageSync('answersId', options.answersId);
+    // console.log(options.answersId,"传值的缓冲answersId");
+    // console.log(wx.getStorageSync('answersId'),"1111111111111111111");
+
+    // const sessionKey = 'yoa0rZTt2bAiTVDsiRjysw==';
+    // this.setData({
+    //   sessionKey: sessionKey,
+    //   paperId:options.paperId,
+    //   answersId:options.answersId,
+    //   id:options.id,
+    // })
+    // console.log(wx.getStorageSync('answersId'),"onload中  的 answeid");
+
+    // //....................  
+    // console.log(wx.getStorageSync('questionList'+wx.getStorageSync('answersId')),"111111111111111111111");
+    // if (wx.getStorageSync('questionList'+wx.getStorageSync('answersId'))) {
+    //   this.setData({
+    //     questionList: wx.getStorageSync('questionList'+wx.getStorageSync('answersId')),
+    //     index: wx.getStorageSync('titleINDEX'+wx.getStorageSync('answersId')),
+    //     answersId: wx.getStorageSync('answersId'+wx.getStorageSync('answersId')),
+    //     chooseValue:wx.getStorageSync('chooseValue'+wx.getStorageSync('answersId')),
+    //   })
+    //   console.log("onload  有缓存");
+    //   console.log(this.data.questionList,"onload  有缓存的数据");
+    // } else {
+    //   console.log("onload  没有缓存");
+
+    //   this.allShi(options.id, options.paperId, sessionKey);
+    // }
+    // //....................
+
+    const sessionKey = await tools.checkSessionAndLogin();
+    //const sessionKey = 'BqQROCKCxn7R2NXdQLud9Q==';
+    console.log("onloading.....................");
+    wx.setStorageSync('answersId', options.answersId);
+    this.setData({
+      sessionKey: sessionKey,
+      paperId: options.paperId,
+      answersId: options.answersId,
+      id: options.id,
+    })
+    console.log(options.answersId, "00000000000000000000000000");
+    console.log(wx.getStorageSync('answersId'), "1111111111111");
+    if (wx.getStorageSync('questionList' + wx.getStorageSync('answersId'))) {
+      console.log("缓村了锕");
+      const questionList = wx.getStorageSync('questionList' + wx.getStorageSync('answersId'));
+      this.setData({
+        questionList: questionList,
+        answersId: wx.getStorageSync('answersId'),
+        chooseValue: wx.getStorageSync('chooseValue' + wx.getStorageSync('answersId')),
+        index: wx.getStorageSync('titleINDEX' + wx.getStorageSync('answersId')),
+      })
+      console.log(this.data.questionList, "show 缓存的数据");
+    }else{
+      console.log("无缓存");
+      this.allShi(options.id, options.paperId, sessionKey);
+    }
+    
+
+  },
+
+  allShi(id, paperId, sessionKey) {
+    wx.request({
+      url: app.globalData.publicUrl + '/wx/paper/detail',
+      method: "post",
+      data: {
+        sessionKey: sessionKey,
+        id: id,
+        paperId: paperId
+      },
+      success: (res) => {
+        let jsonArr = JSON.parse(res.data.paperContent).map(item => {
+          let json = {};
+          json.QuestType = item.QuestType;
+          json.id = item.Id;
+          json.QuestAnswer = item.QuestAnswer;
+          json.QuestStem = item.QuestStem;
+          if (item.QuestChoice) {
+            let arr = item.QuestChoice.split('||');
+            json.QuestChoice = arr;
+          }
+          if (item.QuestType == '1') {
+            let arr = item.QuestChoice.split('||');
+            let arrJson = arr.map(item => {
+              let json1 = {};
+              json1.name = item;
+              json1.value = item;
+              json1.checked = false;
+              return json1
+            });
+            json.QuestChoice = arrJson;
+          }
+          return json;
+        })
+        this.setData({
+          questionList: jsonArr
+        })
+        wx.setStorageSync('questionList' + wx.getStorageSync('answersId'), this.data.questionList);
+      }
+    })
+  },
+  submitAll(currentAnswerTemp) {
+    console.log();
+    wx.request({
+      url: app.globalData.publicUrl + '/wx/paper/commit',
+      method: "post",
+      data: {
+        sessionKey: this.data.sessionKey,
+        currentAnswerTemp: currentAnswerTemp,
+        answersId: wx.getStorageSync('answersId')
+      },
+      success: (res) => {
+        console.log(res);
+        if (res.data.msg == '请勿重复提交') {
+          wx.showModal({
+            showCancel: false,
+            content: '当前老师批阅中,' + res.data.msg,
+            success(res) {}
+          })
+        } else {
+          if (res.data.code == 0) {
+            console.log(res, "为我么我们微妙"); // 提交答案是后
+            // this.setData({
+            //   answersId: res.data.answersId
+            // })
+            // this.allShi(id, paperId, sessionKey);
+            wx.switchTab({
+              url: '/pages/testAnswer/testAnswer',
+            })
+           
+          }
+        }
+
+
+      }
+    })
+  }
+
+})

+ 4 - 0
pages/answerAfterclasses/answerAfterclasses.json

@@ -0,0 +1,4 @@
+{
+  "navigationBarTitleText":"答题测试",
+  "usingComponents": {}
+}

+ 63 - 0
pages/answerAfterclasses/answerAfterclasses.wxml

@@ -0,0 +1,63 @@
+<view class='home'>
+	<view class="box">
+		<view> 共<view class="ti">{{index+1}}</view>/{{questionList.length}}题</view>
+	</view>
+	<view class="question">
+		{{questionList[index].QuestStem}}
+		{{questionList[index].QuestType == 0?'【单选】':questionList[index].QuestType == 1?'【多选】':questionList[index].QuestType == 2?'【判断】':'【解答】'}}
+	</view>
+</view>
+<view class="qiu-box">
+	<view class="qiu"></view>
+	<view class="qiu"></view>
+	<view class="qiu"></view>
+	<view class="qiu"></view>
+	<view class="qiu"></view>
+	<view class="qiu"></view>
+	<view class="qiu"></view>
+	<view class="qiu"></view>
+	<view class="qiu"></view>
+	<view class="qiu"></view>
+	<view class="qiu"></view>
+	<view class="qiu"></view>
+	<view class="qiu"></view>
+	<view class="qiu"></view>
+	<view class="qiu"></view>
+	<view class="qiu"></view>
+	<view class="qiu"></view>
+	<view class="qiu"></view>
+	<view class="qiu"></view>
+	<view class="qiu"></view>
+	<view class="qiu"></view>
+	<view class="qiu"></view>
+	<view class="qiu"></view>
+	<view class="qiu"></view>
+	<view class="qiu"></view>
+	<view class="qiu"></view>
+	<view class="qiu"></view>
+	<view class="qiu"></view>
+</view>
+<radio-group class="parameter-wrap" data-questTypes='{{questionList[index].QuestType}}' data-idx='{{questionList[index].id}}' bindchange="radioChange" wx:if="{{questionList[index].QuestType == 0}}">
+	<label class=" radio my-choosebox  {{ questionList[index].checked == item?'checkboxbox':''}}" wx:for-index="idx" wx:for="{{questionList[index].QuestChoice}}">
+		<radio value="{{item}}" />{{item}}
+	</label>
+</radio-group>
+<!-- questionList[index].item.checked  -->
+<checkbox-group class="parameter-wrap" data-questTypes='{{questionList[index].QuestType}}' data-idx='{{questionList[index].id}}' bindchange="checkboxChange" wx:if="{{questionList[index].QuestType == 1}}">
+	<label class="checkbox my-choosebox {{ item.checked?'checkboxbox':''}}" wx:for-index="idx" wx:key="{{item.value}}" wx:for="{{questionList[index].QuestChoice}}">
+		<checkbox value="{{item.value}}" checked="{{item.checked}}" />{{item.name}}
+	</label>
+</checkbox-group>
+<radio-group class="parameter-wrap " data-questTypes='{{questionList[index].QuestType}}' data-idx='{{questionList[index].id}}' bindchange="radioChange" wx:if="{{questionList[index].QuestType == 2}}">
+	<label class=" radio my-choosebox   {{ questionList[index].checked == item?'checkboxbox':''}}" wx:for-index="idx" wx:for="{{questionList[index].QuestChoice}}">
+		<radio value="{{item}}" checked="{{questionList[index].checked == item}}" />{{item}}
+	</label>
+</radio-group>
+<view wx:if="{{questionList[index].QuestType == 3}}" data-idx='{{questionList[index].id}}'>
+	<textarea data-questTypes='{{questionList[index].QuestType}}' data-idx='{{questionList[index].id}}' bindinput='bindTextAreaBlur' value="{{questionList[index].currentAnswer}}" placeholder="请输入答案" />
+	</view>
+
+
+<van-button bindtap='nextSubmit' wx:if="{{index == questionList.length-1}}" round type="default">提交答案</van-button>
+<van-button wx:else round type="default" bindtap='nextSubmit'>下一题</van-button>
+<van-button wx:if='{{index !=0}}' round type="default" bindtap='upSubmit'>上一题</van-button>

+ 95 - 0
pages/answerAfterclasses/answerAfterclasses.wxss

@@ -0,0 +1,95 @@
+.home {
+  width: 100%;
+  height: 340rpx;
+  background: #EB3F33;
+}
+
+.box {
+  margin: 40rpx 40rpx 0 40rpx;
+  border-bottom: 1rpx solid rgba(221, 221, 221, 1);
+  padding-top: 24rpx;
+  color: white;
+  font-size: 25rpx;
+}
+
+.ti {
+  display: inline-block;
+  color: #FFB71C;
+}
+
+.question {
+  margin: 50rpx 60rpx 0 60rpx;
+  color: white;
+  text-align: justify;
+  font-size: 28rpx;
+}
+
+.qiu {
+  width: 20rpx;
+  height: 20rpx;
+  border-radius: 50%;
+  background: white;
+  margin-left: 10rpx;
+}
+
+.qiu-box {
+  display: flex;
+  margin-top: -10rpx;
+}
+.parameter-wrap{
+  display: flex;
+  flex-direction:column
+}
+
+.parameter-info {
+  font-size: 30rpx;
+  font-family: Source Han Sans CN;
+  font-weight: 400;
+  color: rgba(51, 51, 51, 1);
+  border:1px solid rgba(235,63,51,1);
+  border-radius: 40rpx;
+  padding: 20rpx;
+  margin: 20rpx 50rpx;
+}
+.checked_parameter {
+  color: white;
+  background: #EB3F33;
+}
+.van-button--default {
+  background:linear-gradient(90deg,rgba(215,47,29,1),rgba(249,157,48,1)) !important;
+  color: white!important;
+}
+button:not([size='mini']) {
+  /* margin: 40rpx 0 60rpx 60rpx !important; */
+  width: 80% !important;
+  margin-left: 10% !important;
+  margin-top: 5% !important ;
+  }
+  /* .my-choosebox radio{
+    display: none
+  } */
+  .my-choosebox {
+    color: rgba(51, 51, 51, 1);
+    border: 1px solid rgba(235,63,51,1);
+    border-radius: 40rpx;
+    padding: 20rpx 50rpx;
+    margin: 15rpx 50rpx;
+  }
+  .checkboxbox{
+    background:#EB3F33;
+    color: white;
+  }
+  .parameter-wrap radio {
+    display: none;
+  }
+  .parameter-wrap checkbox {
+    display: none;
+  }
+
+  textarea {
+    border: 1px solid rgba(217, 217, 217, 1);
+    margin: 0 auto;
+    height: 200rpx;
+    margin-top: 50rpx;
+  }
+  

+ 49 - 55
pages/last/last.js

@@ -29,6 +29,7 @@ Page({
       // }
     ],
     sessionKey: '',
+    classInfo:{},
   },
   checkboxChange() {
 
@@ -40,15 +41,18 @@ Page({
     console.log(this.data.sessionKey, "787878");
 
     if (answersId) {
+      console.log("有answeid");
+      
       this.toPath(id, paperId, answersId);
     } else {
+      console.log("没有");
       // 获取answerid
       this.beginKao(id, paperId, this.data.sessionKey);
     }
   },
   toPath(id, paperId, answersId) {
     wx.navigateTo({
-      url: '/pages/answerAfterclass/answerAfterclass?id=' + id + '&paperId=' + paperId + '&answersId=' + answersId,
+      url: '/pages/lastdetail/lastdetail?id=' + id + '&paperId=' + paperId + '&answersId=' + answersId,
     })
   },
   beginKao(id, paperId, sessionKey) {
@@ -85,40 +89,9 @@ Page({
         
         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,
-
-          //     // })
-          //   }
-          // })
+          wx.navigateTo({
+            url: '/pages/lastdetailDetail/lastdetailDetail?answersId=' + answersId,
+          })
         }
       }
     })
@@ -126,41 +99,62 @@ Page({
   },
   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);
-    //....................
+    this.isClass(sessionKey);
+   
   },
   getBanner(sessionKey) {
     console.log(sessionKey, "sessionKey");
     wx.request({
-      url: app.globalData.publicUrl + '/wx/exam/list',
+      url: app.globalData.publicUrl + '/wx/exam/quesExamList',
       method: "post",
       data: {
         sessionKey: sessionKey,
+        questSub:'2',
+        clasId: this.data.classInfo.id
       },
       success: (res) => {
+        console.log(res,"00000000000000000000000");
+
+        if (res.data.code == 0) {
+         this.setData({
+          dataArr :res.data.list
+         })
+        }
+      }
+    })
+  },
+   // 查询我是否有班&&班级名字
+   isClass(sessionKey) {
+    // let _this = this;
+    wx.request({
+      url: app.globalData.publicUrl + '/wx/student/selMyClas',
+      method: "post",
+      data: {
+        sessionKey: sessionKey
+      },
+      success: (res) => {
+        console.log(res.data.code, "我是返回是否有班级")
         if (res.data.code == 0) {
-          console.log(res, "suoyoude");
           this.setData({
-            dataArr: res.data.list
+            classInfo: res.data.data
+          })
+          this.getBanner(sessionKey);
+        } else {
+          wx.showModal({
+            content: "您当前还没有开放的班级!",
+            showCancel: false,
+            success(res) {
+              if (res.confirm) {
+                wx.switchTab({
+                  url: '../index/index'
+                })
+              }
+            }
           })
-          console.log(this.data.dataArr, ":000000");
+          return false;
         }
       }
     })

+ 2 - 1
pages/last/last.json

@@ -1,3 +1,4 @@
 {
-  "usingComponents": {}
+  "usingComponents": {},
+  "navigationBarTitleText":"后期跟踪"
 }

+ 3 - 3
pages/last/last.wxml

@@ -1,6 +1,6 @@
 <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>
+		<!-- <image src="{{item.image}}" mode='aspectFill' class="scimg"></image> -->
 		<view class="sctext">
 			<view class="t1">{{item.examName}}</view>
 			<!-- {{ times(item.examBegin)}} -->
@@ -9,7 +9,7 @@
 			<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 wx:if='{{item.status == 0}}' class="isanswertag">未答题</view>
+		<view wx:else class="isanswertag" class="isanswertag isanswertag1">已答题</view> -->
 	</view>
 </view>

+ 1 - 1
pages/last/last.wxss

@@ -17,7 +17,7 @@
   margin-top: 20rpx;
 }
 .sctext{
-float: right;
+margin-left: 20rpx;
 height: 165rpx;
 width: 530rpx;
 /* border: 1px solid red;   */

+ 753 - 0
pages/lastdetail/lastdetail.js

@@ -0,0 +1,753 @@
+//index.js
+//获取应用实例
+const app = require('../../utils/util.js');
+const tools = require('../../utils/tools.js');
+Page({
+  data: {
+    nameIsTrue: false, //名字是否填写
+    cultureIsTrue: false, //文化是否填写
+    graduationIsTrue: false, //毕业学校
+    majorIsTrue: false, //所有专业
+    postIsTrue: false, //现任职务
+    renzhishijianIsTrue: false,
+    phoneIsTrue: false, //电话
+    peixunshijianTrue: false, // 培训时间
+    nameMessage: '',
+    zaizhiTime: [], //在线时间
+    peixunTime: '', //培训时间
+    headmasterText: [], // 
+    names: [],
+    timeIndex: '',
+    chooseValue: [], // 选择的答案序列
+    radio: '1',
+    renzhiDate: '',
+    postshow: [],
+    postshow1: false,
+    errorIsTrue: false,
+    currentDate: new Date().getTime(),
+    currentDate1: new Date().getTime(),
+    minDate: new Date().getTime,
+    formatter(type, value) {
+      if (type === 'year') {
+        return `${value}年`;
+      } else if (type === 'month') {
+        return `${value}月`;
+      }
+      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',
+      // },
+
+    ],
+    answersId: '', // 提交答案用到
+    sessionKey: '',
+    paperId: '',
+    answersId: '',
+    id: '',
+    status: ''
+  },
+  onChange(event) {
+    this.setData({
+      radio: event.detail,
+    });
+  },
+  radioChange(e) {
+    console.log(e);
+    const items = this.data.questionList[e.currentTarget.dataset.index].QuestChoice
+    for (let i = 0, len = items.length; i < len; ++i) {
+      items[i].checked = items[i].value === e.detail.value
+    }
+
+    let json = {};
+    json.currentAnswer = e.detail.value;
+    json.id = e.currentTarget.dataset.idx;
+    json.questType = e.currentTarget.dataset.questtypes;
+    this.data.chooseValue[e.currentTarget.dataset.index] = json;
+    this.setData({
+      questionList: this.data.questionList
+    })
+    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({
+    //   questionList: this.data.questionList
+    // })
+    // const items = this.data.items
+    // for (let i = 0, len = items.length; i < len; ++i) {
+    //   items[i].checked = items[i].value === e.detail.value
+    // }
+
+    // this.setData({
+    //   items
+    // })
+  },
+  checkboxChange(e) {
+    const items = this.data.questionList[e.currentTarget.dataset.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
+        }
+      }
+    }
+    let json = {};
+    let aa = e.detail.value.join("||")
+    json.currentAnswer = aa;
+    json.id = e.currentTarget.dataset.idx;
+    json.questType = e.currentTarget.dataset.questtypes;
+    this.data.chooseValue[e.currentTarget.dataset.index] = json;
+    this.setData({
+      questionList: this.data.questionList
+    })
+    wx.setStorageSync('questionList' + wx.getStorageSync('answersId'), this.data.questionList);
+    wx.setStorageSync('chooseValue' + wx.getStorageSync('answersId'), this.data.chooseValue);
+  },
+  bindTextAreaBlur(e) {
+    console.log(e, "hhhhh");
+    console.log(e.detail.value);
+    let json = {};
+    json.currentAnswer = e.detail.value;
+    json.id = e.currentTarget.dataset.idx;
+    json.questType = e.currentTarget.dataset.questtypes;
+    this.data.chooseValue[e.currentTarget.dataset.index] = json;
+    this.data.questionList[e.currentTarget.dataset.index].QuestAnswer = e.detail.value;
+    this.setData({
+      questionList: this.data.questionList
+    })
+    wx.setStorageSync('questionList' + wx.getStorageSync('answersId'), this.data.questionList);
+    wx.setStorageSync('chooseValue' + wx.getStorageSync('answersId'), this.data.chooseValue);
+  },
+  share() {
+    this.setData({
+      show: true
+    });
+  },
+  onClose() {
+    this.setData({
+      ['postshow[' + this.data.timeIndex + ']']: false,
+    });
+  },
+  onClose1() {
+    console.log("11111111111111");
+    this.setData({
+      postshow1: false
+    });
+  },
+  onInput(event) {
+    console.log(event, "8888888");
+
+    console.log("点击了");
+    this.setData({
+      currentDate: event.detail,
+    });
+  },
+  onInput1(event) {
+    console.log("000");
+    this.setData({
+      currentDate1: event.detail,
+    });
+  },
+
+  formatDate(date) {
+    date = new Date(date);
+    return `${date.getFullYear()-1}/${date.getMonth() + 1}/${date.getDate()}`;
+  },
+
+  share1(e) {
+    console.log(e);
+    console.log(e.currentTarget.dataset.index);
+    console.log(e.currentTarget.dataset.names, "8520852085208520");
+    console.log(this.data.postshow[e.currentTarget.dataset.index]);
+    this.data.postshow[e.currentTarget.dataset.index] = true;
+    this.data.names[e.currentTarget.dataset.index] = e.currentTarget.dataset.names;
+    this.setData({
+      postshow: this.data.postshow,
+      timeIndex: e.currentTarget.dataset.index
+    })
+    console.log(this.data.postshow, "打印下锕啊啊啊啊锕锕锕");
+
+    // this.setData({
+    //   postshow: true
+    // });
+  },
+  share() {
+    this.setData({
+      postshow1: true
+    });
+  },
+  formatDate(date) {
+    date = new Date(date);
+    return `${date.getFullYear()-1}/${date.getMonth() + 1}/${date.getDate()}`;
+  },
+  onConfirm(event) {
+    console.log(event, "1111111");
+    let timeValue = this.timeFormat(new Date(event.detail), "yyyy-MM-dd");
+    let json = {};
+    json.currentAnswer = timeValue;
+    json.id = event.currentTarget.dataset.idx;
+    json.questType = event.currentTarget.dataset.questtypes;
+    let aa = this.data.chooseValue[event.currentTarget.dataset.index] = json;
+    this.data.questionList[event.currentTarget.dataset.index].QuestAnswer = timeValue;
+    this.setData({
+      questionList: this.data.questionList,
+      ['chooseValue[' + event.currentTarget.dataset.index + ']']: aa,
+      ['postshow[' + this.data.timeIndex + ']']: false,
+      ['headmasterText[' + this.data.timeIndex + ']']: '',
+    });
+    wx.setStorageSync('questionList' + wx.getStorageSync('answersId'), this.data.questionList);
+    wx.setStorageSync('chooseValue' + wx.getStorageSync('answersId'), this.data.chooseValue);
+    console.log(this.data.chooseValue, "确定后的值锕");
+    console.log(this.data.questionList, "789789798789");
+
+
+  },
+  onConfirm1(event) {
+    console.log(event, "0000");
+    let timeValue = this.timeFormat(new Date(event.detail), "yyyy-MM-dd");
+    this.setData({
+      peixunTime: timeValue,
+      postshow1: false,
+      peixunText: ''
+    });
+  },
+  parameterTap: function (e) { //e是获取e.currentTarget.dataset.id所以是必备的,跟前端的data-id获取的方式差不多
+    let that = this
+    let this_checked = e.currentTarget.dataset.id
+    let parameterList = this.data.parameter //获取Json数组
+    for (let i = 0; i < parameterList.length; i++) {
+      if (parameterList[i].id == this_checked) {
+        parameterList[i].checked = true; //当前点击的位置为true即选中
+      } else {
+        parameterList[i].checked = false; //其他的位置为false
+      }
+    }
+    that.setData({
+      parameter: parameterList
+    })
+  },
+  submitForm() {
+    //let arr1 = this.data.chooseValue.filter(d => d);
+    //console.log(arr1,"打印下提交");
+    console.log(this.data.chooseValue, "打印下提交");
+    wx.request({
+      url: app.globalData.publicUrl + '/wx/paper/commit',
+      method: "post",
+      data: {
+        sessionKey: this.data.sessionKey,
+        currentAnswerTemp: this.data.chooseValue,
+        answersId: wx.getStorageSync('answersId')
+      },
+      success: (res) => {
+        console.log(res);
+        if (res.data.msg == "请勿重复提交") {
+          wx.showModal({
+            showCancel: false,
+            content: res.data.msg,
+            success(res) {}
+          })
+        } else {
+          wx.navigateTo({
+            url: '/pages/last/last',
+          })
+        }
+
+      }
+    })
+
+
+    let isTrue = false;
+    // this.data.chooseValue.forEach(item => {
+    //   console.log(item, "123123");
+    //   if (item.currentAnswer) {
+    //     isTrue = true;
+
+    //   } else {
+    //     wx.showModal({
+    //       showCancel: false,
+    //       content: item.QuestStem + "不能为空",
+    //       success(res) {}
+    //     })
+    //   }
+    // })
+    // if (isTrue) {
+    //   console.log("提交了");
+    //   wx.request({
+    //     url: app.globalData.publicUrl + '/wx/paper/commit',
+    //     method: "post",
+    //     data: {
+    //       sessionKey: this.data.sessionKey,
+    //       currentAnswerTemp: this.data.chooseValue,
+    //       answersId: wx.getStorageSync('answersId')
+    //     },
+    //     success: (res) => {
+    //       console.log(res);
+    //       if(res.data.msg == "请勿重复提交"){
+    //         wx.showModal({
+    //           showCancel: false,
+    //           content: res.data.msg,
+    //           success(res) {}
+    //         })
+    //       }else{
+    //         wx.navigateTo({
+    //           url: '/pages/myClass/myClass',
+    //         })
+    //       }
+
+    //     }
+    //   })
+    // }
+
+
+  },
+  formSubmit(e) {
+    console.log(e.detail.value, "000000000000000");
+    let arr1 = this.data.zaizhiTime.filter(d => d);
+    let arr = this.data.names.filter(d => d);
+    var activeSubjectsArr = [];
+    for (var i = 0; i < arr.length; i++) {
+      var activeSubjectsObject = {};
+      for (var j = 0; j < arr1.length; j++) {
+        if (i == j) {
+          activeSubjectsObject[arr[i]] = arr1[j];
+          activeSubjectsArr.push(activeSubjectsObject);
+        }
+      }
+    }
+    console.log(activeSubjectsArr, "7777777");
+    let count = 0;
+    let data = {};
+    for (let a in e.detail.value) {
+      count += 1;
+      if (count = 1) {
+        data[a] = e.detail.value[a]
+      }
+    }
+    activeSubjectsArr.forEach(item => {
+      Object.assign(data, item)
+    })
+    console.log(data, "888888888888888888888888");
+    // Object.keys(data).forEach(function (key) {
+    //   if (!data[key]) {
+    //     wx.showModal({
+    //       showCancel: false,
+    //       content: key + "不能为空"
+    //     })
+    //     return;
+    //   }
+
+    // });
+    // 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.zaizhiTime) {
+    //   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.zaizhiTime, "在职时间000");
+    // console.log(this.data.peixunTime, "培训时间000");
+    // console.log(sex, "性别的");
+    // e.detail.value.zaizhiTime = this.data.zaizhiTime;
+    // e.detail.value.peixunTime = this.data.peixunTime;
+    // e.detail.value.sex = sex;
+    // console.log(e.detail.value, "我是合并后的锕");
+
+
+
+  },
+  timeFormat(date, fmt) {
+    let o = {
+      "M+": date.getMonth() + 1, //月份   
+      "d+": date.getDate(), //日
+      "h+": date.getHours(), //小时   
+      "m+": date.getMinutes(), //分   
+      "s+": date.getSeconds(), //秒   
+      "q+": Math.floor((date.getMonth() + 3) / 3), //季度   
+      "S": date.getMilliseconds() //毫秒   
+    };
+    if (/(y+)/.test(fmt))
+      fmt = fmt.replace(RegExp.$1, (date.getFullYear() + "").substr(4 - RegExp.$1.length));
+    for (let k in o)
+      if (new RegExp("(" + k + ")").test(fmt))
+        fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
+    return fmt;
+
+  },
+  onReady: function () {},
+  async onLoad(options) {
+    const sessionKey = await tools.checkSessionAndLogin();
+    console.log(sessionKey, "111");
+
+    //const sessionKey = 'BqQROCKCxn7R2NXdQLud9Q==';
+    console.log("onloading.....................");
+    // let chooceArr = this.data.questionList.map(item => {
+    //   let json = {};
+    //   json.currentAnswer = '';
+    //   json.questType = '';
+    //   json.id = item.Id;
+    //   json.QuestStem = item.QuestStem;
+    //   return json
+    // })
+    // console.log(chooceArr);
+    // this.setData({
+    //   chooseValue: chooceArr
+    // })
+    console.log(options.answersId, "00000000000000000000000000");
+    console.log(options, "11111");
+    wx.setStorageSync('answersId', options.answersId);
+    this.setData({
+      sessionKey: sessionKey,
+      paperId: options.paperId,
+      answersId: options.answersId,
+      id: options.id,
+    })
+    if (wx.getStorageSync('questionList' + wx.getStorageSync('answersId'))) {
+      console.log("缓村了锕");
+      const questionList = wx.getStorageSync('questionList' + wx.getStorageSync('answersId'));
+      this.setData({
+        questionList: questionList,
+        answersId: wx.getStorageSync('answersId' + wx.getStorageSync('answersId')),
+        chooseValue: wx.getStorageSync('chooseValue' + wx.getStorageSync('answersId')),
+      })
+      console.log(this.data.questionList, "show 缓存的数据");
+    } else {
+      console.log("无缓存");
+      this.allShi(this.data.id, this.data.paperId, this.data.sessionKey);
+    }
+
+    // if (wx.getStorageSync('questionList' + wx.getStorageSync('answersId'))) {
+    //   console.log("缓村了锕");
+    //   const questionList = wx.getStorageSync('questionList' + wx.getStorageSync('answersId'));
+    //   this.setData({
+    //     questionList: questionList,
+    //     answersId: wx.getStorageSync('answersId' + wx.getStorageSync('answersId')),
+    //     chooseValue: wx.getStorageSync('chooseValue' + wx.getStorageSync('answersId')),
+    //   })
+    //   console.log(this.data.questionList, "show 缓存的数据");
+    // } else {
+    //   console.log("无缓存");
+    //   this.allShi(this.data.id, this.data.paperId, this.data.sessionKey);
+    // }
+  },
+  allShi(id, paperId, sessionKey) {
+    wx.request({
+      url: app.globalData.publicUrl + '/wx/paper/detail',
+      method: "post",
+      data: {
+        sessionKey: sessionKey,
+        id: id,
+        paperId: paperId
+      },
+      success: (res) => {
+        let jsonArr = JSON.parse(res.data.paperContent).map(item => {
+          let json = {};
+          json.QuestType = item.QuestType;
+          json.Id = item.Id;
+          json.QuestAnswer = item.QuestAnswer;
+          json.QuestStem = item.QuestStem;
+          // if (item.QuestChoice) {
+          //   let arr = item.QuestChoice.split('||');
+          //   json.QuestChoice = arr;
+          // }
+          if (item.QuestType == '1' || item.QuestType == '0') {
+            let arr = item.QuestChoice.split('||');
+            let arrJson = arr.map(item => {
+              let json1 = {};
+              json1.name = item;
+              json1.value = item;
+              json1.checked = false;
+              return json1
+            });
+            json.QuestChoice = arrJson;
+          }
+          return json;
+        })
+
+        // for(let i = 0 ; i<jsonArr.length; i++){
+        //    let json = {};
+        //    json.currentAnswer = '';
+        //    json.questType = '';
+        //    json.id = '';
+        // }
+        //  答案锕 
+        let chooceArr = jsonArr.map(item => {
+          let json = {};
+          json.currentAnswer = '';
+          json.questType = '';
+          json.id = item.Id;
+          json.QuestStem = item.QuestStem;
+          return json
+        })
+        this.setData({
+          questionList: jsonArr,
+          chooseValue: chooceArr
+        })
+        console.log(this.data.questionList, "00000");
+        wx.setStorageSync('questionList' + wx.getStorageSync('answersId'), this.data.questionList);
+        wx.setStorageSync('chooseValue' + wx.getStorageSync('answersId'), this.data.chooseValue);
+      }
+    })
+  },
+})

+ 4 - 0
pages/lastdetail/lastdetail.json

@@ -0,0 +1,4 @@
+{
+  "usingComponents": {},
+  "navigationBarTitleText":"综合反馈表"
+}

+ 86 - 0
pages/lastdetail/lastdetail.wxml

@@ -0,0 +1,86 @@
+<view class="home">
+	<view wx:for="{{questionList}}">
+		<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>
+		</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>
+			</view>
+			<view class="xingbie">{{item.QuestStem}}</view>
+			<view class='weui-input' style=" background: white">
+				<radio-group name="{{item.name}}" data-index='{{index}}' data-idx='{{item.Id}}' data-questTypes='{{item.QuestType}}' bindchange="radioChange">
+					<label class="checkbox my-choosebox {{ item.checked?'checkboxbox':''}}" wx:for-index="idx" wx:for="{{item.QuestChoice}}">
+						<radio value="{{ item.value }}" />{{item.name}}
+					</label>
+				</radio-group>
+				<!-- <view class="{{nameIsTrue?'error':'noerror'}}">请输入姓名</view> -->
+			</view>
+		</view>
+
+		<view class='fwb' wx:if="{{ item.QuestType == 1}}">
+			<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=" background: white">
+				<checkbox-group name="{{item.name}}" data-index='{{index}}' data-idx='{{item.Id}}' data-questTypes='{{item.QuestType}}' bindchange="checkboxChange">
+					<label class="checkbox my-choosebox {{ item.checked?'checkboxbox':''}}" wx:for-index="idx" wx:for="{{item.QuestChoice}}">
+						<checkbox value="{{ item.value }}" />{{item.name}}
+					</label>
+				</checkbox-group>
+				<!-- <view class="{{nameIsTrue?'error':'noerror'}}">请输入姓名</view> -->
+			</view>
+		</view>
+
+		<view class='fwb' wx:if="{{ item.QuestType == 2}}">
+			<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=" background: white">
+				<radio-group name="{{item.name}}" data-index='{{index}}' data-idx='{{item.Id}}' data-questTypes='{{item.QuestType}}' bindchange="radioChange">
+					<label class="checkbox my-choosebox {{ item.checked?'checkboxbox':''}}" wx:for-index="idx" wx:for="{{item.QuestChoice}}">
+						<radio value="{{ item.value }}" />{{item.name}}
+					</label>
+				</radio-group>
+				<!-- <view class="{{nameIsTrue?'error':'noerror'}}">请输入姓名</view> -->
+			</view>
+		</view>
+		
+		<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}}">
+					<!-- 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>
+				<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>
+			</view>
+
+		</view>
+		<view style="margin-top: 100rpx;margin-bottom:100rpx">
+			<van-button   round bindtap="submitForm">提交表单</van-button>
+		</view>
+</view>

+ 171 - 0
pages/lastdetail/lastdetail.wxss

@@ -0,0 +1,171 @@
+.home {
+  margin: 0 40rpx;
+  margin-top: 40rpx;
+}
+
+van-button {
+  color: white;
+  text-align: center;
+  margin: 0 60rpx;
+}
+
+.van-button--default {
+  background: linear-gradient(90deg, rgba(215, 47, 29, 1), rgba(249, 157, 48, 1)) !important;
+  color: white !important;
+
+}
+
+.van-field__input {
+  background: #F4F4F4 !important;
+}
+
+button:not([size='mini']) {
+  width: 550rpx !important;
+}
+
+.van-radio__icon--round {
+  display: none !important;
+}
+
+.van-radio__label {
+  background: red;
+  padding: 0 70rpx;
+}
+
+.parameter-wrap {
+  margin-left: 20rpx;
+
+}
+
+.checked_parameter {
+  background: linear-gradient(90deg, rgba(215, 47, 29, 1), rgba(249, 157, 48, 1)) !important;
+  color: white;
+}
+
+.parameter-info {
+  width: 232rpx;
+  background: #FFF0ED;
+  border-radius: 10rpx;
+  display: inline-block;
+  text-align: center;
+  padding: 10rpx 0;
+}
+
+.parameter-info:first-child {
+  margin-right: 10rpx;
+}
+
+.fwb {
+  display: flex;
+  font-size: 28rpx;
+  margin-top: 40rpx;
+}
+
+
+
+.error {
+  font-size: 24rpx;
+  color: #EE0A24;
+  background: white;
+
+}
+
+.noerror {
+  display: none !important;
+
+}
+
+.time {
+  margin-left: 18rpx;
+  font-size: 28rpx;
+  color: #808080;
+  background: #F4F4F4;
+  width: 452rpx;
+  padding: 0 10rpx;
+}
+
+.weui-input {
+  margin-left: 20rpx;
+  background: #F4F4F4;
+  width: 474rpx;
+
+}
+
+.weui-input input {
+  height: 60rpx;
+}
+
+.van-icon-circle {
+  color: #EE0A24;
+  /* margin-top: 30rpx; */
+
+}
+
+.xingbie {
+  margin-left: 10rpx;
+  width: 130rpx;
+  line-height: 60rpx;
+}
+
+.red-image {
+  vertical-align: text-bottom;
+  margin-top: 10rpx;
+}
+
+input {
+  height: 40rpx;
+}
+
+.moreTitle {
+  width: 600rpx;
+
+}
+
+textarea {
+  background: rgba(244, 244, 244, 1);
+  border-radius: 10px;
+  border: 1rpx solid rgba(244, 244, 244, 1);
+  width: 100%;
+  height: 194rpx;
+  margin-top: 20rpx;
+}
+
+.fwt {
+  display: flex;
+  font-size: 28rpx;
+  margin-top: 40rpx;
+}
+
+.flex-flex {
+  display: flex;
+  flex-direction: column;
+}
+
+.big-vover {
+  z-index: 999;
+}
+
+.weui-input radio {
+  display: none;
+
+}
+
+.weui-input checkbox {
+  display: none;
+}
+
+.checkboxbox {
+  background: linear-gradient(90deg, rgba(215, 47, 29, 1), rgba(249, 157, 48, 1)) !important;
+  color: white !important;
+ 
+}
+
+.my-choosebox {
+  color: rgba(51, 51, 51, 1);
+  width: 200rpx;
+  padding: 10rpx 80rpx;
+  background: #FFF0ED;
+  margin: 10rpx;
+  line-height: 80rpx;
+  border-radius: 10rpx;
+}

+ 76 - 0
pages/lastdetailDetail/lastdetailDetail.js

@@ -0,0 +1,76 @@
+//index.js
+//获取应用实例
+const app = require('../../utils/util.js');
+const tools = require('../../utils/tools.js');
+Page({
+  data: {
+    // 课程轮播
+    "bnrUrl": [{
+      "url": "/images/banner2.jpg",
+      "name": "二期素质教育培训",
+      "zbf": "xx委员会",
+      "starttime": "2020年6月"
+    }, {
+      "url": "/images/banner1.jpg",
+      "name": "三期素质教育培训",
+      "zbf": "xx委员会",
+      "starttime": "2020年6月"
+    }, {
+      "url": "/images/banner2.jpg",
+      "name": "四期素质教育培训",
+      "zbf": "xx委员会",
+      "starttime": "2020年6月"
+    }],
+    gridArr: [
+      // {
+      //   "num": "1",
+      //   "qusetion": "深入贯彻习近平总书记关于加大社会组织党建工作 力度的重要批示精神,坚决落实社会组织与社会组 织党组织“五个同步”,五个同步是以下哪一个?",
+      //   'daanTrue': 'B. 同培育、同孵化',
+      //   'daanFalse': 'A. 同培育、同孵化、同年检、同评估',
+      // },
+      // {
+      //   "num": "2",
+      //   "qusetion": "深入贯彻习近平总书记关于加大社会组织党建工作 力度的重要批示精神,坚决落实社会组织与社会组 织党组织“五个同步”,五个同步是以下哪一个?",
+      //   'daanTrue': 'B. 同培育、同孵化、同年检',
+      //   'daanFalse': 'A. 同培育、同孵化、同年检、同评估',
+      // },
+      // {
+      //   "num": "3",
+      //   "qusetion": "深入贯彻习近平总书记关于加大社会组织党建工作 力度的重要批示精神,坚决落实社会组织与社会组 织党组织“五个同步”,五个同步是以下哪一个?",
+      //   'daanTrue': 'B. 同培育、同孵化、同年检',
+      //   'daanFalse': 'A. 同培育、同孵化、同年检、同评估',
+      // },
+    ],
+
+  },
+  chengji(sessionKey, answersId) {
+    wx.request({
+      url: app.globalData.publicUrl + '/wx/answer/detail',
+      method: "post",
+      data: {
+        sessionKey: sessionKey,
+        answersId: answersId
+      },
+      success: (res) => {
+        if (res.data.code == 0) {
+          console.log(res, "suoyoude");
+          this.setData({
+            gridArr:res.data.list
+          })
+          console.log(this.data.gridArr);
+        }
+      }
+    })
+  },
+  onReady: function () {},
+  async onLoad(options) {
+    console.log(options.answersId);
+    console.log("onload..................................");
+    let answersId = options.answersId;
+    const sessionKey = 'yoa0rZTt2bAiTVDsiRjysw==';
+    //const sessionKey = await tools.checkSessionAndLogin();  
+    this.chengji(sessionKey, answersId);
+
+  },
+
+})

+ 6 - 0
pages/lastdetailDetail/lastdetailDetail.json

@@ -0,0 +1,6 @@
+{
+  "usingComponents": {},
+  "navigationBarTitleText":"后期跟踪",
+  "navigationBarBackgroundColor": "#eb3f33",
+  "navigationBarTextStyle": "white"
+}

+ 24 - 0
pages/lastdetailDetail/lastdetailDetail.wxml

@@ -0,0 +1,24 @@
+<view class="home">
+	<view class="box">
+		<view class="redk"></view>后期跟踪
+		<view class="cuoti-box" wx:for="{{gridArr}}">
+			<view class="number">
+				{{index+1}}
+			</view>
+			<view class="wenti">
+				<view style=" margin-right: 20rpx;">
+					{{item.questStem}} :{{item.currentAnswer}}
+				</view>
+				<!-- <view class="daan">
+					正确答案: <view class="zhengquedaan">{{item.correctAnswer}}</view>
+				</view> -->
+				<!-- <view class="daan">
+					我的答案: <view class="wodedaan">{{item.currentAnswer}}</view>
+				</view>
+				<view class="daan">
+					分数: <view class="wodedaan">{{item.score}}</view>
+				</view> -->
+			</view>
+		</view>
+	</view>
+</view>

+ 87 - 0
pages/lastdetailDetail/lastdetailDetail.wxss

@@ -0,0 +1,87 @@
+
+.box {
+  margin: 0 40rpx;
+  background-color: white;
+  border-radius: 20rpx;
+  padding-top: 30rpx;
+  font-size: 26rpx;
+  padding-bottom: 20rpx;
+}
+.yuan{
+  height: 160rpx;
+  width: 160rpx;
+  border-radius: 50%;
+  background-color: white;
+   display: flex;
+   flex-direction: column;
+   text-align: center;
+  margin: 0 auto;
+   
+}
+.title{
+  font-size: 20rpx;
+  color: white;
+}
+.fen{
+  font-size: 50rpx;
+  color: white;
+  margin-top: 10rpx;
+}
+.nei{
+  height: 123rpx;
+  width: 123rpx;
+  background-color: #EB3F33;
+  border-radius: 50%;
+  margin: 0 auto;
+  margin-top: 18rpx;
+  box-shadow:rgba(235,63,51,0.3) 0px 0px 20px;
+  
+}
+.redk {
+  height: 33rpx;
+  width: 8rpx;
+  background-color: #eb3f33;
+  border-radius: 5rpx;
+  margin-right: 10rpx;
+  margin-left: 40rpx;
+  float: left;
+}
+.cuoti-box{
+  background:rgba(172,213,152,0.2);
+  border-radius:7rpx;
+  display: flex;
+  margin: 40rpx;
+  padding-top: 10rpx;
+  padding-left: 10rpx;
+}
+.wenti{
+  text-align: justify;
+  font-size: 25rpx;
+  margin-left: 20rpx;
+  width: 620rpx;
+}
+.daan{
+  font-size: 21rpx;
+  margin: 20rpx 20rpx 20rpx 0rpx;
+}
+.number{
+  height: 30rpx;
+  line-height: 30rpx;
+  width: 34rpx;
+  border-radius: 34rpx;
+  border: 1rpx solid black;
+  text-align: center;
+}
+.zhengquedaan{
+  display: inline-block;
+  color: #00B627;
+}
+.wodedaan{
+  display: inline-block;
+  color: #EB3F33;
+}
+
+page {
+  background:#F4F4F4
+  
+}

+ 13 - 8
pages/studentRegistration/studentRegistration.js

@@ -250,22 +250,21 @@ Page({
     console.log(e.detail.value, "我是合并后的锕");
     let aa = e.detail.value
     wx.request({
-      url: app.globalData.publicUrl + '/wx/upStudent/upStudent',
+      url: app.globalData.publicUrl + '/wx/student/upStudent',
       method: "post",
       data: {
-  
         studentDept: aa.studentDept,
         culture: aa.culture,
         school: aa.school,
-        studentDuty:aa.studentDuty,
-        tenure:aa.tenure,
-        studentPhone:aa.studentPhone,
+        studentDuty: aa.studentDuty,
+        tenure: aa.tenure,
+        studentPhone: aa.studentPhone,
         sessionKey: this.data.sessionKey,
-        major:aa.major,
+        mcajor: aa.mcajor,
       },
       success: (res) => {
         console.log(res);
-        
+
       }
     })
 
@@ -317,7 +316,13 @@ Page({
           console.log(this.data.parameter);
           this.setData({
             info: res.data.data,
-            parameter: this.data.parameter
+            parameter: this.data.parameter,
+            studentDept: res.data.data.studentDept,
+            studentDuty:res.data.data.studentDuty,
+            culture:res.data.data.culture,
+            major:res.data.data.major,
+            tenure:res.data.data.tenure,
+            studentPhone:res.data.data.studentPhone,
           })
         }
       }

+ 5 - 5
pages/studentRegistration/studentRegistration.wxml

@@ -52,7 +52,7 @@
 				</view>
 				<view class="xingbie">工作单位</view>
 				<view class='weui-input'>
-					<input class="" name="studentDept" value="{{ studentDept }}" placeholder="请输入工作单位" placeholder-style="font-size:25rpx"/>
+					<input class=""  name="studentDept" value="{{ studentDept }}" placeholder="请输入工作单位" placeholder-style="font-size:25rpx"/>
 					<!-- <view class="{{workIsTrue?'error':'noerror'}}">请输入工作单位</view> -->
 				</view>
 			</view>
@@ -74,7 +74,7 @@
 				</view>
 				<view class="xingbie">毕业学校</view>
 				<view class='weui-input'>
-					<input class="" name="school" value="{{ school }}" placeholder="请输入毕业学校" placeholder-style="font-size:25rpx"/>
+					<input class="" name="school" value="{{ info.school }}" placeholder="请输入毕业学校" placeholder-style="font-size:25rpx"/>
 					<!-- <view class="{{graduationIsTrue?'error':'noerror'}}">请输入毕业学校</view> -->
 				</view>
 			</view>
@@ -85,7 +85,7 @@
 				</view>
 				<view class="xingbie">所学专业</view>
 				<view class='weui-input'>
-					<input class="" name="major" value="{{ major }}" placeholder="请输入所学专业" placeholder-style="font-size:25rpx"/>
+					<input class="" name="mcajor" value="{{ info.mcajor }}" placeholder="请输入所学专业" placeholder-style="font-size:25rpx"/>
 					<!-- <view class="{{majorIsTrue?'error':'noerror'}}">请输入所学专业</view> -->
 				</view>
 			</view>
@@ -97,7 +97,7 @@
 				</view>
 				<view class="xingbie">现任职务</view>
 				<view class='weui-input'>
-					<input class="" name="studentDuty" value="{{ studentDuty }}" placeholder="请输入现任职务" placeholder-style="font-size:25rpx"/>
+					<input class="" disabled name="studentDuty" value="{{ studentDuty }}" placeholder="请输入现任职务" placeholder-style="font-size:25rpx"/>
 					<!-- <view class="{{postIsTrue?'error':'noerror'}}">请输入现任职务</view> -->
 				</view>
 			</view>
@@ -121,7 +121,7 @@
 				</view>
 				<view class="xingbie">联系电话</view>
 				<view class='weui-input'>
-					<input class="" name="studentPhone" value="{{ studentPhone }}" placeholder="请输入联系电话" placeholder-style="font-size:25rpx"/>
+					<input class=""  name="studentPhone" value="{{ studentPhone }}" placeholder="请输入联系电话" placeholder-style="font-size:25rpx"/>
 					<!-- <view class="{{phoneIsTrue?'error':'noerror'}}">请输入联系电话</view> -->
 				</view>
 			</view>

+ 1 - 1
pages/testAnswer/testAnswer.js

@@ -48,7 +48,7 @@ Page({
   },
   toPath(id, paperId, answersId) {
     wx.navigateTo({
-      url: '/pages/answerAfterclass/answerAfterclass?id=' + id + '&paperId=' + paperId + '&answersId=' + answersId,
+      url: '/pages/answerAfterclasses/answerAfterclasses?id=' + id + '&paperId=' + paperId + '&answersId=' + answersId,
     })
   },
   beginKao(id, paperId, sessionKey) {