<template>
	<view>
		<navBar leftText="详情"></navBar>
		<image class="topBg absolute" src="/static/image/mine/myTopBg.png" mode="widthFix"></image>
		<view class="categoryC fixed" :style="'top:'+navH+'px;'">
			<view :class="'item relative '+(selectCategory==index?'select':'')" v-for="(item,index) in categoryList" :key="index" @click="clickCategoryItem(index)">
				{{item}}
				<view v-if="selectCategory==index" class="line absolute"></view>
			</view>
		</view>
		<view class="contentC fixed" :style="'top:'+contentTop+'px;'">
			<view v-if="selectCategory==3" class="stockC">
				<view class="stockCategoryList flexWrap">
					<view class="item flexColumnCenter" :style="'background-color:'+item.bgColor+';color:'+item.color+';'" v-for="(item,index) in stockCategoryList" :key="index">
						<view class="num">23</view>
						<view class="title">{{item.title}}</view>
					</view>
				</view>
				<view class="stockList">
					<view class="item">
						<view class="titleCorrelationC flex">
							<view class="title flex1">000065.SZ 北方国际</view>
							<view class="correlation">相关度: 98%</view>
						</view>
						<view class="category">石油石化</view>
						<view class="content">
							海外订单占比70%-80%，在俄语区矿产资源开发（蒙古矿山）、电力运营经验丰富，是乌克兰重建核心受益标的。公司在俄语区的深厚积累使其直接获益于区域经济复苏和能源合作深化。
						</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import { inject } from 'vue';
	import { investEventDetails } from '../../../request/api';

	export default {
		data() {
			return {
				navH:inject('navHeight'),
				eventId:'',		//事件id
				contentTop:'',
				categoryList:['背景','推演','实际','相关股票','相关概念'],
				selectCategory:0,
				stockCategoryList:[
					{
						title:'全部股票',
						bgColor:'#C00000',
						color:'white'
					},
					{
						title:'大周期',
						bgColor:'#305496',
						color:'white'
					},
					{
						title:'TMT板块',
						bgColor:'#FFBF00',
						color:'white',
					},
					{
						title:'大金融地产',
						bgColor:'#FFF4D3',
					},
					{
						title:'大消费',
						bgColor:'#CDEEEE',
					},
					{
						title:'公共产业板块',
						bgColor:'#DEEBF7'
					}]
			}
		},
		onLoad() {
			this.contentTop = this.navH+(30+74)/750*inject('windowWidth')
		},	
		methods: {
			/**
			 * 点击切换栏目
			 */
			clickCategoryItem(index)
			{
				if(this.selectCategory!=index)	
				{
					this.selectCategory = index
				}
			},
			/**
			 * 获取事件详情数据
			 */
			getEventDetailsData()
			{
				investEventDetails(this.eventId).then(res=>{
					
				}).catch(error=>{
					
				})
			}
		}
	}
</script>

<style lang="less">
.topBg
{
	top: 0;
	left: 0;
	width: 100%;
	height: auto;
}
.categoryC
{
	background-color: white;
	margin-top: 10rpx;
	padding-top: 20rpx;
	left: 0;
	right: 0;
	border-radius: 20rpx 20rpx 0 0;
	.item 
	{
		display: inline-block;
		padding: 0 30rpx;
		line-height: 75rpx;
		font-size: 32rpx;
		font-weight: 500;
		color: #42485B;
	}
	.item.select 
	{
		font-weight: bold;
		color: #F97316;
		.line 
		{
			background-color: #F97316;
			left: calc((100% - 50rpx)/2);
			bottom: 0;
			width: 50rpx;
			height: 2rpx;
		}
	}
}
.contentC 
{
	background-color: white;
	left: 0;
	right: 0;
	bottom: 0;
	overflow-y: scroll;
	.stockCategoryList
	{
		margin-top: 18rpx;
		padding: 0 24rpx;
		.item 
		{
			margin: 0 20rpx 20rpx 0;
			width: calc((100% - 40rpx)/3);
			height: 100rpx;
			border-radius: 10rpx;
			.num 
			{
				font-size: 36rpx;
				font-weight: bold;
			}
			.title 
			{
				font-size: 24rpx;
				font-weight: 500;
			}
		}
		.item:nth-child(3n)
		{
			margin-right: 0;
		}
	}
	.stockList 
	{
		padding: 22rpx 25rpx 30rpx;
		border-bottom: solid 1rpx #E4E4E4;
		.item 
		{
			.title
			{
				font-size: 30rpx;
				font-weight: bold;
				color: #222;
			}
			.correlation
			{
				background-color: #F973161A;
				padding: 0 13rpx;
				line-height: 40rpx;
				border-radius: 5rpx;
				font-size: 24rpx;
				font-weight: 500;
				color: #F97316;
			}
			.category 
			{
				display: inline-block;
				padding: 0 10rpx;
				line-height: 28rpx;
				border: solid 1rpx #F6604A;
				font-size: 20rpx;
				font-weight: 500;
				color: #F6604A;
				border-radius: 5rpx;
			}
			.content 
			{
				margin-top: 18rpx;
				font-size: 24rpx;
				font-weight: 500;
				color: #666;
				line-height: 1.2rem;
			}
		}
	}
}
</style>
