<template>
	<view class="enroll">
		<view v-if="!pageInfo.length" style="margin-top: 50%;">
			<u-empty text="暂无考试报名" mode="data"></u-empty>
		</view>
		<view v-else>
		<view class="boxls" v-for="(item, index) in pageInfo" :key="index">
			<view class="cne1">{{ item.examType }}</view>
			<view class="cne2">{{ item.examPeriod }}</view>
			<view class="cne3">报名时间：{{ $method.timestampToTime(item.signStartTime) + '~' + $method.timestampToTime(item.signEndTime) }}</view>
			<view class="cne4">
				<view class="ksNa">考试时间：</view>
				<view class="ksLis">
					<view v-for="(items, indexs) in item.examArrangementTimeVo" :key="indexs">
						{{ $method.timestampToTime(items.startTime) + '~' + $method.timestampToTime(items.endTime) }}
					</view>
				</view>
			</view>
			<view class="btnStys">
				<view class="leftsboxs" @click="jumpPages(item.examFromUrl)">官方通知</view>
				<view class="rightboxs" @click="jumpPages(item.examUrl)">我要报名</view>
			</view>
		</view>
		</view>
	</view>
</template>

<script>
export default {
	data() {
		return {
			pageInfo: []
		};
	},
	onLoad(option) {},
	onShow() {},
	mounted() {
		this.init();
	},
	methods: {
		init() {
			this.$api.arrangementlist().then(res => {
				if (res.data.code === 200) {
					this.pageInfo = res.data.rows;
				}
			});
		},
		jumpPages(url) {
			if (url !== null) {
				this.$navTo.togo('/pages2/index/webview', {
					urls: url
				});
			}else{
				uni.showToast({
					title: '暂未获取到网站',
					icon:'none'
				})
				return
			}
		}
	}
};
</script>

<style scope>
.boxls {
	padding: 12rpx;
	padding-left: 150rpx;
	margin: 32rpx 32rpx 0rpx;
	border-radius: 32rpx;
	box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(145, 156, 178, 0.1);
	background: url('https://file.xyyxt.net/oss/images/advertising/20210830/1630317031492_1012647606.png') no-repeat center center;
	background-size: 100% 100%;
}
.cne1 {
	margin-top: 73rpx;
	font-size: 30rpx;
	font-weight: bold;
	color: #198a8c;
}
.cne2 {
	margin-top: 19rpx;
	color: #131b31;
	font-weight: 500;
	font-size: 24rpx;
}
.cne3 {
	margin-top: 21rpx;
	color: #131b31;
	font-weight: bold;
	font-size: 24rpx;
}
.cne4 {
	margin-top: 21rpx;
	color: #131b31;
	font-weight: bold;
	font-size: 24rpx;
	display: flex;
}
.ksNa {
}
.btnStys {
	margin-top: 28rpx;
	display: flex;
	align-items: center;
	margin-bottom: 16rpx;
}
.leftsboxs {
	margin-right: 62rpx;
	border-radius: 16rpx;
	background: #f0c171;
	box-shadow: 0rpx 5rpx 5rpx 0rpx rgba(74, 84, 89, 0.2);
	height: 48rpx;
	line-height: 48rpx;
	text-align: center;
	width: 144rpx;
	color: #fff;
	font-size: 24rpx;
	font-weight: 500;
}
.rightboxs {
	border-radius: 16rpx;
	background: #7dc8c9;
	box-shadow: 0rpx 5rpx 5rpx 0rpx rgba(74, 84, 89, 0.2);
	height: 48rpx;
	line-height: 48rpx;
	text-align: center;
	width: 144rpx;
	color: #fff;
	font-size: 24rpx;
	font-weight: 500;
}
page {
	background: #ffffff;
}
</style>
