imgCardLv3.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. <template>
  2. <div class="mta-card-lv3">
  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. <p>{{des}}</p>
  8. <slot></slot>
  9. </div>
  10. </div>
  11. <div class="mta-card-content-h5 mta-hidden-sm">
  12. <img :src="img.url">
  13. <div class="card-info">
  14. <h5>{{ title }}</h5>
  15. <em></em>
  16. <p>{{des}}</p>
  17. <slot></slot>
  18. </div>
  19. </div>
  20. </div>
  21. </template>
  22. <script>
  23. export default {
  24. name: "imgCardLv3",
  25. props: {
  26. option: {
  27. type: Object,
  28. required: true,
  29. },
  30. },
  31. data() {
  32. return {}
  33. },
  34. computed: {
  35. img() {
  36. return {url: this.option.img.url, order: this.option.img.order}
  37. },
  38. title() {
  39. return this.option.content.title;
  40. },
  41. des() {
  42. return this.option.content.des;
  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-lv3 {
  58. margin: 0 auto 120px;
  59. .mta-card-content-pc {
  60. display: flex;
  61. align-items: center;
  62. img {
  63. width: 480px;
  64. height: 370px;
  65. }
  66. }
  67. .img-left {
  68. img {
  69. margin-left: 100px;
  70. }
  71. }
  72. .img-right {
  73. img {
  74. margin-right: 100px;
  75. }
  76. }
  77. .card-info {
  78. width: 490px;
  79. h5 {
  80. font-size: 24px;
  81. font-weight: 800;
  82. text-align: left;
  83. color: #333;
  84. margin: 0 0 36px;
  85. }
  86. p {
  87. font-size: 14px;
  88. color: #333;
  89. line-height: 24px;
  90. text-align: justify;
  91. }
  92. }
  93. @media (max-width: 768px) {
  94. .mta-card-content-h5 {
  95. img {
  96. max-width: 100%;
  97. }
  98. // card--info
  99. .card-info {
  100. width: 100%;
  101. h5 {font-size: 16px;margin: 20px 0 10px;}
  102. em{width: 35px;height: 3px;background: #00b96b;display: block;margin-bottom: 20px;}
  103. .card-des{
  104. font-size: 14px;margin: 20px 0 10px;text-align: justify;line-height: 22px;
  105. }
  106. }
  107. }
  108. }
  109. }
  110. </style>