index.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. <template>
  2. <view class="page-items">
  3. <block v-for="(item, index) in items" :key="index">
  4. <!-- 搜索框 -->
  5. <block v-if="item.type === 'search'">
  6. <Search :itemStyle="item.style" :params="item.params" />
  7. </block>
  8. <!-- 图片组 -->
  9. <block v-if="item.type === 'image'">
  10. <Images :itemStyle="item.style" :params="item.params" :dataList="item.data" />
  11. </block>
  12. <!-- 轮播图 -->
  13. <block v-if="item.type === 'banner'">
  14. <Banner :itemStyle="item.style" :params="item.params" :dataList="item.data" />
  15. </block>
  16. <!-- 图片橱窗 -->
  17. <block v-if="item.type === 'window'">
  18. <Window :itemStyle="item.style" :params="item.params" :dataList="item.data" />
  19. </block>
  20. <!-- 视频 -->
  21. <block v-if="item.type === 'video'">
  22. <Videos :itemStyle="item.style" :params="item.params" />
  23. </block>
  24. <!-- 文章组 -->
  25. <block v-if="item.type === 'article'">
  26. <Article :params="item.params" :dataList="item.data" />
  27. </block>
  28. <!-- 店铺公告 -->
  29. <block v-if="item.type === 'notice'">
  30. <Notice :itemStyle="item.style" :params="item.params" />
  31. </block>
  32. <!-- 导航 -->
  33. <block v-if="item.type === 'navBar'">
  34. <NavBar :itemStyle="item.style" :params="item.params" :dataList="item.data" />
  35. </block>
  36. <!-- 商品 -->
  37. <block v-if="item.type === 'goods'">
  38. <Goods :itemStyle="item.style" :params="item.params" :dataList="item.data" />
  39. </block>
  40. <!-- 在线客服 -->
  41. <block v-if="item.type === 'service'">
  42. <Service :itemStyle="item.style" :params="item.params" />
  43. </block>
  44. <!-- 辅助空白 -->
  45. <block v-if="item.type === 'blank'">
  46. <Blank :itemStyle="item.style" />
  47. </block>
  48. <!-- 辅助线 -->
  49. <block v-if="item.type === 'guide'">
  50. <Guide :itemStyle="item.style" />
  51. </block>
  52. <!-- 富文本 -->
  53. <block v-if="item.type === 'richText'">
  54. <RichText :itemStyle="item.style" :params="item.params" />
  55. </block>
  56. <!-- 头条快报 -->
  57. <block v-if="item.type === 'special'">
  58. <Special :itemStyle="item.style" :params="item.params" :dataList="item.data" />
  59. </block>
  60. <!-- 关注公众号 -->
  61. <block v-if="item.type === 'officialAccount'">
  62. <DiyOfficialAccount />
  63. </block>
  64. <!-- 优惠券 -->
  65. <block v-if="item.type === 'coupon'">
  66. <Coupon :itemStyle="item.style" :params="item.params" :dataList="item.data" />
  67. </block>
  68. <!-- 图片组 -->
  69. <block v-if="item.type === 'hotZone'">
  70. <HotZone :itemStyle="item.style" :params="item.params" :data="item.data" />
  71. </block>
  72. <!-- 备案号 -->
  73. <block v-if="item.type === 'ICPLicense'">
  74. <ICPLicense :itemStyle="item.style" :params="item.params" />
  75. </block>
  76. </block>
  77. </view>
  78. </template>
  79. <script>
  80. import Search from './diyComponents/search'
  81. import Images from './diyComponents/image'
  82. import Banner from './diyComponents/banner'
  83. import Window from './diyComponents/window'
  84. import HotZone from './diyComponents/hotZone'
  85. import Videos from './diyComponents/video'
  86. import Article from './diyComponents/article'
  87. import Notice from './diyComponents/notice'
  88. import NavBar from './diyComponents/navBar'
  89. import Goods from './diyComponents/goods'
  90. import Service from './diyComponents/service'
  91. import Blank from './diyComponents/blank'
  92. import Guide from './diyComponents/guide'
  93. import RichText from './diyComponents/richText'
  94. import Special from './diyComponents/special'
  95. import DiyOfficialAccount from './diyComponents/officialAccount'
  96. import Coupon from './diyComponents/coupon'
  97. import ICPLicense from './diyComponents/ICPLicense'
  98. export default {
  99. name: "Page",
  100. components: {
  101. Search,
  102. Images,
  103. Banner,
  104. Window,
  105. HotZone,
  106. Videos,
  107. Article,
  108. Notice,
  109. NavBar,
  110. Goods,
  111. Service,
  112. Blank,
  113. Guide,
  114. RichText,
  115. Special,
  116. DiyOfficialAccount,
  117. Coupon,
  118. ICPLicense
  119. },
  120. /**
  121. * 组件的属性列表
  122. * 用于组件自定义设置
  123. */
  124. props: {
  125. items: {
  126. type: Array,
  127. default () {
  128. return []
  129. }
  130. }
  131. },
  132. }
  133. </script>
  134. <style lang="scss">
  135. // 组件样式
  136. </style>