imgCardLv3.vue 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  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. justify-content: center;
  63. img {
  64. width: 480px;
  65. height: 370px;
  66. }
  67. }
  68. .img-left {
  69. img {
  70. margin-left: 100px;
  71. }
  72. }
  73. .img-right {
  74. img {
  75. margin-right: 100px;
  76. }
  77. }
  78. .card-info {
  79. width: 490px;
  80. h5 {
  81. font-size: 24px;
  82. font-weight: 800;
  83. text-align: left;
  84. color: #333;
  85. margin: 0 0 36px;
  86. }
  87. p {
  88. font-size: 14px;
  89. color: #333;
  90. line-height: 24px;
  91. text-align: justify;
  92. }
  93. }
  94. @media (max-width: 768px) {
  95. margin: 0 auto 60px;
  96. .mta-card-content-h5 {
  97. img {
  98. width: 80%;
  99. display: block;
  100. margin: 0 auto;
  101. text-align: center;
  102. }
  103. // card--info
  104. .card-info {
  105. width: 100%;
  106. h5 {font-size: 16px;margin: 20px 0 10px;}
  107. em{width: 35px;height: 3px;background: #00b96b;display: block;margin-bottom: 20px;}
  108. .card-des{
  109. font-size: 14px;margin: 20px 0 10px;text-align: justify;line-height: 22px;
  110. }
  111. }
  112. }
  113. }
  114. }
  115. </style>