app-image-ad.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. <template>
  2. <view class="app-image-ad">
  3. <view class="app-one-image" v-if="imageStyle === 0">
  4. <app-jump-button form
  5. :open_type="item.link.open_type"
  6. :url="item.link.value"
  7. :params="item.link.params"
  8. v-for="(item, index) in list"
  9. :key="index"
  10. >
  11. <image :style="{
  12. left: item.left,
  13. width: item.width,
  14. top: item.top,
  15. }"
  16. :src="item.pic_url" mode="widthFix"
  17. ></image>
  18. </app-jump-button>
  19. </view>
  20. <view class="app-three-hundred-and-sixty" v-if="imageStyle === 1 || imageStyle === 2 || imageStyle === 3">
  21. <view class="app-item" :style="{
  22. backgroundImage: 'url(' + item.pic_url + ')',
  23. height: item.height,
  24. left: item.left,
  25. width: item.width,
  26. top: item.top,
  27. }"
  28. v-for="(item, index) in list" :key="index"
  29. >
  30. <app-jump-button form :open_type="item.link.open_type" :url="item.link.value" :params="item.link.params"></app-jump-button>
  31. </view>
  32. </view>
  33. <view class="app-two-hundred-and-forty" v-if="imageStyle === 5 || imageStyle === 4">
  34. <view class="app-item" :style="[{
  35. backgroundImage: 'url(' + item.pic_url + ')',
  36. height: item.height,
  37. left: item.left,
  38. width: item.width,
  39. top: item.top,
  40. }, ]"
  41. v-for="(item, index) in list" :key="index"
  42. >
  43. <app-jump-button form :open_type="item.link.open_type" :url="item.link.value" :params="item.link.params"></app-jump-button>
  44. </view>
  45. </view>
  46. <view class="app-one-hundred-eighty-six" v-if="imageStyle === 6">
  47. <view class="app-item" :style="{
  48. backgroundImage: 'url(' + item.pic_url + ')',
  49. height: item.height,
  50. left: item.left,
  51. width: item.width,
  52. zIndex: item.zIndex,
  53. top: item.top,
  54. }"
  55. v-for="(item, index) in list" :key="index"
  56. >
  57. <app-jump-button form :open_type="item.link.open_type" :url="item.link.value" :params="item.link.params"></app-jump-button>
  58. </view>
  59. </view>
  60. <view class="app-three-hundred-seventy-two" v-if="imageStyle === 7">
  61. <view class="app-item" :style="{
  62. backgroundImage: 'url(' + item.pic_url + ')',
  63. height: item.height,
  64. left: item.left,
  65. width: item.width,
  66. top: item.top,
  67. }"
  68. v-for="(item, index) in list" :key="index"
  69. >
  70. <app-jump-button form :open_type="item.link.open_type" :url="item.link.value" :params="item.link.params"></app-jump-button>
  71. </view>
  72. </view>
  73. <view class="app-customize" v-if="imageStyle === 8" :style="{height: `${height}rpx`}">
  74. <view class="app-item" :style="{
  75. backgroundImage: 'url(' + item.pic_url + ')',
  76. height: item.height,
  77. left: item.left,
  78. width: item.width,
  79. top: item.top,
  80. }"
  81. v-for="(item, index) in list" :key="index"
  82. >
  83. <app-jump-button form :open_type="item.link.open_type" :url="item.link.value" :params="item.link.params"></app-jump-button>
  84. </view>
  85. </view>
  86. </view>
  87. </template>
  88. <script>
  89. export default {
  90. name: 'app-image-ad',
  91. props: {
  92. h: {
  93. type: Number,
  94. default: function() {
  95. return 1;
  96. }
  97. },
  98. height: {
  99. default: function() {
  100. return 'auto';
  101. }
  102. },
  103. hotspot: {
  104. type: Array,
  105. default: function() {
  106. return [];
  107. }
  108. },
  109. list: {
  110. type: Array,
  111. default: function() {
  112. return [];
  113. }
  114. },
  115. space: {
  116. type: Number,
  117. default: function() {
  118. return 0;
  119. }
  120. },
  121. imageStyle: {
  122. type: Number,
  123. default: function() {
  124. return 2;
  125. }
  126. },
  127. w: {
  128. type: Number,
  129. default: function() {
  130. return 25;
  131. }
  132. }
  133. }
  134. }
  135. </script>
  136. <style scoped lang="scss">
  137. .app-image-ad {
  138. width: #{750rpx};;
  139. background-color: #ffffff;
  140. .app-item {
  141. position: absolute;
  142. background-repeat: no-repeat;
  143. background-position: center;
  144. background-size: 100% 100%;
  145. }
  146. .app-one-image {
  147. width: #{750rpx};
  148. position: relative;
  149. .ren-qu {
  150. width: 100%;
  151. height: 100%;
  152. background-color: red;
  153. }
  154. }
  155. .app-three-hundred-and-sixty {
  156. width: #{750rpx};;
  157. height: #{360rpx};
  158. position: relative;
  159. }
  160. .app-two-hundred-and-forty {
  161. width: #{750rpx};;
  162. height: #{240rpx};
  163. position: relative;
  164. }
  165. .app-one-hundred-eighty-six {
  166. width: #{750rpx};
  167. position: relative;
  168. height: #{187.5rpx};
  169. }
  170. .app-three-hundred-seventy-two {
  171. width: #{750rpx};
  172. height: #{372rpx};
  173. position: relative;
  174. }
  175. .app-customize {
  176. width: #{750rpx};;
  177. position:relative;
  178. }
  179. }
  180. </style>