index.vue 4.2 KB

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