index.vue 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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="bannerList" v-if="skeletonShow"></banner>
  14. <!-- 金刚区菜单 -->
  15. <navbars :list="mainmenu" v-if="skeletonShow"></navbars>
  16. <!-- 活动模块 -->
  17. <hotmode :mallTheme="mallTheme" v-if="skeletonShow"></hotmode>
  18. <!-- 楼层模块 -->
  19. <floors :list="floorList" 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. onLoad() {},
  39. onPageScroll(e) {
  40. //实时获取到滚动的值
  41. if (e.scrollTop > 50) {
  42. this.inputActive = 'fixed'
  43. } else {
  44. this.inputActive = 'float'
  45. }
  46. if (e.scrollTop > 400) {
  47. this.isScrollTop = true
  48. } else {
  49. this.isScrollTop = false
  50. }
  51. },
  52. onPullDownRefresh() {
  53. //下拉刷新
  54. this.getHomeInformation()
  55. uni.stopPullDownRefresh()
  56. },
  57. onShareAppMessage(res) {
  58. //分享转发
  59. if (res.from === 'button') {
  60. // 来自页面内转发按钮
  61. }
  62. return {
  63. title: '联合丽格集采商城',
  64. path: 'pages/tabBar/home/index',
  65. imageUrl: 'https://static.caimei365.com/app/img/bg/min-banner.jpg'
  66. }
  67. },
  68. onShow() {
  69. this.authApplets()
  70. },
  71. onHide() {
  72. }
  73. }
  74. </script>
  75. <style lang="scss">
  76. page {
  77. background-color: #ffffff;
  78. }
  79. .container-section {
  80. width: 100%;
  81. height: auto;
  82. background-color: #f7f7f7;
  83. }
  84. </style>