index.js 975 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. import {getMultResult} from '../../../utils/util.js'
  2. let app = getApp()
  3. Page({
  4. data: {
  5. spinShow: false,
  6. paperId: null,
  7. answers:[],
  8. info: {},
  9. paper: {},
  10. answer: {},
  11. preList:["A","B","C", "D","E","F"],
  12. timer: null,
  13. doTime: 0,
  14. remainTime: 0,
  15. remainTimeStr: '',
  16. modalShow: false,
  17. result: 0,
  18. getMultResult,
  19. timeOutShow: false
  20. },
  21. onLoad: function(options) {
  22. let paperId = +options.id||5
  23. let _this = this
  24. app.formPost('Exam.PaperInfo',{paperId}).then(res => {
  25. if (res.code === 200) {
  26. _this.setData({
  27. info: res.data.info,
  28. answers: res.data.answers,
  29. paperId: paperId,
  30. });
  31. }
  32. })
  33. },
  34. onUnload() {
  35. clearInterval(this.data.timer)
  36. },
  37. returnRecord() {
  38. wx.reLaunch({
  39. url: '/pages/record/index',
  40. });
  41. },
  42. timeOut() {
  43. clearInterval(this.data.timer)
  44. this.setData({
  45. timeOutShow: true
  46. });
  47. }
  48. })