class-item.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <script lang="ts" setup>
  2. import { PropType } from 'vue'
  3. import { frame, peoples, polygon16 } from '../../../core/libs/svgs'
  4. import { Content } from '../../../core/libs/models'
  5. import dayjs from 'dayjs'
  6. import { useRouter } from '../../../core/utils/router'
  7. defineProps({
  8. customClass: {
  9. type: String,
  10. default: () => '',
  11. },
  12. title: {
  13. type: String,
  14. default: () => '',
  15. },
  16. options: {
  17. type: Object as PropType<Content>,
  18. default: () => ({}),
  19. },
  20. })
  21. const router = useRouter()
  22. </script>
  23. <template>
  24. <view
  25. class="relative h-43 flex items-end"
  26. :class="[customClass]"
  27. @click="router.push(`/pages/home/classmates-detail/index?id=${options.id}`)"
  28. >
  29. <view class="absolute left-0 bottom-0 rounded-2xl overflow-hidden">
  30. <wd-img
  31. custom-class="vertical-bottom"
  32. width="136"
  33. height="172"
  34. mode="scaleToFill"
  35. :src="options.bannerUrl"
  36. />
  37. <div
  38. class="absolute left-2.5 bottom-2.5 px-2 py-1 bg-black/30 rounded-[20px] backdrop-blur-[10px]"
  39. >
  40. <div class="text-white text-[10px] font-normal font-['PingFang_SC'] leading-relaxed">
  41. <!-- 米兰2班 -->
  42. {{ options.classGrade }}
  43. </div>
  44. </div>
  45. </view>
  46. <div
  47. class="w-full h-[145px] pl-39 pt-6 pr-6 pb-6 flex flex-col box-border bg-white rounded-2xl shadow"
  48. >
  49. <div class="text-black/90 text-base font-normal font-['PingFang_SC'] leading-normal">
  50. <!-- 2024届米兰国际家具展 -->
  51. {{ options.title }}
  52. </div>
  53. <view
  54. class="flex items-center justify-between text-black/60 text-sm font-normal font-['PingFang_SC'] leading-[34px]"
  55. >
  56. <wd-img width="18" height="18" :src="frame"></wd-img>
  57. <div class="">{{ dayjs(options.studyStartDate).format('MM-DD') }}</div>
  58. <wd-img custom-class="mx-1" width="5" height="5" :src="polygon16" />
  59. <div>{{ dayjs(options.studyEndDate).format('MM-DD') }}</div>
  60. <view class="flex-1"></view>
  61. <wd-img :src="peoples" width="16" height="16"></wd-img>
  62. <div class="ml-1">{{ options.studyPersonCount }}</div>
  63. </view>
  64. <view class="flex-1"></view>
  65. <view
  66. class="flex justify-between text-black/40 text-sm font-normal font-['PingFang_SC'] leading-[34px]"
  67. >
  68. <div class="">班长:{{ options.studyMonitor }}</div>
  69. <div class="">领队:{{ options.studyLeader }}</div>
  70. </view>
  71. </div>
  72. </view>
  73. </template>