IntroductionCard.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  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. overflow: hidden;
  53. .head-list {
  54. display: flex;
  55. .head-item {
  56. width: 92px;
  57. height: 32px;
  58. text-align: center;
  59. font-size: 14px;
  60. line-height: 32px;
  61. color: #171826;
  62. border-radius: 12px 12px 0 0;
  63. background: linear-gradient(to right, #F5F5FB, #FFFFFF);
  64. &-0 {
  65. width: 175px;
  66. }
  67. &-2 {
  68. background: linear-gradient(to right, #FAE7CA, #F1D090);
  69. }
  70. }
  71. }
  72. .body-list {
  73. background: #FFFFFF;
  74. .body-item {
  75. display: flex;
  76. border-top: 0.5px solid rgba(0, 0, 0, 0.05);
  77. &:nth-child(odd) {
  78. background: #fff;
  79. }
  80. &:nth-child(even) {
  81. background: rgba(252, 252, 254, 1);
  82. }
  83. .product-name {
  84. padding: 12px 8px;
  85. width: 175px;
  86. text-align: center;
  87. border-right: 0.5px solid rgba(0, 0, 0, 0.05);
  88. .title {
  89. font-size: 14px;
  90. line-height: 20px;
  91. color: #171826;
  92. }
  93. .label {
  94. margin-top: 4px;
  95. font-size: 12px;
  96. line-height: 18px;
  97. color: #9B9CA3;
  98. }
  99. }
  100. .product-free, .product-vip {
  101. display: flex;
  102. justify-content: center;
  103. align-items: center;
  104. padding: 0 8px;
  105. width: 92px;
  106. text-align: center;
  107. .free-class {
  108. &.wrong {
  109. width: 100%;
  110. height: 100%;
  111. &::before {
  112. display: block;
  113. width: 100%;
  114. height: 100%;
  115. content: '';
  116. background: url(../../../../assets/image/icon/icon-gray-close.png) no-repeat center;
  117. background-size: 20px 20px;
  118. }
  119. }
  120. &.right {
  121. width: 100%;
  122. height: 100%;
  123. &::before {
  124. display: block;
  125. width: 100%;
  126. height: 100%;
  127. content: '';
  128. background: url(../../../../assets/image/icon/icon-gold-right.png) no-repeat center;
  129. background-size: 24px 24px;
  130. }
  131. }
  132. }
  133. .vip-class {
  134. &.right {
  135. width: 100%;
  136. height: 100%;
  137. &::before {
  138. display: block;
  139. width: 100%;
  140. height: 100%;
  141. content: '';
  142. background: url(../../../../assets/image/icon/icon-gold-right.png) no-repeat center;
  143. background-size: 24px 24px;
  144. }
  145. }
  146. }
  147. }
  148. .product-free {
  149. color: #9B9CA3;
  150. border-right: 0.5px solid rgba(0, 0, 0, 0.05);
  151. }
  152. .product-vip {
  153. color: #BD7B2E;
  154. }
  155. }
  156. }
  157. }
  158. </style>