index.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  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. <!-- 文字标题 -->
  77. <block v-if="item.type === 'title'">
  78. <Title :itemStyle="item.style" :params="item.params" />
  79. </block>
  80. </block>
  81. </view>
  82. </template>
  83. <script>
  84. import Search from './diyComponents/search'
  85. import Images from './diyComponents/image'
  86. import Banner from './diyComponents/banner'
  87. import Window from './diyComponents/window'
  88. import HotZone from './diyComponents/hotZone'
  89. import Videos from './diyComponents/video'
  90. import Article from './diyComponents/article'
  91. import Notice from './diyComponents/notice'
  92. import NavBar from './diyComponents/navBar'
  93. import Goods from './diyComponents/goods'
  94. import Service from './diyComponents/service'
  95. import Blank from './diyComponents/blank'
  96. import Guide from './diyComponents/guide'
  97. import RichText from './diyComponents/richText'
  98. import Special from './diyComponents/special'
  99. import DiyOfficialAccount from './diyComponents/officialAccount'
  100. import Coupon from './diyComponents/coupon'
  101. import ICPLicense from './diyComponents/ICPLicense'
  102. import Title from './diyComponents/Title'
  103. export default {
  104. name: "Page",
  105. components: {
  106. Search,
  107. Images,
  108. Banner,
  109. Window,
  110. HotZone,
  111. Videos,
  112. Article,
  113. Notice,
  114. NavBar,
  115. Goods,
  116. Service,
  117. Blank,
  118. Guide,
  119. RichText,
  120. Special,
  121. DiyOfficialAccount,
  122. Coupon,
  123. ICPLicense,
  124. Title
  125. },
  126. /**
  127. * 组件的属性列表
  128. * 用于组件自定义设置
  129. */
  130. props: {
  131. items: {
  132. type: Array,
  133. default () {
  134. return []
  135. }
  136. }
  137. },
  138. }
  139. </script>
  140. <style lang="scss">
  141. // 组件样式
  142. </style>