ClassTimeTip.vue 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <template>
  2. <p style="display: inline-block; color: red">
  3. <template v-if="info.gradeId">
  4. 【<span>{{
  5. info.classStatus == 0
  6. ? "暂未开班"
  7. : info.classEndTime
  8. ? `有效期至:${$tools.timestampToTime(
  9. info.classEndTime
  10. )},本班还剩${$tools.GetRTime(
  11. info.classEndTime
  12. )}天将结束学习,`
  13. : ""
  14. }}</span>
  15. 已报名人数{{ info.studentNumAll }}/{{ info.studentUpper }}人 】
  16. </template>
  17. </p>
  18. </template>
  19. <script>
  20. export default {
  21. props: {
  22. classInfo: {
  23. type: Object,
  24. default: () => {
  25. return {};
  26. },
  27. },
  28. gradeId: {
  29. type: Number,
  30. default: 0,
  31. },
  32. },
  33. data() {
  34. return {
  35. info: {},
  36. };
  37. },
  38. created() {
  39. if (this.gradeId) {
  40. this.$request.getGradeDetail(this.gradeId).then((res) => {
  41. this.info = res.data;
  42. });
  43. } else {
  44. this.info = JSON.parse(JSON.stringify(this.classInfo));
  45. }
  46. },
  47. };
  48. </script>
  49. <style>
  50. </style>