index.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. <template>
  2. <view class="container home clearfix">
  3. <!-- 主页内容 -->
  4. <tui-skeleton
  5. v-if="skeletonShow"
  6. backgroundColor="#fafafa"
  7. borderRadius="10rpx"
  8. :isLoading="true"
  9. :loadingType="5"
  10. ></tui-skeleton>
  11. <view class="container-home tui-skeleton">
  12. <!-- 轮播 -->
  13. <banner :list="bannerImageList" v-if="isNavRequest"></banner>
  14. <!-- 金刚区菜单 -->
  15. <navbars :list="navBarsList" v-if="isNavRequest"></navbars>
  16. <!-- 活动模块 -->
  17. <hotmode :list="navBarsList" v-if="isNavRequest"></hotmode>
  18. <!-- 楼层模块 -->
  19. <floors :list="navBarsList" v-if="isNavRequest"></floors>
  20. </view>
  21. </view>
  22. </template>
  23. <script>
  24. import { mapState, mapMutations } from 'vuex'
  25. import banner from './components/banner.vue'
  26. import navbars from './components/navbars.vue'
  27. import hotmode from './components/hotmode.vue'
  28. import floors from './components/floors.vue'
  29. import homeMiXins from './index.js'
  30. export default {
  31. mixins: [ homeMiXins ],
  32. components: {
  33. banner,
  34. navbars,
  35. hotmode,
  36. floors
  37. },
  38. data() {
  39. return {
  40. nvabarData: {
  41. // 顶部自定义导航
  42. showCapsule: 1, // 是否显示左上角图标 1表示显示 0表示不显示,
  43. showSearch: 0,
  44. title: '联合丽格集采商城', // 导航栏 中间的标题
  45. haveBack: false,
  46. textLeft: this.$store.state.isIphone,
  47. textColor: '#FFFFFF'
  48. },
  49. CustomBar: this.CustomBar, // 顶部导航栏高度
  50. userID: 0,
  51. clubId: 0,
  52. clubStatus: '',
  53. current: 0,
  54. mode: 'round',
  55. isLogin: false,
  56. skeletonShow: true,
  57. userIdentity: 0,
  58. flootData: [], // 楼层
  59. bannerImageList: [], // 轮播
  60. navBarsList: [], // 导航分类
  61. newsList: [], // 公告
  62. templateData: {},
  63. hotListPageFloor: [], // 新品橱窗
  64. pageList: [], // 楼层
  65. supplierObj: {}, // 供应商列表
  66. isScrollTop: false,
  67. isRequest: false,
  68. isNavRequest: false,
  69. isLiveRequest: false,
  70. isActivityBean: false,
  71. beansType: 1,
  72. beanNumber: 50,
  73. couponEntry: 2,
  74. autoplay: true
  75. }
  76. },
  77. onLoad() {},
  78. onPageScroll(e) {
  79. //实时获取到滚动的值
  80. if (e.scrollTop > 50) {
  81. this.inputActive = 'fixed'
  82. } else {
  83. this.inputActive = 'float'
  84. }
  85. if (e.scrollTop > 400) {
  86. this.isScrollTop = true
  87. } else {
  88. this.isScrollTop = false
  89. }
  90. },
  91. onPullDownRefresh() {
  92. //下拉刷新
  93. this.getHomeInformation()
  94. uni.stopPullDownRefresh()
  95. },
  96. onShareAppMessage(res) {
  97. //分享转发
  98. if (res.from === 'button') {
  99. // 来自页面内转发按钮
  100. }
  101. return {
  102. title: '生美医美正品采购服务平台',
  103. path: 'pages/tabBar/home/index',
  104. imageUrl: 'https://static.caimei365.com/app/img/bg/min-banner.jpg'
  105. }
  106. },
  107. onShow() {
  108. this.autoplay = true
  109. this.GetWxAuthorize()
  110. },
  111. onHide() {
  112. this.autoplay = false
  113. }
  114. }
  115. </script>
  116. <style lang="scss">
  117. page {
  118. background-color: #ffffff;
  119. }
  120. .container-section {
  121. width: 100%;
  122. height: auto;
  123. background-color: #f7f7f7;
  124. }
  125. </style>