graduation.js 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. import {logicStatus} from "../../model/enum";
  2. import {toast} from "../../utils/utils";
  3. import Route from "../../model/route";
  4. Page({
  5. data: {
  6. eInfo: {},
  7. isPre: logicStatus.NO,
  8. logicStatusEnum: logicStatus,
  9. },
  10. onLoad: function (options) {
  11. let isPre = options.isPre;
  12. let detail = JSON.parse(options.detail);
  13. this.setData({
  14. isPre,
  15. eInfo: detail
  16. })
  17. },
  18. toCertificate(e) {
  19. let detail = JSON.stringify(this.data.eInfo);
  20. Route.toCertificate(detail, {
  21. get: () => {
  22. const eventChannel = this.getOpenerEventChannel()
  23. eventChannel.emit('refresh');
  24. }
  25. })
  26. },
  27. toQuestion(e) {//调查
  28. let eInfo = this.data.eInfo;
  29. if (eInfo.isQuestionnaire == logicStatus.NO) {
  30. Route.toQuestionDetail(eInfo.questionnaireId, eInfo.teamId, "", "", eInfo.eduStuId,
  31. {
  32. answer: () => {
  33. this.setData({
  34. 'eInfo.isQuestionnaire': 1
  35. })
  36. const eventChannel = this.getOpenerEventChannel()
  37. eventChannel.emit('refresh');
  38. }
  39. });
  40. } else {
  41. toast("已完成问卷")
  42. }
  43. },
  44. toQuestion2(e) {//综合
  45. let eInfo = this.data.eInfo;
  46. if (eInfo.isComprehensive == logicStatus.NO) {
  47. Route.toQuestionDetail(eInfo.comprehensiveId, eInfo.teamId, "", "", eInfo.eduStuId,
  48. {
  49. answer: () => {
  50. this.setData({
  51. 'eInfo.isComprehensive': 1
  52. })
  53. const eventChannel = this.getOpenerEventChannel()
  54. eventChannel.emit('refresh');
  55. }
  56. });
  57. } else {
  58. toast("已完成问卷")
  59. }
  60. },
  61. toExam(e) {//期末
  62. let eInfo = this.data.eInfo;
  63. if (eInfo.isExam == logicStatus.NO) {
  64. Route.toExamDetail(eInfo.paperId, eInfo.examId, eInfo.eduStuId, {
  65. answer: () => {
  66. this.setData({
  67. 'eInfo.isExam': 1
  68. })
  69. const eventChannel = this.getOpenerEventChannel()
  70. eventChannel.emit('refresh');
  71. }
  72. });
  73. } else {
  74. toast("已完成试卷")
  75. }
  76. }
  77. })