<template>
	<view class="container home clearfix">
		<!-- 主页内容 -->
		<tui-skeleton
			v-if="!skeletonShow"
			backgroundColor="#fafafa"
			borderRadius="10rpx"
			:isLoading="true"
			:loadingType="5"
		></tui-skeleton>
		<view class="container-home tui-skeleton">
			<!-- 轮播 -->
			<banner :list="bannerImageList" v-if="skeletonShow"></banner>
			<!-- 金刚区菜单 -->
			<navbars :list="banners" v-if="skeletonShow"></navbars>
			<!-- 活动模块 -->
			<hotmode :list="navBars" v-if="skeletonShow"></hotmode>
			<!-- 楼层模块 -->
			<floors :list="flootData" v-if="skeletonShow"></floors>
		</view>
	</view>
</template>

<script>
import { mapState, mapMutations } from 'vuex'
import banner from './components/banner.vue'
import navbars from './components/navbars.vue'
import hotmode from './components/hotmode.vue'
import floors from './components/floors.vue'
import homeMiXins from './index.js'
export default {
	mixins: [ homeMiXins ], 
	components: {
		banner,
		navbars,
		hotmode,
		floors
	},
	data() {
		return {
			nvabarData: {
				// 顶部自定义导航
				showCapsule: 1, // 是否显示左上角图标  1表示显示  0表示不显示,
				showSearch: 0,
				title: '联合丽格集采商城', // 导航栏 中间的标题
				haveBack: false,
				textLeft: this.$store.state.isIphone,
				textColor: '#FFFFFF'
			},
			CustomBar: this.CustomBar, // 顶部导航栏高度
			skeletonShow: false,
			clubId: 0,
			clubStatus: '',
			current: 0,
			mode: 'round',
			isLogin: false,
			userIdentity: 0,
			banners: [], // 轮播
			navBars: [], // 导航分类
			flootData: [], // 楼层
			isScrollTop: false,
		}
	},
	onLoad() {},
	onPageScroll(e) {
		//实时获取到滚动的值
		if (e.scrollTop > 50) {
			this.inputActive = 'fixed'
		} else {
			this.inputActive = 'float'
		}
		if (e.scrollTop > 400) {
			this.isScrollTop = true
		} else {
			this.isScrollTop = false
		}
	},
	onPullDownRefresh() {
		//下拉刷新
		this.getHomeInformation()
		uni.stopPullDownRefresh()
	},
	onShareAppMessage(res) {
		//分享转发
		if (res.from === 'button') {
			// 来自页面内转发按钮
		}
		return {
			title: '生美医美正品采购服务平台',
			path: 'pages/tabBar/home/index',
			imageUrl: 'https://static.caimei365.com/app/img/bg/min-banner.jpg'
		}
	},
	onShow() {
		// this.GetWxAuthorize()
		this.mallOrganizeHome()
	},
	onHide() {
	}
}
</script>

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

</style>
