IntroductionCard.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. <template>
  2. <div class="introduction-card">
  3. <div class="head-list">
  4. <div v-for="(item, index) in info.head" :key="index" class="head-item" :class="`head-item-${index}`">
  5. {{ item }}
  6. </div>
  7. </div>
  8. <div class="body-list">
  9. <div v-for="(item, index) in info.content" :key="index" class="body-item">
  10. <div class="product-name">
  11. <div class="title">
  12. {{ item.name }}
  13. <div v-if="item.isNew" class="isnew" />
  14. </div>
  15. <div class="label">
  16. {{ item.label }}
  17. </div>
  18. </div>
  19. <div class="product-free">
  20. <div v-if="item.freeClass" class="free-class" :class="item.freeClass" />
  21. <div v-if="item.freeText" class="free-text">
  22. {{ item.freeText }}
  23. </div>
  24. </div>
  25. <div class="product-vip">
  26. <div v-if="item.superClass" class="vip-class" :class="item.superClass" />
  27. <div v-if="item.superText" class="vip-text">
  28. {{ item.superText }}
  29. </div>
  30. </div>
  31. </div>
  32. </div>
  33. </div>
  34. </template>
  35. <script>
  36. import contrastFunctionJson from '@/assets/js/contrast_function.js'
  37. export default {
  38. name: 'IntroductionCard',
  39. data() {
  40. return {
  41. info: contrastFunctionJson || {
  42. head: [],
  43. content: []
  44. }
  45. }
  46. }
  47. }
  48. </script>
  49. <style lang="scss" scoped>
  50. .introduction-card {
  51. border-radius: 12px;
  52. .head-list {
  53. display: flex;
  54. .head-item {
  55. width: 92px;
  56. height: 32px;
  57. text-align: center;
  58. font-size: 14px;
  59. line-height: 32px;
  60. color: #171826;
  61. border-radius: 12px 12px 0 0;
  62. background: linear-gradient(to right, #F5F5FB, #FFFFFF);
  63. &-0 {
  64. width: 175px;
  65. }
  66. &-2 {
  67. background: linear-gradient(to right, #FAE7CA, #F1D090);
  68. }
  69. }
  70. }
  71. .body-list {
  72. background: #FFFFFF;
  73. .body-item {
  74. display: flex;
  75. border-top: 0.5px solid rgba(0, 0, 0, 0.05);
  76. &:nth-child(odd) {
  77. background: #fff;
  78. }
  79. &:nth-child(even) {
  80. background: rgba(252, 252, 254, 1);
  81. }
  82. .product-name {
  83. padding: 12px 8px;
  84. width: 175px;
  85. text-align: center;
  86. border-right: 0.5px solid rgba(0, 0, 0, 0.05);
  87. .title {
  88. font-size: 14px;
  89. line-height: 20px;
  90. color: #171826;
  91. }
  92. .label {
  93. margin-top: 4px;
  94. font-size: 12px;
  95. line-height: 18px;
  96. color: #9B9CA3;
  97. }
  98. }
  99. .product-free, .product-vip {
  100. display: flex;
  101. justify-content: center;
  102. align-items: center;
  103. padding: 0 8px;
  104. width: 92px;
  105. text-align: center;
  106. .free-class {
  107. &.wrong {
  108. width: 100%;
  109. height: 100%;
  110. &::before {
  111. display: block;
  112. width: 100%;
  113. height: 100%;
  114. content: '';
  115. background: url(../../../../assets/image/icon/icon-red-close.png) no-repeat center;
  116. background-size: 20px 20px;
  117. }
  118. }
  119. &.right {
  120. width: 100%;
  121. height: 100%;
  122. &::before {
  123. display: block;
  124. width: 100%;
  125. height: 100%;
  126. content: '';
  127. background: url(../../../../assets/image/icon/icon-check.png) no-repeat center;
  128. background-size: 24px 24px;
  129. }
  130. }
  131. }
  132. .vip-class {
  133. &.right {
  134. width: 100%;
  135. height: 100%;
  136. &::before {
  137. display: block;
  138. width: 100%;
  139. height: 100%;
  140. content: '';
  141. background: url(../../../../assets/image/icon/icon-check.png) no-repeat center;
  142. background-size: 24px 24px;
  143. }
  144. }
  145. }
  146. }
  147. .product-free {
  148. color: #9B9CA3;
  149. border-right: 0.5px solid rgba(0, 0, 0, 0.05);
  150. }
  151. .product-vip {
  152. color: #BD7B2E;
  153. }
  154. }
  155. }
  156. }
  157. </style>