index.vue 5.3 KB

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