123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112 |
- var convertCheck = function (status) {
- var statusText
- switch (status) {
- case 1:
- statusText = '已签到'
- break;
- case 2:
- statusText = '签到'
- break;
- case 3:
- statusText = '迟到'
- break;
- case 4:
- statusText = '请假'
- break;
- case 5:
- statusText = '旷课'
- break;
- default:
- statusText = '未知状态'
- }
- return statusText
- }
- var convertExam = function (status) {
- var statusText
- switch (status) {
- case 1:
- statusText = '已完成'
- break;
- default:
- statusText = '随堂考试'
- }
- return statusText
- }
- var convertQuestion = function (status) {
- var statusText;
- switch (status) {
- case 1:
- statusText = '已完成'
- break;
- default:
- statusText = '随堂问卷'
- }
- return statusText
- }
- var convertLive = function (status, isOp) {
- var statusText
- switch (status) {
- case 0:
- statusText = '未直播'
- break;
- case 1:
- if (isOp) {
- statusText = '观看直播'
- } else {
- statusText = '直播中'
- }
- break;
- case 2:
- statusText = '直播结束'
- break;
- default:
- statusText = '未知状态'
- }
- return statusText
- }
- var isShowCheck = function (item, isOnline) {
- if (item) { // courseType 1基地课 2面授课 3录播课
- return !isOnline && (item.courseType == 2 || !item.courseType);
- } else {
- return false
- }
- }
- var isShowExam = function (item) {
- if (item) {
- return item.isExam == 1
- } else {
- return false
- }
- }
- var isShowQuestion = function (item) {
- if (item) {
- return item.isEvaluate
- } else {
- return false
- }
- }
- var isShowLive = function (item, type) {
- if (type) {//11是直播
- return type == 11
- } else {
- return false
- }
- }
- module.exports = {
- convertCheck: convertCheck,
- convertExam: convertExam,
- convertQuestion: convertQuestion,
- isShowCheck: isShowCheck,
- isShowExam: isShowExam,
- isShowQuestion: isShowQuestion,
- isShowLive: isShowLive,
- convertLive: convertLive
- }
|