<template>
	<view>
		<statusBar :item="navBarData"></statusBar>

		<!-- <view class="activeBox" v-for="i in 5" :key="i"> -->
		<view class="activeBox" v-for="(item,index) in classList" :key="index">

			<view class="teaching_case">
				<view class="img">
					<!-- <image src="http://43.139.158.220:5007/img/static/mine/Rectangle 23.png" mode="aspectFill"></image> -->
					<image :src="classList[index].url" mode="aspectFill"></image>
				</view>

				<view class="right" @click="gotoAnnoun(index)">
					<view class="title">
						<view class="tag">类型</view>
						<text>{{ item.className }}</text>
					</view>

					<!-- <view class="introduce">
						{{ item.th_name }}
					</view> -->
					
					<text class="introduce">{{ item.intro }}</text>

					<view class="operate">
						<view class="left">
							<view class="leftCollect">
								<view class="icon">
									<image src="http://43.139.158.220:5007/img/static/mine/Collect_yellow.png"
										mode="aspectFill"></image>
								</view>
								<view class="text">
									<span>收藏</span>
								</view>
							</view>
							<view class="leftSubscribe">
								<view class="icon">
									<image src="http://43.139.158.220:5007/img/static/mine/Subscribe_gray.png"
										mode="aspectFill"></image>
								</view>
								<view class="text">
									<span>订阅</span>
								</view>
							</view>
						</view>
						<view class="btnGoto">
							<view class="text">查看详情</view>
							<view class="arrow">
								<image src="http://43.139.158.220:5007/img/static/mine/arrow-right-blue.png"
									mode="aspectFill"></image>
							</view>
						</view>
					</view>
				</view>
			</view>
		</view>
		<view class="" style="padding-bottom: 50rpx;">
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				navBarData: {
					title: '专题教研活动列表',
					btn: 1
				},
				classList: [{
						url: "http://43.139.158.220:5007/img/static/img/ydjk.png",
						className: "运动与健康",
						intro:"《运动与健康》全面地阐述体育运动与健康的关系、如何向体育运动要健康、不同运动项目的健康机制、运动损伤的预防与处理等基本内容。"
					},
					{
						url: "http://43.139.158.220:5007/img/static/img/shyy.png",
						className: "生活英语听说",
						intro: " 你想在生活中使用英语和来自中外的朋友们交流吗？这门课中，我们邀请了50多位美国、英国、爱尔兰、加拿大、澳大利亚、哥伦比亚的朋友聊生活常见话题，带你领略一次不一样的英语学习之旅吧。Let’s go！"
					},
					{
						url: "http://43.139.158.220:5007/img/static/img/yyll.jpg",
						className: "科研伦理与学术规范",
						intro:" 所有研究生必须培养其科研与学术的“底线意识”，即遵守科研伦理与学术规范。本课程有助于学生规避学术风险，提高科研规范性，为严谨扎实从事科研工作打好基础。"
					},
					{
						url: "http://43.139.158.220:5007/img/static/img/kylw.png",
						className: "如何写好科研论文",
						intro: " 你在为发表论文发愁吗？你了解准备一篇科研论文需要哪些步骤吗？本课程将为你讲述论文写作的原理，步骤及技巧，帮助你更有效的写作和发表学术论文。"
					},
				],
			};
		},
		methods:{
			gotoAnnoun(index) {
				const value = uni.getStorageSync("login");
				if (value == 0) {
					uni.navigateTo({
						url: "/pages/login/login",
					});
				} else {
					const urls = [
						"https://www.xuetangx.com/course/HUBU10011000132/16906642?channel=i.area.course_list_all",
						"https://www.xuetangx.com/course/THU05021000376?channel=i.area.course_list_all",
						"https://www.xuetangx.com/course/BNU03031000037/16905009?channel=i.area.course_list_all",
						"https://www.xuetangx.com/course/THU04011000365/16906220?channel=i.area.course_list_all",
					];
					if (index >= 0 && index < urls.length) {
						const url = urls[index];
						uni.navigateTo({
							url: "/pages/skipone/skipone?url=" + encodeURIComponent(url),
						});
					}
				}
			},
		},
		
	}
</script>

<style lang="scss">
	.activeBox {
		width: 100%;
		background-color: #fff;
		padding: 10px 0;

		.teaching_case {
			display: flex;
			justify-content: space-between;
			padding: 0 15px;

			.img {
				width: 180rpx;
				height: 180rpx;

				image {
					width: 100%;
					height: 100%;
					border-radius: 10rpx;
				}
			}

			.right {
				padding-left: 15px;
				flex: 1;
				width: 100rpx;
				display: flex;
				flex-direction: column;
				align-content: flex-end;

				.title {
					display: flex;
					align-items: center;
					margin-bottom: 5px;

					.tag {
						border: 1px #00b2b6 solid;
						font-size: 20rpx;
						width: 64rpx;
						display: flex;
						height: 32rpx;
						white-space: nowrap;
						justify-content: center;
						align-items: center;
						// padding: 4px 12px 4px 12px;
						border-radius: 5rpx;
						margin-right: 10rpx;
						color: #00b2b6;
					}

					text {
						width: 180px;
						overflow: hidden;
						text-overflow: ellipsis;
						white-space: nowrap;
					}

				}

				.introduce {
					width: 230px;
					font-size: 28rpx;
					color: #a7a7a7;
					margin-top: 8px;
					overflow: hidden;
					text-overflow: ellipsis;
					white-space: nowrap;
				}
				
				

				.operate {
					display: flex;
					justify-content: space-between;
					align-items: flex-end;
					margin-top: 15px;

					.left {
						display: flex;
						flex-direction: row;
						// justify-content: space-between;
						width: 260rpx;
						color: #00000099;
						font-size: 24rpx;

						.leftCollect {
							display: flex;
							align-items: flex-end;
							margin-right: 15px;

							.text {
								display: flex;
								margin-left: 5px;
							}

							.icon {
								display: flex;

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

						.leftSubscribe {
							display: flex;
							align-items: flex-end;

							// margin-left: 15px;
							.text {
								display: flex;
								margin-left: 5px;
							}

							.icon {
								display: flex;

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

					.btnGoto {
						width: 80px;
						// height: 24px;
						display: flex;
						flex-direction: row;
						justify-content: flex-start;
						align-items: center;
						align-items: flex-end;

						.text {
							font-size: 24rpx;
							color: #3081E8;
						}

						.arrow {
							line-height: 10px;

							image {
								width: 32rpx;
								height: 32rpx;
							}
						}
					}
				}
			}
		}
	}
</style>