imageText.vue 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. <template>
  2. <div class="imageText warp" :class="['terminal'+terminal,'pos-' + componentContent.positionValue]">
  3. <div class="img img-left">
  4. <a class="item a-link" @click="jumpLink(componentContent.linkObj)"><img :src="componentContent.imageUrl" alt=""></a>
  5. </div>
  6. <div class="text">
  7. <h3 class="h3">{{componentContent.title}}</h3>
  8. <div v-html="componentContent.content"></div>
  9. </div>
  10. <div class="img img-right">
  11. <a class="item a-link" @click="jumpLink(componentContent.linkObj)"><img :src="componentContent.imageUrl" alt=""></a>
  12. </div>
  13. </div>
  14. </template>
  15. <script>
  16. import {funMixin} from '../config/mixin'
  17. export default {
  18. name: 'imageTextComponent',
  19. mixins: [funMixin],
  20. data () {
  21. return {
  22. }
  23. },
  24. props: {
  25. terminal: {
  26. type: Number,
  27. default: 4
  28. },
  29. componentContent: {
  30. type: Object
  31. }
  32. }
  33. }
  34. </script>
  35. <style lang="scss" scoped>
  36. .imageText{
  37. width: 710upx;
  38. margin: 0 auto;
  39. display: flex;
  40. justify-content: space-between;
  41. align-items: center;
  42. padding: 20upx 0;
  43. .img{
  44. width: 50%;
  45. padding-bottom: 30%;
  46. background-color: #cacaca;
  47. position: relative;
  48. img{
  49. max-width: 100%;
  50. height: 100%;
  51. max-height: 100%;
  52. position: absolute;
  53. margin: auto;
  54. top: 0;
  55. right: 0;
  56. bottom: 0;
  57. left: 0;
  58. }
  59. }
  60. .text{
  61. width: 40%;
  62. .h3{
  63. font-size: 30upx;
  64. margin-bottom: 24upx;
  65. }
  66. .p{
  67. font-size: 16upx;
  68. }
  69. }
  70. &.pos-top{
  71. display: block;
  72. text-align: center;
  73. .img{
  74. width: 100%;
  75. }
  76. .text{
  77. width: 100%;
  78. margin-top: 30upx;
  79. }
  80. .img-right{
  81. display: none;
  82. }
  83. }
  84. &.pos-bottom{
  85. display: block;
  86. text-align: center;
  87. .img{
  88. width: 100%;
  89. }
  90. .text{
  91. width: 100%;
  92. margin-bottom: 30upx;
  93. }
  94. .img-left{
  95. display: none;
  96. }
  97. }
  98. &.pos-left{
  99. .img-right{
  100. display: none;
  101. }
  102. }
  103. &.pos-right{
  104. .text{
  105. padding-left: 20upx;
  106. }
  107. .img-left{
  108. display: none;
  109. }
  110. }
  111. }
  112. .terminal1,.terminal2,.terminal3{
  113. width: 710upx;
  114. margin: 0 auto;
  115. }
  116. </style>