<template>
	<view class="">
		<navbar :config="config" backColor="#999999"></navbar>
		<view class="success-content">
			<image class="success-img" src="./static/submit-success.png" mode="aspectFit"></image>
			<view class="success-hint">
				任务提交完成，审核员正在火速赶来的路上~
			</view>
			<view class="continue-btn" @click.stop="onContinue()">
				继续完成其他任务
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				config: {
					back: true,
					title: '提交完成',
					color: 'black',
					backgroundColor: [1, '#fff'],
					statusBarFontColor: 'black'
				},
			}
		},
		methods: {
			onContinue() {
				try {
					const pages = getCurrentPages();
					const route = pages[pages.length - 3].route;
					console.log('route = ', route)
					if (route && ['pages/task/my-task', 'pages/task/task-details', 'pages/task/task-audit'].includes(
							route)) {
						const $vm_ = pages[pages.length - 3].$vm
						$vm_.init();
						uni.navigateBack({
							delta: 2
						});
						return false
					}
				} catch (err) {
					console.log('err  === ', err)
				}
				// uni.redirectTo({
				// 	url: '/pages/task/my-task'
				// })
			}
		}
	}
</script>

<style lang="scss" scoped>
	.success-content {
		padding: 262rpx 30rpx 0;
		display: flex;
		flex-direction: column;
		align-items: center;

		.success-img {
			width: 526rpx;
			height: 267rpx;
		}

		.success-hint {
			padding: 50rpx 0 40rpx;
			font-size: 28rpx;
			// font-family: .PingFang SC, .PingFang SC-Light;
			font-weight: Light;
			color: #1a1a1a;
		}

		.continue-btn {
			width: 690rpx;
			height: 80rpx;
			background: linear-gradient(92deg, #3cb7d2 2%, #44c5d5 98%);
			border-radius: 40rpx;
			font-size: 32rpx;
			font-family: PingFang SC, PingFang SC-Regular;
			font-weight: Regular;
			text-align: center;
			color: #ffffff;
			line-height: 80rpx;
		}
	}
</style>