<template>
	<view class="active-list">
		<!-- 活动查询 -->
		<view class="active-list-search">
			<!-- 搜索框 -->
			<view class="search">
				<u-input placeholder="输入活动名称或参赛项目" border='none'>
					<template slot="suffix" style='margin-right:40rpx;'>
						<u-image :showLoading="true" :showError='true' src="/static/icon/search.png" width="40rpx"
							height="32rpx"></u-image>
					</template>
				</u-input>
			</view>
			<view class="tab_nav">
				<view class="navTitle" v-for="(item,index) in items" :key="index">
					<view :class="{'active':isActive === index}" @click="checked(index)">
						{{item.title}}
					</view>
				</view>
			</view>
		</view>

		<view class="List" v-if="isActive==0">
			<view class="ListItem" v-for="item in 2" @click="activeDetail">
				<image src="/static/icon/Kudosbg.png" style="width: 640rpx;height:420rpx;"></image>
				<view class="kudosicon">
					<image src="/static/icon/Kudos.png" v-if="false"></image>
					<image src="/static/icon/Kudos(1).png"></image>
				</view>
				<view class="nav">
					<view class="events">
						<text>IHG最受欢迎的酒店</text>
					</view>
					<view class="voteStatus">
						<text v-if="false">未开始</text>
						<text style="color:#FF6503 ;">投票中</text>
					</view>
				</view>
				<view class="foot">
					<image src="/static/icon/data.png"></image>
					<text>2021-12-20 18:00 结束</text>
				</view>
			</view>
		</view>

		<uni-load-more :status="status" color="#CCCCCC" :content-text="contentText" />
	</view>
</template>

<script>
	export default {
		data() {
			return {
				//分段器
				items: [{
						title: '热门活动'
					},
					{
						title: '西区活动'
					}, {
						title: '酒店评选'
					},
					{
						title: '旅游推选'
					}
				],
				//激活指定table菜单
				isActive: 0,
				status: 'noMore',
				contentText: {
					contentdown: '查看更多',
					contentrefresh: '加载中',
					contentnomore: '——  已经到底啦  ——'
				},
			}
		},
		methods: {
			//菜单index切换
			checked(index) {
				this.isActive = index
			},
			// 活动详情页
			activeDetail(){
				uni.navigateTo({
					url:'/pages/index/active-detail/index'
				})
			},
		}
	}
</script>

<style lang="scss" scoped>
	$pageColor:#F9F9F9;
	$bgColor:#FFFFFF;

	@mixin flexlayout {
		display: flex;
		align-items: center;
		justify-content: center;
	}

	.active-list {
		height: 100%;
		background: #F9F9F9;
	}

	.active-list-search {
		padding: 24rpx 30rpx 32rpx;
		height: 222rpx;
		background-color: #FFFFFF;

		// 搜索
		.search {

			::v-deep .u-input {
				width: 690rpx !important;
				height: 68rpx !important;
				background: #F1F1F1;
				border-radius: 74rpx;
			}

			::v-deep .u-input__content__field-wrapper {
				padding-left: 36rpx;
			}
		}

		//菜单切换
		.tab_nav {
			width: 100%;
			margin-top: 36rpx;
			display: flex;
			justify-content: space-between;
			align-items: center;
			font-family: PingFang-SC-Heavy, PingFang-SC;
			
		}

		.tab_nav .navTitle {
			width: 128rpx;
			flex: none;
			height: 28rpx;
			font-size: 32rpx;
			color: #666;
			position: relative;
		}
		.active {
			color: #D9A94D;
			font-weight: bold;
			&::after {
				display: inline-block;
				content: '';
				width: 48rpx;
				height: 12rpx;
				background: linear-gradient(90deg, #F3D69F 0%, #D9A94D 100%);
				border-radius: 6px;
				position: absolute;
				bottom:-40rpx;
				left:40rpx;
			}
		}

	}

	.List {
		padding: 0 30rpx;
		box-sizing: border-box;
		padding-top: 20rpx;
		padding-bottom:24rpx ;

		.ListItem {
			position: relative;
			margin-bottom: 24rpx;
			width: 100%;
			height: 562rpx;
			background: $bgColor;
			box-shadow: 0rpx 12rpx 40rpx 0rpx rgba(220, 222, 229, 0.4);
			border-radius: 24rpx;
			padding: 20rpx 26rpx 26rpx 24rpx;
			.kudosicon {
				width: 48rpx;
				height: 48rpx;
				position: absolute;
				top: 52rpx;
				right: 58rpx;
				border-radius: 50%;
				background: #FFFFFF;
				opacity: 0.84;
				@include flexlayout() image {
					width: 32rpx;
					height: 28rpx;
				}
			}

			.nav {
				display: flex;
				align-items: center;
				justify-content: space-between;

				.events {
					text {
						font-size: 30rpx;
						font-family: PingFang-SC-Bold, PingFang-SC;
						font-weight: bold;
						color: #333333;
					}
				}

				.voteStatus {
					font-size: 30rpx;
					font-family: PingFang-SC-Medium, PingFang-SC;
					font-weight: 500;
					color: #999999;
				}
			}

			.foot {
				margin-top: 10rpx;
				display: flex;
				align-items: center;

				image {
					width: 28rpx;
					height: 28rpx;
					margin-right: 8rpx;
				}

				text {
					font-size: 24rpx;
					font-family: PingFang-SC-Medium, PingFang-SC;
					font-weight: 500;
					color: #999999;
					display: block;
				}
			}

		}
	}
</style>
