ProgramCard.vue 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <template>
  2. <div class="w-full sm:w-[90%] lg:w-[75%] p-4 border border-border rounded-lg">
  3. <div class="flex items-center justify-between">
  4. <div class="flex items-center gap-2">
  5. <NuxtImg src="/img/green_coffee.svg" />
  6. <h6 class="font-medium text-text text-xs md:text-sm">{{ program.title }}</h6>
  7. </div>
  8. <div v-if="program.isPopular" class="bg-primary rounded-lg px-3 py-1 flex justify-center">
  9. <span class="text-[10px] md:text-xs text-white-2">Mais popular</span>
  10. </div>
  11. </div>
  12. <p class="my-8 text-xs md:text-sm text-text-2">{{ program.description }}</p>
  13. <div class="flex flex-col items-center text-2xl md:text-[34px] m-4">
  14. <template v-if="program.price === 0">
  15. <h2 class="text-text line-through">R$ {{ program.originalPrice.toFixed(2).replace('.', ',') }}</h2>
  16. <h2 class="text-primary font-bold">GRATUITO</h2>
  17. </template>
  18. <template v-else>
  19. <h2 class="text-primary font-bold">R$ {{ program.price.toFixed(2) }}</h2>
  20. </template>
  21. </div>
  22. <ul class="flex flex-col gap-4">
  23. <li v-for="(feature, index) in program.features" :key="index" class="flex gap-1 items-center">
  24. <UIcon name="i-mdi-check-circle-outline" class="text-primary" size="18px" />
  25. <span class="text-text-2 text-xs md:text-sm">{{ feature }}</span>
  26. </li>
  27. </ul>
  28. <div
  29. class="bg-primary hover:bg-primary/85 transition duration-300 w-full h-10 mt-5 rounded-lg cursor-pointer flex items-center justify-center"
  30. @click="goToRegisterPage"
  31. >
  32. <span class="text-white text-xs md:text-sm font-medium">
  33. Inscrever-se Agora
  34. </span>
  35. </div>
  36. </div>
  37. </template>
  38. <script setup lang="ts">
  39. const {program} = defineProps({
  40. program: {
  41. type: Object,
  42. required: true,
  43. }
  44. });
  45. const config = useRuntimeConfig();
  46. const quasarAppUrl = config.public.studentPlatform + '/register';
  47. // const quasarAppUrl = config.public.studentPlatform + '/register/' + program.id;
  48. const goToRegisterPage = () => {
  49. window.open(quasarAppUrl, '_blank');
  50. };
  51. </script>