index.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  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. </block>
  57. </view>
  58. </template>
  59. <script>
  60. import Search from './search'
  61. import Images from './image'
  62. import Banner from './banner'
  63. import Window from './window'
  64. import Videos from './video'
  65. import Article from './article'
  66. import Notice from './notice'
  67. import NavBar from './navBar'
  68. import Goods from './goods'
  69. import Service from './service'
  70. import Blank from './blank'
  71. import Guide from './guide'
  72. import RichText from './richText'
  73. export default {
  74. name: "Page",
  75. components: {
  76. Search,
  77. Images,
  78. Banner,
  79. Window,
  80. Videos,
  81. Article,
  82. Notice,
  83. NavBar,
  84. Goods,
  85. Service,
  86. Blank,
  87. Guide,
  88. RichText
  89. },
  90. /**
  91. * 组件的属性列表
  92. * 用于组件自定义设置
  93. */
  94. props: {
  95. items: {
  96. type: Array,
  97. default () {
  98. return []
  99. }
  100. }
  101. },
  102. }
  103. </script>
  104. <style lang="scss">
  105. // 组件样式
  106. </style>