<template>
	<view class="myRenewOk_main">
		<view class="myRenewOk_main-content">
			<image src="../../../static/bg3.png" mode=""></image>
			<view class="myRenewOk_main-text">
				更新成功~
				<view class="myRenewOk_main-img">
					<image src="../../../static/home-1.png" mode=""></image>
				</view>
			</view>
		</view>
		<view class="myRenewOk_main-time">
			{{countDown}}s 后返回
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				countDown: 10
			};
		},
		methods: {
			countDownFunc() {
				let count = this.countDown;
				if (count > 0) {
					this.timerId = setTimeout(() => {
						count--;
						this.countDown = count;
						this.countDownFunc();
					}, 1000);
				} else {
					// uni.navigateTo({
					// 	// url: `/pages/my/myRenew/myRenew?type=1`,
					// })
					uni.switchTab({
						url: "/pages/my/my"
					})
					// uni.navigateBack({
					//   delta: 1
					// });
					// console.log(22);
				}
			}
		},
		onLoad() {
			this.countDownFunc()
		},
		onUnload() {
			// 清除定时器
			if (this.timerId) {
				clearTimeout(this.timerId);
			}

		},
	}
</script>

<style lang="scss">
	.myRenewOk_main {
		width: 100%;
		box-sizing: border-box;
		padding: 40px 0px;
	}

	.myRenewOk_main-content {
		width: 100%;
		height: 530px;

		image {
			width: 100%;
			height: 100%;
			object-fit: cover;
		}

		.myRenewOk_main-text {
			position: fixed;
			top: 170px;
			height: 180px;
			width: 100%;
			display: flex;
			flex-direction: column;
			align-items: center;
			justify-content: space-between;
			color: #1677FF;
			font-weight: 700;
			font-size: 24px;

			.myRenewOk_main-img {
				width: 120px;
				height: 120px;

				image {
					width: 100%;
					height: 100%;
					object-fit: cover;
				}
			}
		}

		// 	width: 100%;
		// 	height: 520px;
		// 	background-color: #fff;
		// 	opacity: 0.7;
		// 	border: 1px solid #fff;
		// 	border-radius: 20px;
	}

	.myRenewOk_main-time {
		width: 100%;
		display: flex;
		align-items: center;
		justify-content: center;
		color: #57597C99;
		font-weight: 500;
		font-size: 14px;
	}
</style>