<template>
	<view class="bg bg-padding">
		<image :src="headImg" class="topImg" mode="aspectFill"></image>

		<view v-for="(item,index) in list" :key="index" class="item" @click="gotoPath(item.ext_link)">
			<image :src="item.head_img" class="img"></image>
			<view class="content flex-center">
				<view class="title text-overflow">{{item.title}}</view>
				<view class="btn">点击领取</view>
			</view>
		</view>
		
		<CustomTabBar :currentTab="1" />
	</view>
</template>

<script>
	import CustomTabBar from '@/components/CustomTabBar.vue';
	export default {
		components: {
			CustomTabBar
		},
		data() {
			return {
				headImg: '',
				list: []
			}
		},
		mounted() {
			// 头图
			this.getHeadImg(2370).then(res => {this.headImg = res})
			this.getList()
		},
		methods: {
			getList() {
				this.Post({
					limit: 100,
					page: 1,
					class_id: 146,
					type: 2,
				}, '/api/multimedia/media_list').then(res => {
					if (res) {
						this.list = res.data.data
					}
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.bg {
		min-height: 100vh;
		background: rgba(237, 245, 220, 1);
	}

	.topImg {
		width: 100%;
		height: 386.67rpx;
	}

	.item {
		width: 697rpx;
		height: 417rpx;
		background: #FFFFFF;
		border-radius: 13rpx;
		margin: 32rpx auto 0;

		.img {
			width: 697rpx;
			height: 300rpx;
			border-radius: 13rpx 13rpx 0rpx 0rpx;
			display: block;
		}

		.content {
			height: 117rpx;

			.title {
				width: 500rpx;
				font-weight: bold;
				font-size: 31rpx;
				color: #111111;
			}

			.btn {
				width: 135rpx;
				line-height: 47rpx;
				background: linear-gradient(90deg, #00DB1F, #0A831C);
				border-radius: 8rpx;
				text-align: center;
				font-weight: bold;
				font-size: 24rpx;
				color: #FFFFFF;
			}
		}
	}
</style>