case-card.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. <!--
  2. * @Description: 解决方案-典型案例卡片组件
  3. -->
  4. <template>
  5. <div class="case-card">
  6. <div class="case-img-wrapper">
  7. <img :src="caseItem.caseCover" class="case-img" :alt="caseItem.caseName" />
  8. </div>
  9. <div class="case-content">
  10. <div class="case-header">
  11. <h3 class="case-name pf-sc-semibold">{{ caseItem.caseName }}</h3>
  12. <div v-if="showNav" class="case-nav-btns">
  13. <!-- PC Prev -->
  14. <i
  15. class="i-custom-arrow-circle-left wh-32px transition-colors lt-sm:hidden"
  16. :class="
  17. isFirst
  18. ? 'cursor-not-allowed opacity-50'
  19. : 'cursor-pointer hover:i-custom-arrow-circle-left-active'
  20. "
  21. @click="$emit('prev')"
  22. ></i>
  23. <!-- Mobile Prev -->
  24. <i
  25. class="i-custom-button-previous-mobile wh-32px transition-all shrink-0 hidden lt-sm:block"
  26. :class="[
  27. isFirst
  28. ? 'cursor-not-allowed i-custom-button-previous-mobile-disabled'
  29. : 'cursor-pointer active:i-custom-button-previous-mobile-active',
  30. ]"
  31. @click="$emit('prev')"
  32. ></i>
  33. <!-- PC Next -->
  34. <i
  35. class="i-custom-arrow-circle-right wh-32px ml-12px transition-colors lt-sm:hidden"
  36. :class="
  37. isLast
  38. ? 'cursor-not-allowed opacity-50'
  39. : 'cursor-pointer hover:i-custom-arrow-circle-right-active'
  40. "
  41. @click="$emit('next')"
  42. ></i>
  43. <!-- Mobile Next -->
  44. <i
  45. class="i-custom-button-next-mobile wh-32px ml-12px transition-all shrink-0 hidden lt-sm:block"
  46. :class="[
  47. isLast
  48. ? 'cursor-not-allowed i-custom-button-next-mobile-disabled'
  49. : 'cursor-pointer active:i-custom-button-next-mobile-active',
  50. ]"
  51. @click="$emit('next')"
  52. ></i>
  53. </div>
  54. </div>
  55. <div class="case-section">
  56. <h4 class="case-subtitle pf-sc-semibold">客户痛点</h4>
  57. <div class="case-text pf-sc-regular">{{ caseItem.casePainPoint }}</div>
  58. </div>
  59. <div
  60. class="case-section mt-24px bg-#F6F8FD p-16px rounded-8px lt-sm:mt-24px lt-sm:p-24px lt-sm:rounded-8px"
  61. >
  62. <h4 class="case-subtitle pf-sc-semibold">落地效果</h4>
  63. <div class="case-text pf-sc-regular">
  64. <div v-for="(effect, eIndex) in caseItem.caseEffect" :key="eIndex">
  65. {{ effect }}
  66. </div>
  67. </div>
  68. </div>
  69. </div>
  70. </div>
  71. </template>
  72. <script setup lang="ts">
  73. export interface CaseItem {
  74. caseName: string
  75. caseCover: string
  76. casePainPoint: string
  77. caseEffect: string[]
  78. }
  79. defineProps<{
  80. caseItem: CaseItem
  81. showNav?: boolean
  82. isFirst?: boolean
  83. isLast?: boolean
  84. }>()
  85. defineEmits<{
  86. (e: 'prev'): void
  87. (e: 'next'): void
  88. }>()
  89. </script>
  90. <style scoped lang="scss">
  91. .case-card {
  92. @apply bg-white rounded-16px p-24px flex gap-40px items-stretch shadow-sm;
  93. @apply lt-sm:flex-col lt-sm:p-32px lt-sm:gap-42px lt-sm:rounded-16px;
  94. }
  95. .case-img-wrapper {
  96. @apply w-542px h-342px rounded-8px overflow-hidden flex-shrink-0;
  97. @apply lt-sm:w-full lt-sm:h-320px lt-sm:rounded-12px;
  98. }
  99. .case-img {
  100. @apply w-full h-full object-fill;
  101. }
  102. .case-content {
  103. @apply flex-1 py-10px flex flex-col justify-center;
  104. }
  105. .case-header {
  106. @apply flex justify-between items-center mb-30px;
  107. @apply lt-sm:mb-24px;
  108. }
  109. .case-name {
  110. @apply font-s-22px text-#091221 lt-sm:font-s-32px;
  111. }
  112. .case-nav-btns {
  113. @apply flex items-center;
  114. }
  115. .case-subtitle {
  116. @apply font-s-18px text-#091221 mb-12px;
  117. @apply lt-sm:mb-12px lt-sm:font-s-28px;
  118. }
  119. .case-text {
  120. @apply font-s-14px text-#091221/70 lh-24px;
  121. @apply lt-sm:font-s-24px lt-sm:lh-normal;
  122. }
  123. </style>