index.vue 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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. <!-- 侧边 -->
  22. <scroll-top :isScrollTop="isScrollTop" :bottom="50"></scroll-top>
  23. </view>
  24. </template>
  25. <script>
  26. import { mapState, mapMutations } from 'vuex'
  27. import banner from './components/banner.vue'
  28. import navbars from './components/navbars.vue'
  29. import hotmode from './components/hotmode.vue'
  30. import floors from './components/floors.vue'
  31. import homeMiXins from './index.js'
  32. export default {
  33. mixins: [ homeMiXins ],
  34. components: {
  35. banner,
  36. navbars,
  37. hotmode,
  38. floors
  39. },
  40. onLoad() {},
  41. onPageScroll(e) {
  42. //实时获取到滚动的值
  43. if (e.scrollTop > 400) {
  44. this.isScrollTop = true
  45. } else {
  46. this.isScrollTop = false
  47. }
  48. },
  49. onPullDownRefresh() {
  50. //下拉刷新
  51. this.mallOrganizeHome()
  52. uni.stopPullDownRefresh()
  53. },
  54. onShareAppMessage(res) {
  55. //分享转发
  56. if (res.from === 'button') {
  57. // 来自页面内转发按钮
  58. }
  59. return {
  60. title: '联合丽格集采商城',
  61. path: 'pages/tabBar/home/index',
  62. imageUrl: `${this.staticUrl}icon_share_home@2x.png`
  63. }
  64. },
  65. onShow() {
  66. this.authApplets()
  67. },
  68. onHide() {
  69. }
  70. }
  71. </script>
  72. <style lang="scss">
  73. page {
  74. background-color: #ffffff;
  75. }
  76. .container-section {
  77. width: 100%;
  78. height: auto;
  79. background-color: #f7f7f7;
  80. }
  81. </style>