imgCardLv2.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. <template>
  2. <div class="mta-card-lv2">
  3. <div class="mta-card-content-pc mta-hidden-xs" :class="[img.order> contentOrder ? 'img-left': 'img-right']">
  4. <img :style="`order:${img.order}`" :src="img.url">
  5. <div class="card-info" :style="`order: ${contentOrder}`">
  6. <h5>{{ title }}</h5>
  7. <div class="mta-card-row" v-for="(rowItem,index) in tagesPc" :key="`pc-${index}`">
  8. <i></i><span>{{ rowItem.value }}</span>
  9. </div>
  10. <slot></slot>
  11. </div>
  12. </div>
  13. <div class="mta-card-content-h5 mta-hidden-sm">
  14. <img :src="img.url">
  15. <div class="card-info">
  16. <h5>{{ title }}</h5>
  17. <div class="mta-card-row" v-for="(rowItem,index) in tagesH5" :key="`H5-${index}`">
  18. <i></i><span>{{ rowItem.value }}</span>
  19. </div>
  20. <slot></slot>
  21. </div>
  22. </div>
  23. </div>
  24. </template>
  25. <script>
  26. export default {
  27. name: "imgCardLv2",
  28. props: {
  29. option: {
  30. type: Object,
  31. required: true,
  32. },
  33. },
  34. data() {
  35. return {}
  36. },
  37. computed: {
  38. img() {
  39. return {url: this.option.img.url, order: this.option.img.order}
  40. },
  41. title() {
  42. return this.option.content.title;
  43. },
  44. contentOrder() {
  45. return this.option.content.order;
  46. },
  47. tagesPc() {
  48. return this.option.content.list;
  49. },
  50. tagesH5() {
  51. return this.option.content.list;
  52. }
  53. }
  54. }
  55. </script>
  56. <style lang="scss" scoped>
  57. .mta-card-lv2 {
  58. margin: 0 auto 120px;
  59. .mta-card-content-pc {
  60. display: flex;
  61. img {
  62. width: 480px;
  63. height: 370px;
  64. }
  65. }
  66. .img-left {
  67. img {
  68. margin-left: 100px;
  69. }
  70. }
  71. .img-right {
  72. img {
  73. margin-right: 100px;
  74. }
  75. }
  76. .card-info {
  77. h5 {
  78. font-size: 24px;
  79. font-weight: 800;
  80. text-align: left;
  81. color: #333;
  82. margin-top: 40px;
  83. margin-bottom: 23px;
  84. }
  85. }
  86. .mta-card-row {
  87. margin-bottom: 23px;
  88. font-size: 14px;
  89. font-weight: 500;
  90. color: #333;
  91. text-align: left;
  92. &:last-child{
  93. margin-bottom: 0px;
  94. }
  95. i {
  96. display: inline-block;
  97. width:13px;
  98. height: 13px;
  99. background: #00b96b;
  100. margin-right: 13px;
  101. }
  102. }
  103. }
  104. </style>