<template>
	<view v-if="show">
		<view class="top">
			<image :src="limitState == 0? image[0] : image[1]" mode="widthFix" style="width: 450rpx;"></image>
			<text class="text">{{ limitState == 1? '抱歉 报名失败' : '恭喜 获取报名资格' }}</text>
		</view>
		<view class="submit_container">
			<view
				@click="topayNext"
				class="sign_up flexC"
			>
				下一步
			</view>
		</view>
	</view>
</template>
<script>
	import { _API_HuiFuCheck } from '../../apis/szy.js';
	export default {
		data() {
			return {
				image: [
					require('../../static/icon/szySuc.png'),
					require('../../static/icon/szyErr.png')
				],
				show: true,
				limitState: 0, //是否为不报名，0报名，1排队
				season: '',
				id: ''
			}
		},
		methods: {
			// 查询报名信息
			topayNext() {
				uni.showLoading()
				_API_HuiFuCheck().then(res => {
					uni.hideLoading()
					if (res.code == 200) {
						uni.navigateTo({
							url: './bankPay?id=' + res.data.id
						})
					} else if (res.code == 50014) {
						uni.showModal({
							title: '提示',
							content: '检测到您还未绑定银行卡，请前往绑定',
							showCancel: false,
							success: (res) => {
								if (res.confirm) {
									uni.navigateTo({
										url: '../zbs/form?type=2'
									})
								}
							}
						})
						return
					} else {
						uni.showModal({
							content: res.message || '获取失败',
							showCancel: false
						});
						return false;
					}
				})
			},
		}
	}
</script>
<style>
	page {
		background-color: #fff !important;
	}
</style>
<style lang="scss" scoped>
	.top {
		display: flex;
		flex-direction: column;
		align-items: center;
		background-color: #fff;
		border-radius: 24rpx 24rpx 0px 0px;
		margin-top: -54rpx;
		padding-top: 30%;
		.text {
			font-size: 52rpx;
			font-weight: bold;
			color: #333;
			margin: 20rpx 0 0 0;
		}
	}
	.submit_container {
		width: 100%;
		position: fixed;
		left: 0;
		bottom: 0;
		z-index: 9999;
		height: 118rpx;
		display: flex;
		align-items: center;
		background-color: #fff;
		border-top: 2rpx solid #EEEEEE;
		.sign_up {
			width: 690rpx;
			height: 90rpx;
			margin: 0 auto;
			background: linear-gradient(93deg, #FF232C 0%, #FF571B 100%);
			font-size: 36rpx;
			border-radius: 45rpx;
			color: #ffffff;
		}
	}
</style>
