123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113 |
- import {toast} from "../../utils/utils";
- import {
- checkStatus,
- courseProcess,
- courseStatus,
- courseTypes,
- liveSources,
- liveStatus,
- logicStatus,
- verifyTypes
- } from "../../model/enum";
- import Route from "../../model/route";
- Component({
- properties: {
- item: {
- type: Object,
- value: {}
- },
- obj: {
- type: Object,
- value: {}
- },
- showBottom: {
- type: Boolean,
- value: false
- },
- type: Number,
- isPre: Number,
- },
- data: {
- logicStatusEnum: logicStatus,
- },
- methods: {
- async check(e) {
- let item = this.data.item;
- let obj = this.data.obj;
- let signStatus = item.signStatus;
- if (signStatus == checkStatus.DEFAULT) {
- Route.toChekIn(verifyTypes.CHECK_IN, "签到", item.courseName || item.ceremonyName, item.id, obj.teamId, obj.eduStuId, {
- check: () => {
- this.triggerEvent("refresh")
- }
- })
- }
- },
- question(e) {
- let item = this.data.item;
- let obj = this.data.obj;
- let qid = "";
- if (obj.isOnline) {
- qid = item.suitangUpper;
- } else {
- qid = item.suitangLower;
- }
- if (!qid) {
- toast("没有配置问卷")
- return;
- }
- if (!item.questionDone) {
- if (item.courseStatus == courseStatus.NO_START) {
- toast("课程还未开始")
- return;
- }
- if (item.courseType == courseTypes.RECORD && item.courseProcess == courseProcess.NO_BEGIGN) {
- toast("学完视频后才可以答卷")
- return;
- }
- Route.toQuestionDetail(qid, obj.teamId, item.courseId, item.id, obj.eduStuId, {
- answer: () => {
- this.triggerEvent("refresh")
- }
- });
- } else {
- // toast("已完成问卷")
- Route.toQuestionResult(qid, obj.eduStuId, item.courseId);
- }
- },
- exam(e) {
- let item = this.data.item;
- let obj = this.data.obj;
- if (!item.examDone) {
- if (item.courseStatus == courseStatus.NO_START) {
- toast("课程还未开始")
- return;
- }
- if (item.courseType == courseTypes.RECORD && item.courseProcess == courseProcess.NO_BEGIGN) {
- toast("学完视频后才可以答卷")
- return;
- }
- Route.toExamDetail(item.paperId, item.examId, obj.eduStuId, {
- answer: () => {
- this.triggerEvent("refresh")
- }
- })
- } else {
- // toast("已完成试卷")
- // 已完成试卷 跳转到问卷详情页
- Route.toExamResult(item.examId, obj.eduStuId);
- }
- },
- live(e) {
- // let item = this.data.item;
- // if (item.liveStatus == liveStatus.LIVING) {
- // Route.toLive(liveSources.DEFAULT, this.data.item.courseName || this.data.item.ceremonyName,
- // this.data.item.id, this.data.obj.eduStuId, this.data.obj.eduStuName,this.data.item.courseThumbnailUrl);
- // } else {
- // this.triggerEvent("refresh")
- // }
- this.triggerEvent('toLive');
- }
- }
- });
|