index.tsx 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. import { ElImage } from 'element-plus'
  2. import { defineComponent } from 'vue'
  3. import iconTeacher from '@/common/images/icon_teacher.png'
  4. export default defineComponent({
  5. name: 'item',
  6. props: {
  7. item: {
  8. type: Object,
  9. default: () => ({})
  10. }
  11. },
  12. render() {
  13. const item = this.item
  14. return (
  15. <div
  16. class="border border-[#E0E0E0] box-border rounded-[10px] w-[218px] m-auto overflow-hidden relative transition-all cursor-pointer"
  17. onClick={() => {
  18. console.log(item)
  19. if (item.type === 'video') {
  20. if (item.shelvesFlag === 0) {
  21. this.$router.push({
  22. path: '/userInfo/videoOperation',
  23. query: {
  24. type: 'edit',
  25. groupId: item.id
  26. }
  27. })
  28. return
  29. } else {
  30. this.$router.push({
  31. path: '/videoDetail',
  32. query: {
  33. id: item.id
  34. }
  35. })
  36. }
  37. }
  38. if (
  39. item.type === 'live' &&
  40. (item.status === 'CANCEL' || item.status === 'OUT_SALE')
  41. ) {
  42. // 直播课
  43. this.$router.push({
  44. path: '/userInfo/liveOperation',
  45. query: {
  46. type: 'edit',
  47. groupId: item.courseGroupId
  48. }
  49. })
  50. }
  51. }}
  52. >
  53. {/* {item.subjectName && (
  54. <div class="absolute top-2 right-3 bg-black/40 text-white text-sm rounded-sm px-3 h-7 flex items-center justify-center z-10">
  55. {item.subjectName}
  56. </div>
  57. )} */}
  58. <div class="relative">
  59. <ElImage
  60. class="w-full h-[122px] align-middle"
  61. fit="cover"
  62. src={item.backgroundPic}
  63. />
  64. <div class="text-sm text-[#52FFDC] h-7 leading-7 px-3 flex items-center justify-end absolute left-0 right-0 bottom-0 bg-black/60">
  65. <i class="w-1 h-1 bg-[#52FFDC] rounded-full mr-1.5 inline-block"></i>
  66. {item.studentCount}人已购买
  67. </div>
  68. </div>
  69. <div class="text-base px-2.5 pt-2 text-[#666666] leading-none font-semibold whitespace-nowrap overflow-hidden text-ellipsis">
  70. {item.courseGroupName}
  71. </div>
  72. {item.courseStartTime && (
  73. <p class="text-[#999] text-xs px-2.5 leading-none pt-1.5">
  74. 开课时间:{item.courseStartTime}
  75. </p>
  76. )}
  77. <div class="mx-2.5 pt-1.5 pb-2 flex items-center justify-between">
  78. <div class="text-xl text-[#F90000] font-semibold leading-none">
  79. <span class="text-sm leading-7">¥</span>
  80. {item.coursePrice}
  81. </div>
  82. <div class="text-base text-[#FF5F22] leading-none">
  83. {item.courseNum}课时
  84. </div>
  85. </div>
  86. </div>
  87. )
  88. }
  89. })