<template>
	<view class="container">
		<view class="search-box">
			<u-search
				v-model="searchForm.keyword"
				:clearabled="true"
				bg-color="#E5E5E5"
				:input-style="searchInputStyle"
				placeholder="请输入搜索内容"
			></u-search>
		</view>
		<view class="list-box">
			<view class="list-item-box">
				<view class="main-box">
					<view class="icon-box">
						图
					</view>
					<view class="content-box">
						<view class="title">
							XXXX通知
						</view>
						<view class="text">
							尊敬的用户，您在2025年01月10日09:00收到了一条通知
						</view>
					</view>
					<view class="other-box">
						<view class="date">
							8/16
						</view>
						<view class="tag">
							1
						</view>
					</view>
				</view>
				<view class="line-box"></view>
			</view>
		</view>
	</view>
</template>

<script setup>
	import { ref } from 'vue'
	import { onLoad } from '@dcloudio/uni-app'
	
	const searchInputStyle = {
		backgroundColor: '#E5E5E5'
	}
	const searchForm = ref({
		keyword: ''
	})
	
	onLoad(() => {
		uni.setTabBarBadge({ //显示数字  
			index: 1, //tabbar下标
			text: '999' //数字
		})
	})
</script>

<style lang="scss" scoped>
	.container {
		height: 100vh;
		width: 100vw;
		background-color: $uni-bg-color;
		padding: 0 20rpx;
		
		.search-box {
			margin-bottom: 20rpx;
			::v-deep(.u-search) {
				background-color: #e5e5e5;
				border-radius: 50rpx;
				
				.u-action {
					width: 18%;
					background-color: $uni-color-primary;
					border-radius: 50rpx;
					color: $uni-text-color-inverse;
					margin-right: 8rpx;
					font-size: 28rpx;
					line-height: 50rpx;
					letter-spacing: 3rpx;
					text-align: center;
				}
			}
		}
	
		.list-box {
			padding: 0 20rpx;
			.list-item-box {
				.main-box {
					display: flex;
					justify-content: space-between;
					align-items: center;
					padding: 20rpx 0;
					.icon-box {
						width: 15%;
						display: flex;
						justify-content: center;
						align-items: center;
					}
					.content-box {
						width: 67%;
						display: flex;
						flex-direction: column;
						justify-content: space-around;
						gap: 10rpx;
						.title {
							height: calc(70% - 5rpx);
							font-size: $uni-title-font-size-2;
							font-weight: bold;
						}
						.text {
							height: calc(30% - 5rpx);
							font-size: $uni-font-size-3;
							color: $uni-text-color-grey;
							@include text-overflow();
						}
					}
					.other-box {
						width: 18%;
						display: flex;
						flex-direction: column;
						justify-content: space-around;
						align-items: center;
						gap: 10rpx;
						.date {
							font-size: $uni-font-size-3;
							color: $uni-text-color-grey;
						}
						.tag {
							font-size: $uni-font-size-3;
							width: 42rpx;
							background-color: $uni-color-error;
							color: $uni-text-color-inverse;
							border-radius: 20rpx;
							text-align: center;
						}
					}
				}
				.line-box {
					height: 1rpx;
					width: 80%;
					background-color: #E5E5E5;
					margin: 0 auto;
				}
			}
		}
	}
		
	
</style>
