edu-introuce.js 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. import {getDataSet, getEventParam} from "../../../../utils/utils";
  2. import {communityDetailTypes, formTypes, logicStatus, verifyTypes} from "../../../../model/enum";
  3. import Route from "../../../../model/route";
  4. const tabs1 = [
  5. {title: "学员手册", icon: '/images/ic_project_info.png'},
  6. {title: "文件上传", icon: '/images/ic_project_file.png'},
  7. {title: "班级群", icon: '/images/ic_class_team.png'},
  8. {title: "结业", icon: '/images/ic_graduation.png'}
  9. ]
  10. const tabs2 = [
  11. {title: "学员手册", icon: '/images/ic_project_info.png'},
  12. {title: "班级群", icon: '/images/ic_class_team.png'},
  13. {title: "结业", icon: '/images/ic_graduation.png'}
  14. ]
  15. Component({
  16. properties: {
  17. isPre: {
  18. type: Number,
  19. value: logicStatus.NO
  20. },
  21. item: Object,
  22. students: Array,
  23. messageList: Array,
  24. isRefresh: Boolean,
  25. isLoading: Boolean,
  26. noMore: Boolean,
  27. },
  28. observers: {
  29. 'isPre': async function (isPre) {
  30. if (isPre == logicStatus.YES) {
  31. this.setData({
  32. tabs: tabs2
  33. })
  34. } else {
  35. this.setData({
  36. tabs: tabs1
  37. })
  38. }
  39. }
  40. },
  41. data: {
  42. logicStatusEnum: logicStatus,
  43. tabs: tabs1,
  44. },
  45. methods: {
  46. toDetail(e) {
  47. let detail = JSON.stringify(getEventParam(e, "res"));
  48. let item = JSON.stringify(this.data.item);
  49. Route.tocCommunityDetail(communityDetailTypes.CLASS, "班级动态", "", "", detail, item,
  50. this.data.isPre, {
  51. comment: () => {
  52. this.triggerEvent("publish", {isSuccess: true})
  53. }
  54. })
  55. },
  56. checkIn(e) {
  57. if (this.data.item.isReport) {
  58. return;
  59. }
  60. Route.toChekIn(verifyTypes.REPORT, "报到", this.data.item.itemName, "", this.data.item.teamId, this.data.item.eduStuId,
  61. {
  62. check: () => {
  63. this.triggerEvent("refresh")
  64. }
  65. })
  66. },
  67. toStudent(e) {
  68. Route.toStudent(this.data.item.teamId, this.data.item.eduStuId);
  69. },
  70. publishInfo(e) {
  71. Route.toCommunityForm(formTypes.DYNAMIC, this.data.item.teamId, this.data.item.eduStuId,
  72. this.data.item.eduStuName, {
  73. publish: (res) => {
  74. this.triggerEvent("publish", res)
  75. }
  76. })
  77. },
  78. async toClickGrid(e) {
  79. const title = getDataSet(e, "title");
  80. if ('文件上传' == title) {
  81. Route.toUploadFile("", "文件上传", this.data.item.teamId)
  82. } else if ('结业' == title) {
  83. let detailParams = {...this.data.item, picUrl: '', itemName: ''};
  84. let detail = JSON.stringify(detailParams);
  85. Route.toGraduation(this.data.isPre, detail, {
  86. refresh: () => {
  87. this.triggerEvent("refresh")
  88. }
  89. })
  90. } else if ('班级群' == title) {
  91. Route.toClassTeam(this.data.item.teamId)
  92. } else if ('学员手册' == title) {
  93. Route.toStudentBookList(this.data.item.teamId)
  94. }
  95. },
  96. goRegister() {
  97. Route.toStuInfo(this.data.item.teamId, this.data.item.eduStuId, {
  98. refresh: () => {
  99. this.triggerEvent("refresh")
  100. }
  101. });
  102. }
  103. },
  104. });