<template>
	<view class="news-recommend">
		<view v-if="recommendType === 'home'" class="news-tab">
			<u-tabs :active.sync="tabActive" :tabs="tabs" tab-style="default" @change="tabChange"/>
		</view>
		<view class="news-list">
			<template v-for="(item, index) in newsList">
					<news-item :item="item" :key="index" />
			</template>
		</view>
	</view>
</template>

<script>
	import UTabs from '@/components/common/u-tabs'
	import NewsItem from '@/pages/news/components/news-item.vue'
	
	export default {
		components: {
			UTabs,
			NewsItem
		},
		props: {
			recommendType: {
				type: String,
				default: 'home'
			}
		},
		data() {
			return {
				tabActive: '1',
				tabs: [{
					label: '展会新闻',
					value: 1
				}, {
					label: '展商新闻',
					value: 2
				}],
				newsList: [{}, {}, {}]
			}
		},
		created() {
		},
		methods: {
			tabChange() {
				
			},
			onClickDetail(item) {
				this.navigateTo('https://www.productronicachina.com.cn/2025%E6%85%95%E5%B0%BC%E9%BB%91%E4%B8%8A%E6%B5%B7%E7%94%B5%E5%AD%90%E7%94%9F%E4%BA%A7%E8%AE%BE%E5%A4%87%E5%B1%953%E6%9C%88%E5%A5%8F%E5%93%8D%E6%96%B0%E7%AF%87%E7%AB%A0-%E6%8E%A2%E7%B4%A2%E7%94%B5%E5%AD%90%E5%88%B6%E9%80%A0%E7%9A%84%E6%97%A0%E9%99%90%E5%8F%AF%E8%83%BD')
			}
		}
	}
</script>
<style lang="scss" scoped>
	.news-list{
		display: grid;
		grid-template-columns: 1fr;
		grid-row-gap: 18rpx;
		margin-top: 28rpx;
	}
</style>