Suggestions.vue 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. <template>
  2. <div v-if="props.item" class="advise-item logic-suggestions-item">
  3. <div class="advise-name">
  4. <div v-html="props.item.mainTitle"></div>
  5. <!-- <span>{{ props.item.title }}</span> -->
  6. </div>
  7. <div class="tips__subtitle">{{ props.item.subheading }}</div>
  8. <div class="tips__list">
  9. <div class="tip" v-for="(child, idx) in props.item.content" :key="idx">
  10. <div class="tip__title">
  11. <span class="underline">{{ child.contentTitle }}</span>
  12. </div>
  13. <div class="tip__item" v-for="(desc, idx2) in child.contentTexts" :key="idx2">{{ desc }}</div>
  14. </div>
  15. </div>
  16. </div>
  17. </template>
  18. <script lang="ts" setup>
  19. import { defineProps, PropType } from 'vue'
  20. interface itemInterface {
  21. tplType: string
  22. mainTitle: string
  23. subheading: string
  24. content: ContentItem[]
  25. }
  26. interface ContentItem {
  27. contentTitle: string
  28. contentTexts: string[]
  29. }
  30. const props = defineProps({
  31. item: {
  32. type: Object as PropType<itemInterface>
  33. }
  34. })
  35. </script>
  36. <style lang="scss" scoped>
  37. .logic-suggestions-item {
  38. position: relative;
  39. overflow: hidden;
  40. background: #fff;
  41. padding: 10px;
  42. padding-top: 0;
  43. margin-bottom: 10px;
  44. border-radius: 10px;
  45. font-size: 15px;
  46. .tip__title {
  47. font-size: 17px;
  48. font-weight: bold;
  49. color: #F3B345;
  50. line-height: 1;
  51. text-align: center;
  52. .underline {
  53. background: linear-gradient(to bottom, transparent 65%, #f9ca7880 65% 90%, transparent 90%);
  54. }
  55. }
  56. .tips__title {
  57. display: inline-block;
  58. width: calc(100% - 125px);
  59. }
  60. .tips__subtitle {
  61. margin: 0 auto;
  62. color: #F1B546;
  63. font-size: 13px;
  64. line-height: 30px;
  65. text-align: center;
  66. background: linear-gradient(to right,transparent 10%, rgba(255, 239, 208, 0.549), transparent 90%);
  67. }
  68. .tips__title--large {
  69. font-size: 24px;
  70. display: inline-block;
  71. width: calc(100% - 125px);
  72. background: linear-gradient(to bottom, transparent 80%, rgba(253, 193, 165, 0.77) 80% 100%);
  73. }
  74. .tips__list {
  75. // margin-top: 80px;
  76. padding-bottom: 20px;
  77. }
  78. .tip__item {
  79. margin: 10px 15px;
  80. font-size: 12px;
  81. font-weight: 400;
  82. color: #4D4D4D;
  83. line-height: 23px;
  84. }
  85. .underline {
  86. background: linear-gradient(to bottom, transparent 65%, #ffedd1c3 65% 90%, transparent 90%);
  87. }
  88. }
  89. </style>