app-poster-image.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  1. <template>
  2. <view class="app-poster-image">
  3. <view class="goods-one dir-left-wrap" v-if="form.typesetting==1">
  4. <block v-for="(item,key) in info.multi_map" :key="key">
  5. <image mode="aspectFill" v-if="key <= 0" :src="item"></image>
  6. </block>
  7. </view>
  8. <view class="goods-two dir-left-wrap" v-else-if="form.typesetting==2">
  9. <block v-for="(item,key) in info.multi_map" :key="key">
  10. <image mode="aspectFill" v-if="key <= 1" :src="item"></image>
  11. </block>
  12. </view>
  13. <view class="goods-three dir-left-wrap" v-else-if="form.typesetting==3">
  14. <block v-for="(item,key) in info.multi_map" :key="key">
  15. <image mode="aspectFill" v-if="key <= 2" :src="item"></image>
  16. </block>
  17. </view>
  18. <view class="goods-four dir-left-wrap" v-else-if="form.typesetting==4">
  19. <block v-for="(item,key) in info.multi_map" :key="key">
  20. <image mode="aspectFill" v-if="key <= 3" :src="item"></image>
  21. </block>
  22. </view>
  23. <view class="goods-five dir-left-wrap" v-else-if="form.typesetting==5">
  24. <block v-for="(item,key) in info.multi_map" :key="key">
  25. <image mode="aspectFill" v-if="key <= 4" :src="item"></image>
  26. </block>
  27. </view>
  28. <view v-if="info.extra_multiMap" v-for="(item,key) in info.extra_multiMap" :key="key">
  29. <view v-if="item.file_type === 'image'" class="plugin-image-class" :style="[pluginIconStyle(item)]">
  30. <image :src="item.image_url"></image>
  31. </view>
  32. <view v-else-if="item.file_type === 'text'" class="plugin-text-class" :style="[pluginTextStyle(item)]">
  33. <text>{{item.text}}</text>
  34. </view>
  35. </view>
  36. </view>
  37. </template>
  38. <script>
  39. export default {
  40. name: "app-poster-image",
  41. props: {
  42. info: Object,
  43. form: Object
  44. },
  45. computed: {
  46. pluginTextStyle() {
  47. return (data) => {
  48. let style = {};
  49. if (data.bottom !== undefined && this.form.style != 2) {
  50. style = {bottom: parseFloat(data.bottom) - 43 + 'rpx'}
  51. }
  52. return Object.assign({}, data, style);
  53. }
  54. },
  55. pluginIconStyle() {
  56. return (data) => {
  57. let style = {};
  58. if (data.bottom !== undefined && this.form.style != 2) {
  59. style = {bottom: parseFloat(data.bottom) - 40 + 'rpx'};
  60. }
  61. return Object.assign({}, data, style)
  62. }
  63. },
  64. },
  65. }
  66. </script>
  67. <style scoped lang="scss">
  68. .app-poster-image {
  69. height: 100%;
  70. width: 100%;
  71. position: relative;
  72. overflow: hidden;
  73. .plugin-text-class {
  74. position: absolute;
  75. z-index: 11;
  76. }
  77. .plugin-image-class {
  78. position: absolute;
  79. z-index: 10;
  80. image {
  81. height: 100%;
  82. width: 100%;
  83. }
  84. }
  85. image {
  86. display: block;
  87. }
  88. .goods-one {
  89. height: 100%;
  90. width: 100%;
  91. image {
  92. height: 100%;
  93. width: 100%;
  94. }
  95. }
  96. .goods-two {
  97. height: 100%;
  98. width: 100%;
  99. image:nth-child(1) {
  100. height: 50%;
  101. width: 100%;
  102. }
  103. image:nth-child(2) {
  104. height: 50%;
  105. width: 100%;
  106. }
  107. }
  108. .goods-three {
  109. height: 100%;
  110. width: 100%;
  111. image:nth-child(1) {
  112. height: 50%;
  113. width: 100%;
  114. }
  115. image:nth-child(2) {
  116. height: 50%;
  117. width: 50%;
  118. }
  119. image:nth-child(3) {
  120. height: 50%;
  121. width: 50%;
  122. }
  123. }
  124. .goods-four {
  125. height: 100%;
  126. width: 100%;
  127. image:nth-child(1) {
  128. height: 50%;
  129. width: 50%;
  130. }
  131. image:nth-child(2) {
  132. height: 50%;
  133. width: 50%;
  134. }
  135. image:nth-child(3) {
  136. height: 50%;
  137. width: 50%;
  138. }
  139. image:nth-child(4) {
  140. height: 50%;
  141. width: 50%;
  142. }
  143. }
  144. .goods-five {
  145. height: 100%;
  146. width: 100%;
  147. position: relative;
  148. image:nth-child(1) {
  149. position: absolute;
  150. top: 0;
  151. left: 0;
  152. height: 50%;
  153. width: 50%;
  154. }
  155. image:nth-child(2) {
  156. position: absolute;
  157. top: 50%;
  158. left: 0;
  159. height: 50%;
  160. width: 50%;
  161. }
  162. image:nth-child(3) {
  163. position: absolute;
  164. top: 0;
  165. left: 50%;
  166. height: 33.333%;
  167. width: 50%;
  168. }
  169. image:nth-child(4) {
  170. position: absolute;
  171. top: 33.33%;
  172. left: 50%;
  173. height: 33.333%;
  174. width: 50%;
  175. }
  176. image:nth-child(5) {
  177. position: absolute;
  178. top: 66.66%;
  179. left: 50%;
  180. height: 33.333%;
  181. width: 50%;
  182. }
  183. }
  184. }
  185. </style>