index.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  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="skeletonShow"></banner>
  14. <!-- 金刚区菜单 -->
  15. <navbars :list="banners" v-if="skeletonShow"></navbars>
  16. <!-- 活动模块 -->
  17. <hotmode :list="navBars" v-if="skeletonShow"></hotmode>
  18. <!-- 楼层模块 -->
  19. <floors :list="flootData" v-if="skeletonShow"></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. skeletonShow: false,
  51. clubId: 0,
  52. clubStatus: '',
  53. current: 0,
  54. mode: 'round',
  55. isLogin: false,
  56. userIdentity: 0,
  57. banners: [], // 轮播
  58. navBars: [], // 导航分类
  59. flootData: [], // 楼层
  60. isScrollTop: false,
  61. }
  62. },
  63. onLoad() {},
  64. onPageScroll(e) {
  65. //实时获取到滚动的值
  66. if (e.scrollTop > 50) {
  67. this.inputActive = 'fixed'
  68. } else {
  69. this.inputActive = 'float'
  70. }
  71. if (e.scrollTop > 400) {
  72. this.isScrollTop = true
  73. } else {
  74. this.isScrollTop = false
  75. }
  76. },
  77. onPullDownRefresh() {
  78. //下拉刷新
  79. this.getHomeInformation()
  80. uni.stopPullDownRefresh()
  81. },
  82. onShareAppMessage(res) {
  83. //分享转发
  84. if (res.from === 'button') {
  85. // 来自页面内转发按钮
  86. }
  87. return {
  88. title: '生美医美正品采购服务平台',
  89. path: 'pages/tabBar/home/index',
  90. imageUrl: 'https://static.caimei365.com/app/img/bg/min-banner.jpg'
  91. }
  92. },
  93. onShow() {
  94. // this.GetWxAuthorize()
  95. this.mallOrganizeHome()
  96. },
  97. onHide() {
  98. }
  99. }
  100. </script>
  101. <style lang="scss">
  102. page {
  103. background-color: #ffffff;
  104. }
  105. .container-section {
  106. width: 100%;
  107. height: auto;
  108. background-color: #f7f7f7;
  109. }
  110. </style>