index.vue 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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. this.mallOrganizeHome()
  71. },
  72. onHide() {
  73. }
  74. }
  75. </script>
  76. <style lang="scss">
  77. page {
  78. background-color: #ffffff;
  79. }
  80. .container-section {
  81. width: 100%;
  82. height: auto;
  83. background-color: #f7f7f7;
  84. }
  85. </style>