index.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. <template>
  2. <view class="container home clearfix" :style="{ paddingTop: CustomBar + 'px' }">
  3. <customer ref="customer" :navbar-data="nvabarData"></customer>
  4. <!-- 主页内容 -->
  5. <tui-skeleton
  6. v-if="skeletonShow"
  7. backgroundColor="#fafafa"
  8. borderRadius="10rpx"
  9. :isLoading="true"
  10. :loadingType="5"
  11. ></tui-skeleton>
  12. <view class="container-home tui-skeleton">
  13. <!-- 轮播 -->
  14. <banner :list="bannerImageList" v-if="isNavRequest"></banner>
  15. <!-- 金刚区菜单 -->
  16. <navbars :list="navBarsList" v-if="isNavRequest"></navbars>
  17. <!-- 轮播公告 -->
  18. <notice :list="newsList" v-if="isNavRequest && newsList.length > 0"></notice>
  19. <!-- 优惠券入口 -->
  20. <coupon v-if="isNavRequest && couponEntry == 1"></coupon>
  21. <!-- 直播 -->
  22. <page-special :templateData="templateData" v-if="isLiveRequest"></page-special>
  23. <!-- 新品橱窗 -->
  24. <hot-floor
  25. :list="hotListPageFloor"
  26. :usserIdentity="userIdentity"
  27. :autoplay="autoplay"
  28. v-if="isRequest && hotListPageFloor.length > 0"
  29. ></hot-floor>
  30. </view>
  31. <!-- 楼层 -->
  32. <view class="container-section tui-skeleton">
  33. <page-floor :list="pageList" :userIdentity="userIdentity" :pageType="1" v-if="isRequest"></page-floor>
  34. <supplier-list :supplierObj="supplierObj" v-if="isRequest"></supplier-list>
  35. </view>
  36. <!-- 资质证书 -->
  37. <Certificate v-if="isRequest"></Certificate>
  38. <!-- 侧边 -->
  39. <scroll-top :isScrollTop="isScrollTop" :bottom="50"></scroll-top>
  40. <!-- 活动弹窗 -->
  41. <activityAlert :show="isActivity" @click="handleClick" @cancel="handleCancelClick"></activityAlert>
  42. <!-- 采美豆提示弹窗 -->
  43. <activityBean
  44. v-if="isActivityBean"
  45. :show="isActivityBean"
  46. :beansType="beansType"
  47. :beanNumber="beanNumber"
  48. @cancel="handleBeanlClick"
  49. ></activityBean>
  50. </view>
  51. </template>
  52. <script>
  53. import { mapState, mapMutations } from 'vuex'
  54. import customer from '@/components/cm-module/homeIndex/customer.vue'
  55. import banner from '@/components/cm-module/homeIndex/banner.vue'
  56. import navbars from '@/components/cm-module/homeIndex/navbars.vue'
  57. import notice from '@/components/cm-module/homeIndex/notice.vue'
  58. import coupon from '@/components/cm-module/homeIndex/coupon.vue'
  59. import pageFloor from '@/components/cm-module/homeIndex/pageFloor.vue'
  60. import hotFloor from '@/components/cm-module/homeIndex/hotFloor.vue'
  61. import Certificate from '@/components/cm-module/homeIndex/certificate.vue'
  62. import pageSpecial from '@/components/cm-module/homeIndex/pageSpecial.vue'
  63. import supplierList from '@/components/cm-module/homeIndex/supplierList.vue'
  64. import activityAlert from '@/components/cm-module/activity/activity.vue'
  65. import activityBean from '@/components/cm-module/activity/activityBean.vue'
  66. import homeMiXins from './index.js'
  67. export default {
  68. mixins: [ homeMiXins ],
  69. components: {
  70. customer,
  71. banner,
  72. navbars,
  73. notice,
  74. coupon,
  75. pageFloor,
  76. hotFloor,
  77. Certificate,
  78. pageSpecial,
  79. supplierList,
  80. activityAlert,
  81. activityBean
  82. },
  83. data() {
  84. return {
  85. nvabarData: {
  86. // 顶部自定义导航
  87. showCapsule: 1, // 是否显示左上角图标 1表示显示 0表示不显示,
  88. showSearch: 0,
  89. title: '采美采购商城', // 导航栏 中间的标题
  90. haveBack: false,
  91. textLeft: this.$store.state.isIphone,
  92. textColor: '#FFFFFF'
  93. },
  94. CustomBar: this.CustomBar, // 顶部导航栏高度
  95. userID: 0,
  96. clubId: 0,
  97. clubStatus: '',
  98. current: 0,
  99. mode: 'round',
  100. isLogin: false,
  101. skeletonShow: true,
  102. userIdentity: 0,
  103. flootData: [], // 楼层
  104. bannerImageList: [], // 轮播
  105. navBarsList: [], // 导航分类
  106. newsList: [], // 公告
  107. templateData: {},
  108. hotListPageFloor: [], // 新品橱窗
  109. pageList: [], // 楼层
  110. supplierObj: {}, // 供应商列表
  111. isScrollTop: false,
  112. isRequest: false,
  113. isNavRequest: false,
  114. isLiveRequest: false,
  115. isActivityBean: false,
  116. beansType: 1,
  117. beanNumber: 50,
  118. couponEntry: 2,
  119. autoplay: true
  120. }
  121. },
  122. onLoad() {},
  123. onPageScroll(e) {
  124. //实时获取到滚动的值
  125. if (e.scrollTop > 50) {
  126. this.inputActive = 'fixed'
  127. } else {
  128. this.inputActive = 'float'
  129. }
  130. if (e.scrollTop > 400) {
  131. this.isScrollTop = true
  132. } else {
  133. this.isScrollTop = false
  134. }
  135. },
  136. onPullDownRefresh() {
  137. //下拉刷新
  138. this.getHomeInformation()
  139. uni.stopPullDownRefresh()
  140. },
  141. onShareAppMessage(res) {
  142. //分享转发
  143. if (res.from === 'button') {
  144. // 来自页面内转发按钮
  145. }
  146. return {
  147. title: '生美医美正品采购服务平台',
  148. path: 'pages/tabBar/home/index',
  149. imageUrl: 'https://static.caimei365.com/app/img/bg/min-banner.jpg'
  150. }
  151. },
  152. onShow() {
  153. this.autoplay = true
  154. this.GetWxAuthorize()
  155. },
  156. onHide() {
  157. this.autoplay = false
  158. }
  159. }
  160. </script>
  161. <style lang="scss">
  162. page {
  163. background-color: #ffffff;
  164. }
  165. .container-section {
  166. width: 100%;
  167. height: auto;
  168. background-color: #f7f7f7;
  169. }
  170. </style>