<template>
	<view>
		<swiper class="head" :current="banner_current" >
			<swiper-item>
				<image src="https://picsum.photos/375/360" class="swipe-img"></image>
			</swiper-item>
			<swiper-item>
				<image src="https://picsum.photos/375/360" class="swipe-img"></image>
			</swiper-item>
		</swiper>
		<view class="content">
			<!-- 消息模块 -->
			<view class="lf-row-between lf-m-b-34 message-box">
				<view class="lf-flex">
					<u-icon name="lock-fill lf-text-vertical"></u-icon>
					<view class="lf-m-l-12 lf-line-1" style="max-width: 510rpx;">国庆优惠大促，快来看看吧！</view>
				</view>
				<view class="message-btn" hover-class="lf-opacity">详情</view>
			</view>
			<!-- 频道 -->
			<view class="lf-row-between lf-m-b-10">
				<view class="lf-font-36 lf-font-bold lf-color-333">添加频道</view>
				<view class="lf-flex lf-color-555">
					<view class="lf-m-r-10">编辑</view>
					<u-icon name="lock-fill lf-text-vertical"></u-icon>
				</view>
			</view>
			<view class="lf-flex-wrap">
				<view class="channel-item" v-for="(item, index) in 8">
					<image src="../../static/logo.png" class="channel-mask" mode="aspectFill"></image>
					<view>
						<u-icon name="lock-fill lf-text-vertical"></u-icon>
					</view>
				</view>
			</view>
			<!-- 中间广告模块 -->
			<swiper class="lf-m-t-40 ad" :current="banner_current" >
				<swiper-item>
					<image src="https://picsum.photos/375/230" class="lf-w-100 lf-h-100"></image>
				</swiper-item>
			</swiper>
			<!-- 精品推荐 -->
			<view class="lf-row-between lf-m-t-40">
				<view class="lf-font-36 lf-font-bold lf-color-333">精品推荐</view>
				<view class="lf-flex lf-color-555">
					<view class="lf-m-r-10">更多</view>
					<u-icon name="lock-fill lf-text-vertical"></u-icon>
				</view>
			</view>
			<view class="recomm lf-m-t-20">
				<view class="lf-row-between">
					<view class="max-recomm-img">
						<image src="../../static/logo.png" class="lf-w-100 lf-h-100"></image>
					</view>
					<view>
						<view class="recomm-img">
							<image src="../../static/logo.png" class="lf-w-100 lf-h-100"></image>
						</view>
						<view class="recomm-img lf-m-t-10">
							<image src="../../static/logo.png" class="lf-w-100 lf-h-100"></image>
						</view>
					</view>
				</view>
				<view class="lf-row-between lf-m-t-10">
					<view class="recomm-img">
						<image src="../../static/logo.png" class="lf-w-100 lf-h-100"></image>
					</view>
					<view class="recomm-img">
						<image src="../../static/logo.png" class="lf-w-100 lf-h-100"></image>
					</view>
					<view class="recomm-img">
						<image src="../../static/logo.png" class="lf-w-100 lf-h-100"></image>
					</view>
				</view>
			</view>
			<!-- tab标签 -->
			<view class="lf-m-t-40">
				<u-tabs :list="tab_list" :is-scroll="true" :current="current" @change="tabChange"></u-tabs>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				banner_current: 0,
				tab_list: [{
					name: '推荐',
					list: []
				},{
					name: '酒店',
					list: []
				},{
					name: '推荐',
					list: []
				},{
					name: '酒店',
					list: []
				},{
					name: '推荐',
					list: []
				},{
					name: '酒店',
					list: []
				}],
				current: 0
			}
		},
		onLoad() {
			
		},
		methods: {
			tabChange(current){
				this.current = current;
			}
		},
		onPullDownRefresh(){
			uni.stopPullDownRefresh();
		}
	}
</script>

<style>
	page{
		background-color: #F6F6F6;
	}
</style>
<style lang="scss" scoped>
	.head{
		width: 750rpx;
		height: 360rpx;
		.swipe-img{
			width: 100%;
			height: 100%;
		}
	}
	.content{
		width: 750rpx;
		// height: 600rpx;
		height: max-content;
		border-radius: 30rpx 30rpx 0rpx 0rpx;
		position: relative;
		top: -30rpx;
		background-color: #FFFFFF;
		box-sizing: border-box;
		padding: 40rpx 32rpx 10rpx;
		.message-box{
			width: 686rpx;
			height: 53rpx;
			background: #CFE7FD;
			border-radius: 27rpx;
			color: #1998FE;
			box-sizing: border-box;
			padding: 0 20rpx;
			font-size: 24rpx;
			.message-btn{
				width: 80rpx;
				height: 33rpx;
				border-radius: 10rpx;
				border: 1rpx solid #1998FE;
				text-align: center;
				line-height: 31rpx;
			}
		}
	}
	
	.channel-item{
		width: 160rpx;
		height: 160rpx;
		border-radius: 15rpx;
		margin-top: 15rpx;
		margin-right: 15rpx;
		position: relative;
		overflow: hidden;
		&:nth-child(4n){
			margin-right: 0;
		}
		image{
			width: 160rpx;
			height: 160rpx;
			position: absolute;
			z-index: 0;
		}
		view{
			position: absolute;
			right: 0;
			bottom: 0;
			background-color: rgba(255,255,255,0.5);
			width: 42rpx;
			height: 42rpx;
			color: #FFFFFF;
			display: flex;
			justify-content: center;
			align-items: center;
			border-radius: 10rpx 0rpx 15rpx 0rpx;
			z-index: 2;
		}
		.channel-mask::after{
			width: 100%;
			height: 100%;
			content: '';
			position: absolute;
			z-index: 1;
			background: rgba(0, 0, 0, 0.5);
			top: 0;
			left: 0;
		}
	}
	
	.ad{
		height: 230rpx;
		width: 100%;
	}
	
	.recomm{
		width: 100%;
		height: max-content;
		.recomm-img{
			width: 222rpx;
			height: 222rpx;
			border-radius: 10rpx;
		}
		.max-recomm-img{
			width: 455rpx;
			height: 455rpx;
		}
	}
</style>
