小程序端工程代码
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.

210 lines
5.6 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. methods: {
  70. // 路由跳转
  71. jump(item) {
  72. console.log(item)
  73. if (item) {
  74. this.$yrouter.push(path)
  75. }
  76. },
  77. },
  78. }
  79. </script>
  80. <style lang="scss">
  81. .adv-box {
  82. background-color: #fff;
  83. border-radius: 20rpx;
  84. overflow: hidden;
  85. .type1 {
  86. .type1-img {
  87. flex: 1;
  88. height: 220rpx;
  89. &:first-child {
  90. border-right: 1rpx solid #f6f6f6;
  91. }
  92. }
  93. }
  94. .type2 {
  95. .type2-img1 {
  96. width: (710rpx/2);
  97. height: 340rpx;
  98. border-right: 1rpx solid #f6f6f6;
  99. }
  100. .type2-box {
  101. flex: 1;
  102. height: 340rpx;
  103. width: (710rpx/2);
  104. .type2-img2 {
  105. height: (340rpx/2);
  106. }
  107. }
  108. }
  109. .type3 {
  110. .type3-box {
  111. width: (710rpx/2);
  112. border-right: 1rpx solid #f6f6f6;
  113. .type3-img1 {
  114. flex: 1;
  115. height: (340rpx/2);
  116. &:first-child {
  117. border-bottom: 1rpx solid #f6f6f6;
  118. }
  119. }
  120. }
  121. .type3-img2 {
  122. flex: 1;
  123. height: 340rpx;
  124. width: (710rpx/2);
  125. }
  126. }
  127. .type4 {
  128. .type4-box {
  129. border-bottom: 1rpx solid #f6f6f6;
  130. .type4-img1 {
  131. flex: 1;
  132. height: (340rpx/2);
  133. &:first-child {
  134. border-right: 1rpx solid #f6f6f6;
  135. }
  136. }
  137. }
  138. .type4-img2 {
  139. flex: 1;
  140. height: (340rpx/2);
  141. width: 710rpx;
  142. }
  143. }
  144. .type5 {
  145. .type5-img1 {
  146. width: 710rpx;
  147. height: (340rpx/2);
  148. border-bottom: 1rpx solid #f6f6f6;
  149. }
  150. .type5-box {
  151. flex: 1;
  152. height: (340rpx/2);
  153. width: 710rpx;
  154. .type5-img2 {
  155. height: (340rpx/2);
  156. &:first-child {
  157. border-right: 1rpx solid #f6f6f6;
  158. }
  159. }
  160. }
  161. }
  162. .type6 {
  163. .type6-box1 {
  164. .type6-img1 {
  165. width: (710rpx/2);
  166. height: (340rpx/2);
  167. &:first-child {
  168. border-right: 1rpx solid #f6f6f6;
  169. }
  170. }
  171. }
  172. .type6-box2 {
  173. border-top: 1rpx solid #f6f6f6;
  174. .type6-img2 {
  175. width: (710rpx/3);
  176. height: (340rpx/2);
  177. border-right: 1rpx solid #f6f6f6;
  178. &:last-child {
  179. border-right: 0;
  180. }
  181. }
  182. }
  183. }
  184. image {
  185. // background-color: #ccc;
  186. }
  187. }
  188. </style>