<template>
	<view class="container home clearfix">
		<!-- 参展商 -->
		<view class="container-page clearfix">
			<view class="tui-group-list">
				<view class="floor-item-sup" v-for="(supps,index) in supplierList2" :key="index" @click="goSupplierPath(supps.type,supps.id,supps.keyWord)">
					<image :src="supps.image" class="floor-item-image" mode=""></image>
				</view>
			</view>
		</view>
		<!-- 侧边 -->
		<scroll-top :isScrollTop="isScrollTop" :bottom="50"></scroll-top>
	</view>
</template>

<script>
	import authorize from '@/common/config/authorize.js'
	import pageFloor from '@/components/cm-module/homeIndex/pageFloor.vue'
	import supplierList from '@/components/cm-module/homeIndex/supplierList.vue'
	import { mapState,mapMutations} from 'vuex';
	export default {
		components:{
			pageFloor,
			supplierList,
		},
		data() {
			return {
				userID:0,
				current:0,
				mode:'round',
				modallayer:false,
				isLogin:false,
				skeletonShow: true,
				userIdentity:'',
				supplierList2:[
					{image:'http://static.caimei365.com/app/meibohui/meibo_logo_01.jpg',id:1172,type:1,keyWord:''},
					{image:'http://static.caimei365.com/app/meibohui/meibo_logo_02.jpg',id:8888,type:2,keyWord:'INDIBA'},
					{image:'http://static.caimei365.com/app/meibohui/meibo_logo_03.jpg',id:8888,type:2,keyWord:'维锶'},
					{image:'http://static.caimei365.com/app/meibohui/meibo_logo_04.jpg',id:8888,type:2,keyWord:'imperium'},
					{image:'http://static.caimei365.com/app/meibohui/meibo_logo_05.jpg',id:8888,type:2,keyWord:'易路达'},
					{image:'http://static.caimei365.com/app/meibohui/meibo_logo_06.jpg',id:8888,type:2,keyWord:'ACTIVE'},
					{image:'http://static.caimei365.com/app/meibohui/meibo_logo_07.jpg',id:1201,type:1,keyWord:''},
					{image:'http://static.caimei365.com/app/meibohui/meibo_logo_09.jpg',id:1285,type:1,keyWord:''},
					{image:'http://static.caimei365.com/app/meibohui/meibo_logo_10.jpg',id:1206,type:1,keyWord:''},
					{image:'http://static.caimei365.com/app/meibohui/meibo_logo_11.jpg',id:1258,type:1,keyWord:''},
					{image:'http://static.caimei365.com/app/meibohui/meibo_logo_12.jpg',id:1184,type:1,keyWord:''},
					{image:'http://static.caimei365.com/app/meibohui/meibo_logo_13.jpg',id:1193,type:1,keyWord:''},
					{image:'http://static.caimei365.com/app/meibohui/meibo_logo_14.jpg',id:1292,type:1,keyWord:''},
					{image:'http://static.caimei365.com/app/meibohui/meibo_logo_15.jpg',id:1201,type:1,keyWord:''},
					{image:'http://static.caimei365.com/app/meibohui/meibo_logo_16.jpg',id:1217,type:1,keyWord:''}
				],
				isScrollTop:false
			}
		},
		onLoad() {
			
		},
		computed: {
			...mapState(['hasLogin','userInfo','identity','isActivity'])
		},
		methods: {
			...mapMutations(['login','logout']),
			goSupplierPath(type,value,keyWord){
				if(type == 1){
					this.$api.navigateTo('/supplier/pages/user/my-shop?shopId='+value)
				}else if(type == 2){
					this.$api.navigateTo(`/search/pages/search/search?keyWord=${keyWord}`)
				}
			},
		},
		onPageScroll(e){//实时获取到滚动的值
			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: '/h5/pages/activity/meobohui',
			  imageUrl:'https://static.caimei365.com/app/img/bg/min-banner.jpg'
			}
		},
		onShow(){
			
		}
	}
</script>

<style lang="scss">
	page{
		background-color: #F7F7F7;
	}
	.container-page{
		background-color: #F7F7F7;
		width: 100%;
		height: auto;
		box-sizing: border-box;
		padding: 24rpx;
		float: left;
	}
	.tui-group-list{
		width: 100%;
		height: auto;
		.floor-item-sup{
			width: 162rpx;
			height: 162rpx;
			float: left;
			margin-right: 18rpx;
			margin-bottom: 24rpx;
			&:nth-child(4n){
				margin-right: 0;
			}
			.floor-item-image{
				width: 100%;
				height: 100%;
				display: block;
			}
		}
	}
	.container-section{
		width: 100%;
		height: auto;
		background-color: #F7F7F7;
	}
</style>
