app-image-ad.vue 5.1 KB

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