<template>
	<view class="container home clearfix">
		<cu-custom :navbar-data='nvabarData'></cu-custom>
		<!-- 主页内容 -->
		<tui-skeleton
			v-if="!skeletonShow"
			backgroundColor="#fafafa"
			borderRadius="10rpx"
			:isLoading="true"
			:loadingType="5"
		></tui-skeleton>
		<view class="container-home tui-skeleton" :style="{paddingTop: CustomBar + 'px',paddingBottom: isIphoneX ? '140rpx' : '98rpx'}">
			<!-- 轮播 -->
			<banner :list="bannerList" v-if="skeletonShow"></banner>
			<!-- 金刚区菜单 -->
			<navbars :list="mainmenu" v-if="skeletonShow"></navbars>
			<!-- 活动模块 -->
			<hotmode :mallTheme="mallTheme" v-if="skeletonShow"></hotmode>
			<!-- 楼层模块 -->
			<floors :list="floorList" v-if="skeletonShow"></floors>
		</view>
		<!-- 侧边 -->
		<scroll-top :isScrollTop="isScrollTop" :bottom="50"></scroll-top>
	</view>
</template>

<script>
import { mapState, mapMutations } from 'vuex'
import banner from './banner.vue'
import navbars from './navbars.vue'
import hotmode from './hotmode.vue'
import floors from './floors.vue'
import homeMiXins from '../index.js'
export default {
	mixins: [ homeMiXins ], 
	components: {
		banner,
		navbars,
		hotmode,
		floors
	},
	created() {
		this.mallOrganizeHome()
	},
	onPageScroll(e) {
		//实时获取到滚动的值
		if (e.scrollTop > 400) {
			this.isScrollTop = true
		} else {
			this.isScrollTop = false
		}
	},
	onPullDownRefresh() {
		//下拉刷新
		this.mallOrganizeHome()
		uni.stopPullDownRefresh()
	},
	onShareAppMessage(res) {
		//分享转发
		if (res.from === 'button') {
			// 来自页面内转发按钮
		} 
		return {
			title: '联合丽格集采商城',
			path: 'pages/tabBar/home/index',
			imageUrl: `${this.staticUrl}icon_share_home@2x.png`
		}
	},
	onShow() {
		
	},
	onHide() {
	}
}
</script>

<style lang="scss">
page {
	background-color: #ffffff;
}
.container-section {
	width: 100%;
	height: auto;
	background-color: #f7f7f7;
}

</style>
