<template>
	<view class="container safe-area-inset-bottom">
		<MessageNotification />
		<!-- 搜索 -->
		<view class="search">
			<u-search placeholder="输入商品名称" bg-color="#F5f5f5" color="#999999" border-color="#F5f5f5"
				:show-action="false" maxlength="21" height="66" :clearabled="true" shape="round" v-model="keyword"
				@search="toSearch">
			</u-search>
		</view>

		<!-- 最近搜索 -->
		<view class="history">
			<view class="title">
				最近搜索
				<image src="/static/home/delect.png" mode=""></image>
			</view>
			<view class="none">
				<text>无搜索历史</text>
				<text class="btn" @click="toList">体温计</text>
			</view>
		</view>

		<!-- 热门搜索 -->
		<view class="history">
			<view class="title">
				热门搜索
			</view>
			<view class="none">
				<text class="btn">体温计</text>
				<text class="btn">奥司他韦</text>
				<text class="btn">蒙脱石散</text>
				<text class="btn">清热</text>
				<text class="btn">葡萄糖酸钙口服溶液</text>
			</view>
		</view>

	</view>
</template>

<script>
	export default {
		data() {
			return {
				keyword: "",
			}
		},
		onLoad() {

		},
		methods: {
			// 搜索
			toSearch() {
				// this.getList()
			},

			toList() {
				uni.navigateTo({
					url: '/subPackages/shop/search-list?id='
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.container {
		width: 750rpx;
		max-height: 100%;
		min-height: 100vh;
		padding-bottom: env(safe-area-inset-bottom);

		.search {
			width: 750rpx;
			height: 98rpx;
			margin: 0 auto;
			padding: 16rpx 30rpx;

			.u-search {
				width: 686rpx;
				height: 66rpx;
				margin: 0 auto;
			}
		}

		.history {
			width: 710rpx;
			margin: 36rpx auto;
			padding: 0 40rpx;

			.title {
				font-size: 28rpx;
				font-family: PingFang SC-Regular, PingFang SC;
				font-weight: 400;
				color: #232323;
				display: flex;
				justify-content: space-between;
				align-items: center;

				text {
					font-size: 24rpx;
					font-family: PingFang SC-Regular, PingFang SC;
					font-weight: 400;
					color: #999999;
				}

				image {
					width: 52rpx;
					height: 52rpx;
				}
			}

			.none {
				text {
					font-size: 24rpx;
					font-family: PingFang SC-Regular, PingFang SC;
					font-weight: 400;
					color: #666666;
					margin: 28rpx 20rpx 30rpx 0;
				}

				.btn {
					height: 44rpx;
					padding: 0rpx 28rpx;
					line-height: 44rpx;
					border-radius: 22rpx;
					text-align: center;
					background: #EEEEEE;
					display: inline-block;
				}
			}
		}
	}
</style>
