小程序端工程代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

217 lines
5.7 KiB

  1. <template>
  2. <view class="adv-box mx20 mb10">
  3. <!-- 模板1-->
  4. <view class="x-f" v-if="detail.style == 1">
  5. <image style="width: 710rpx; height: 220rpx" @tap="jump(detail.list[0])" :src="detail.list[0].image" mode="aspectFill"></image>
  6. </view>
  7. <!-- 模板2-->
  8. <view class="type1 x-f" v-if="detail.style == 2">
  9. <image class="type1-img" @tap="jump(detail.list[0])" :src="detail.list[0].image" mode="aspectFill"> </image>
  10. <image class="type1-img" @tap="jump(detail.list[1])" :src="detail.list[1].image" mode="aspectFill"> </image>
  11. </view>
  12. <!-- 模板3-->
  13. <view class="type2 x-bc" v-if="detail.style == 3">
  14. <image class="type2-img1" @tap="jump(detail.list[0])" :src="detail.list[0].image" mode="aspectFill"> </image>
  15. <view class="y-f type2-box">
  16. <image class="type2-img2" @tap="jump(detail.list[1])" :src="detail.list[1].image" mode="aspectFill" style="border-bottom: 1rpx solid #f6f6f6"></image>
  17. <image class="type2-img2" @tap="jump(detail.list[2])" :src="detail.list[2].image" mode="aspectFill"></image>
  18. </view>
  19. </view>
  20. <!-- 模板4-->
  21. <view class="type3 x-bc" v-if="detail.style == 4">
  22. <view class="type3-box y-f">
  23. <image class="type3-img1" @tap="jump(detail.list[0])" :src="detail.list[0].image" mode="aspectFill"></image>
  24. <image class="type3-img1" @tap="jump(detail.list[1])" :src="detail.list[1].image" mode="aspectFill"></image>
  25. </view>
  26. <image class="type3-img2" @tap="jump(detail.list[2])" :src="detail.list[2].image" mode="aspectFill"> </image>
  27. </view>
  28. <!-- 模板5-->
  29. <view class="type4 y-f" v-if="detail.style == 5">
  30. <view class="type4-box x-f">
  31. <image class="type4-img1" @tap="jump(detail.list[0])" :src="detail.list[0].image" mode="aspectFill"></image>
  32. <image class="type4-img1" @tap="jump(detail.list[1])" :src="detail.list[1].image" mode="aspectFill"></image>
  33. </view>
  34. <image class="type4-img2" @tap="jump(detail.list[2])" :src="detail.list[2].image" mode="aspectFill"> </image>
  35. </view>
  36. <!-- 模板6-->
  37. <view class="type5 y-f" v-if="detail.style == 6">
  38. <image class="type5-img1" @tap="jump(detail.list[0])" :src="detail.list[0].image" mode="aspectFill"> </image>
  39. <view class="type5-box x-bc">
  40. <image class="type5-img2" @tap="jump(detail.list[1])" :src="detail.list[1].image" mode="aspectFill" style="border-bottom: 1rpx solid #f6f6f6"></image>
  41. <image class="type5-img2" @tap="jump(detail.list[2])" :src="detail.list[2].image" mode="aspectFill"></image>
  42. </view>
  43. </view>
  44. <!-- 模板7-->
  45. <view class="type6 y-f" v-if="detail.style == 7">
  46. <view class="x-f type6-box1">
  47. <image class="type6-img1" @tap="jump(detail.list[0])" :src="detail.list[0].image" mode="aspectFill"></image>
  48. <image class="type6-img1" @tap="jump(detail.list[1])" :src="detail.list[1].image" mode="aspectFill"></image>
  49. </view>
  50. <view class="x-f type6-box2">
  51. <image class="type6-img2" @tap="jump(detail.list[2])" :src="detail.list[2].image" mode="aspectFill"></image>
  52. <image class="type6-img2" @tap="jump(detail.list[3])" :src="detail.list[3].image" mode="aspectFill"></image>
  53. <image class="type6-img2" @tap="jump(detail.list[4])" :src="detail.list[4].image" mode="aspectFill"></image>
  54. </view>
  55. </view>
  56. </view>
  57. </template>
  58. <script>
  59. export default {
  60. components: {},
  61. data() {
  62. return {}
  63. },
  64. props: {
  65. detail: Object,
  66. },
  67. computed: {},
  68. created() {},
  69. mounted() {
  70. console.log(this)
  71. },
  72. methods: {
  73. // 路由跳转
  74. jump(item) {
  75. if (item.uniapp_url) {
  76. this.$yrouter.push(item.uniapp_url)
  77. }
  78. },
  79. },
  80. }
  81. </script>
  82. <style lang="scss">
  83. .adv-box {
  84. background-color: #fff;
  85. border-radius: 20rpx;
  86. overflow: hidden;
  87. image {
  88. width: 100%;
  89. }
  90. .type1 {
  91. .type1-img {
  92. flex: 1;
  93. height: 220rpx;
  94. &:first-child {
  95. border-right: 1rpx solid #f6f6f6;
  96. }
  97. }
  98. }
  99. .type2 {
  100. .type2-img1 {
  101. width: (710rpx/2);
  102. height: 340rpx;
  103. border-right: 1rpx solid #f6f6f6;
  104. }
  105. .type2-box {
  106. flex: 1;
  107. height: 340rpx;
  108. width: (710rpx/2);
  109. .type2-img2 {
  110. height: (340rpx/2);
  111. }
  112. }
  113. }
  114. .type3 {
  115. .type3-box {
  116. width: (710rpx/2);
  117. border-right: 1rpx solid #f6f6f6;
  118. .type3-img1 {
  119. flex: 1;
  120. height: (340rpx/2);
  121. &:first-child {
  122. border-bottom: 1rpx solid #f6f6f6;
  123. }
  124. }
  125. }
  126. .type3-img2 {
  127. flex: 1;
  128. height: 340rpx;
  129. width: (710rpx/2);
  130. }
  131. }
  132. .type4 {
  133. .type4-box {
  134. border-bottom: 1rpx solid #f6f6f6;
  135. .type4-img1 {
  136. flex: 1;
  137. height: (340rpx/2);
  138. &:first-child {
  139. border-right: 1rpx solid #f6f6f6;
  140. }
  141. }
  142. }
  143. .type4-img2 {
  144. flex: 1;
  145. height: (340rpx/2);
  146. width: 710rpx;
  147. }
  148. }
  149. .type5 {
  150. .type5-img1 {
  151. width: 710rpx;
  152. height: (340rpx/2);
  153. border-bottom: 1rpx solid #f6f6f6;
  154. }
  155. .type5-box {
  156. flex: 1;
  157. height: (340rpx/2);
  158. width: 710rpx;
  159. .type5-img2 {
  160. height: (340rpx/2);
  161. &:first-child {
  162. border-right: 1rpx solid #f6f6f6;
  163. }
  164. }
  165. }
  166. }
  167. .type6 {
  168. .type6-box1 {
  169. .type6-img1 {
  170. width: (710rpx/2);
  171. height: (340rpx/2);
  172. &:first-child {
  173. border-right: 1rpx solid #f6f6f6;
  174. }
  175. }
  176. }
  177. .type6-box2 {
  178. border-top: 1rpx solid #f6f6f6;
  179. .type6-img2 {
  180. width: (710rpx/3);
  181. height: (340rpx/2);
  182. border-right: 1rpx solid #f6f6f6;
  183. &:last-child {
  184. border-right: 0;
  185. }
  186. }
  187. }
  188. }
  189. image {
  190. // background-color: #ccc;
  191. }
  192. }
  193. </style>