<template>
	<mobile-frame :frameStyle="frameStyle" @toPath="toPath">
		<view class="main">
			<view class="zero one">
				<input type="text" placeholder="搜索商品">
			</view>
			<view class="zero two">
				<swiper class="swiper" circular :indicator-dots="true" indicator-color="#ffffff" indicator-active-color="#FB1438" :autoplay="true" :interval="3000" :duration="1000">
					<swiper-item class="list" v-for="(item,index) in bannerList" :key="index">
						<image class="image" :src="item.url" mode=""></image>
					</swiper-item>
				</swiper>
			</view>
			<view class="zero thr">
				<view class="list" v-for="(item,index) in btnList" :key="index">
					<image class="image" :src="item.url" mode=""></image>
					<view class="textOver name">
						{{item.name}}
					</view>
				</view>
			</view>
			<view class="zero four">
				<view class="recomList" v-for="(item,index) in recomList" :key="index">
					<view class="title">
						<text>{{item.title}}</text>
						<text>{{item.titles}}</text>
					</view>
					<view class="market">
						<view class="list" v-for="(tag,indexs) in item.list" :key="indexs">
							<image class="image" :src="tag.url" mode=""></image>
							<view class="name">
								{{item.name}}
							</view>
						</view>
					</view>
				</view>
			</view>
			<view class="zero five">
				数据列表
			</view>
		</view>
	</mobile-frame>
</template>

<script>
	export default {
		data() {
			return {
				frameStyle: {
					useBar: true
				},
				bannerList: [ // 轮播图
					{
						url: require('@/static/logo.png')
					},
					{
						url: require('@/static/logo.png')
					},
					{
						url: require('@/static/logo.png')
					},
					{
						url: require('@/static/logo.png')
					},
				],
				btnList: [ //功能按钮
					{
						name: '商品分类',
						url: require('@/static/logo.png'),
						route: ''
					},
					{
						name: '首农专区',
						url: require('@/static/logo.png'),
						route: ''
					},
					{
						name: '地方特产',
						url: require('@/static/logo.png'),
						route: ''
					},
					{
						name: '进口食品',
						url: require('@/static/logo.png'),
						route: ''
					},
					{
						name: '扶贫专区',
						url: require('@/static/logo.png'),
						route: ''
					},
					{
						name: '自提门店',
						url: require('@/static/logo.png'),
						route: ''
					},
					{
						name: '点到优选',
						url: require('@/static/logo.png'),
						route: ''
					},
					{
						name: '活动专区',
						url: require('@/static/logo.png'),
						route: ''
					},
					{
						name: '兑换中心',
						url: require('@/static/logo.png'),
						route: ''
					},
					{
						name: '员工中心',
						url: require('@/static/logo.png'),
						route: ''
					},
				],
				recomList: [ //推荐好物
					{
						title: '新品上架',
						titles: '',
						list: [ //产品
							{
								url: require('@/static/logo.png'),
								name: '产品名称'
							},
							{
								url: require('@/static/logo.png'),
								name: '产品名称'
							},
						]
					},
					{
						title: '发现好货',
						titles: '热销爆款',
						list: [ //产品
							{
								url: require('@/static/logo.png'),
								name: '产品名称'
							},
							{
								url: require('@/static/logo.png'),
								name: '产品名称'
							},
						]
					},
					{
						title: '首农精选',
						titles: '居家常备',
						list: [ //产品
							{
								url: require('@/static/logo.png'),
								name: '产品名称'
							},
							{
								url: require('@/static/logo.png'),
								name: '产品名称'
							},
						]
					},
					{
						title: '人气单品',
						titles: '夏季畅销',
						list: [ //产品
							{
								url: require('@/static/logo.png'),
								name: '产品名称'
							},
							{
								url: require('@/static/logo.png'),
								name: '产品名称'
							},
						]
					}
				]
			};
		},
		onShow: function() {},
		methods: {
			toPath(e) {
				if (e && e.route) uni.redirectTo({
					url: `/${e.route}`
				})
			}
		}
	}
</script>

<style lang="scss">
	.main {
		padding: 2vw;

		.zero {
			margin: 0 0 2vw 0;
		}

		.one {
			background-color: var(--fFB1Color);
			border-radius: 20px;
			padding: 0 2vw;

			input {
				font-size: var(--font15Size);
				color: var(--f85Color);
				border-radius: 14px;
				width: 100%;
				padding: 1.5vw 0;
			}

		}

		.two {
			swiper {
				height: 50vw;
				border-radius: 5px;
			}

			.list {
				border-radius: 5px;

				.image {
					width: 100%;
					height: 100%;
					border-radius: 5px;
				}
			}
		}

		.thr {
			display: flex;
			flex-direction: row;
			justify-content: space-around;
			flex-wrap: wrap;

			.list {
				width: 17vw;
				text-align: center;
				margin: 0 0 2vw 0;

				.image {
					width: 100%;
					height: 16vw;
					margin: 0 0 1vw 0;
				}

				.name {
					font-size: var(--font13Size);
				}
			}
		}
		.four{
			.recomList{
				.title{
					
				}
				.market{
					.list{
						
					}
				}
			}
		}
	}
</style>
