offline-activity-item.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. <script setup lang="ts">
  2. import Card from '@/components/card.vue'
  3. import { frame, polygon16 } from '../../../core/libs/svgs'
  4. import { PropType } from 'vue'
  5. import { Content } from '../../../core/libs/models'
  6. import dayjs from 'dayjs'
  7. import { useRouter } from '../../../core/utils/router'
  8. defineProps({
  9. customClass: {
  10. type: String,
  11. default: () => '',
  12. },
  13. options: {
  14. type: Object as PropType<Content>,
  15. default: () => ({}),
  16. },
  17. })
  18. const router = useRouter()
  19. </script>
  20. <template>
  21. <div @click="router.push(`/pages-sub/home/classmates-detail/index?id=${options.id}`)">
  22. <card :custom-class="[customClass, 'p-0!']">
  23. <view class="relative aspect-[1.72/1]">
  24. <wd-img
  25. width="100%"
  26. height="100%"
  27. custom-class="vertical-bottom"
  28. class="w-[347px] h-[202px] rounded-tl-2xl rounded-tr-2xl"
  29. mode="aspectFill"
  30. :src="options.bannerUrl"
  31. />
  32. <!-- <template v-if="dayjs().isAfter(dayjs(options?.hostDate).add(1, 'd'))">-->
  33. <!-- <div-->
  34. <!-- class="absolute top-4 right-4 px-2.5 bg-black/30 rounded-[20px] backdrop-blur-[15px]"-->
  35. <!-- >-->
  36. <!-- <div class="text-white text-xs font-normal font-['PingFang_SC'] leading-relaxed">-->
  37. <!-- 已结束-->
  38. <!-- </div>-->
  39. <!-- </div>-->
  40. <!-- </template>-->
  41. <div
  42. class="absolute top-4 left-4 px-2.5 rounded-md border border-solid border-white justify-center items-center gap-2.5 inline-flex"
  43. >
  44. <div class="text-white text-xs font-normal font-['PingFang_SC'] leading-normal">
  45. 第{{ options.periodsCount }}期
  46. </div>
  47. </div>
  48. </view>
  49. <div class="p-5 bg-white rounded-bl-[20px] rounded-br-[20px] shadow">
  50. <div
  51. class="text-black text-base font-normal font-['PingFang_SC'] leading-normal text-ellipsis line-clamp-1 overflow-hidden"
  52. >
  53. {{ options.title }}
  54. </div>
  55. <view class="mt-1.5 flex items-center mb-4">
  56. <wd-img custom-class="vertical-bottom" :src="frame" width="20" height="20"></wd-img>
  57. <div
  58. class="flex items-center text-black/60 text-sm font-normal font-['PingFang_SC'] leading-[34px]"
  59. >
  60. <!-- <div class="">{{ dayjs(options.studyStartDate).format('MM-DD') }}</div>
  61. <wd-img custom-class="mx-1" width="5" height="5" :src="polygon16" />
  62. <div>{{ dayjs(options.studyEndDate).format('MM-DD') }}</div> -->
  63. {{ dayjs(options?.hostDate).format('YYYY-MM-DD') }}
  64. </div>
  65. </view>
  66. <view class="flex gap-4">
  67. <div
  68. class="inline-block px-2.5 rounded-md border border-solid border-black/30 backdrop-blur-[6px] flex justify-center items-center"
  69. >
  70. <div class="text-black/60 text-xs font-normal font-['PingFang_SC'] leading-normal">
  71. 举办方:{{ options.activityHost }}
  72. </div>
  73. </div>
  74. <div
  75. v-if="options.supportBrand"
  76. class="inline-block px-2.5 rounded-md border border-solid border-black/30 backdrop-blur-[6px] flex justify-center items-center"
  77. >
  78. <div class="text-black/60 text-xs font-normal font-['PingFang_SC'] leading-normal">
  79. 赞助品牌:{{ options.supportBrand }}
  80. </div>
  81. </div>
  82. </view>
  83. </div>
  84. </card>
  85. </div>
  86. </template>