<template>
	<view>
		<view class="top">
			<uni-search-bar class="search" radius="5" placeholder="请输入方案名称" clearButton="auto" cancelButton="none" @confirm="search" />
			<uni-icons class="icon" custom-prefix="iconfont" type="icon-filter" size="18" color="#007eff"></uni-icons>
		</view>
		
		<ul class="tab">
			<li v-for="(tab, i) in tabs" :class="{active: curTab === tab.id}" @click="tabChange(tab)">{{ tab.name }}</li>
		</ul>
		
			<ul class="list">
				<li>
					<view class="name">金融科技实验方案</view>
					<view class="block">
						<view class="info">
							<view class="line">
								<view class="label">产品</view>
								<view class="val">程序设计、量化投资</view>
							</view>
							<view class="line">
								<view class="label">更新日期</view>
								<view class="val">201212</view>
							</view>
							<view class="line">
								<view class="label">适用专业</view>
								<view class="val">金融、大数据</view>
							</view>
						</view>
						<view class="detail" @click="toDetail">详情</view>
					</view>
				</li>
			</ul>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				curTab: 0,
				tabs: [
					{
						name: '不限',
						id: 0
					},
					{
						name: '金融科技',
						id: 1
					},
					{
						name: '大数据实验室',
						id: 2
					}
				]
			}
		},
		methods: {
			search(res) {
				uni.showToast({
					title: '搜索：' + res.value,
					icon: 'none'
				})
			},
			// tab切换
			tabChange(tab) {
				this.curTab = tab.id
			},
			// 跳转详情
			toDetail() {
				this.$util.to('../detail/detail')
			}
		}
	}
</script>

<style scoped lang="scss">
.top {
	display: flex;
	align-items: center;
	padding: 5px 15px 5px 5px;
	margin-bottom: 10px;
	background-color: #fff;
	.search {
		flex: 1;
	}
}
.list {
	background-color: #fff;
	li {
		padding: 20px;
		border-bottom: 2px solid #f8f8f8;
	}
	.name {
		font-size: 14px;
		color: #333;
	}
	.line {
		display: flex;
		margin-bottom: 10px;
	}
	.block {
		display: flex;
		justify-content: space-between;
		align-items: center;
		margin-top: 10px;
	}
	.info {
		margin: 5px 0;
	}
	.label {
		width: 70px;
		font-size: 12px;
		color: #898989;
	}
	.val {
		font-size: 12px;
		color: #898989;
	}
	.detail {
		font-size: 13px;
		color: #1f83ff;
	}
}
</style>
