<template>
	<view class="container">
		<view class="re-succ-box">
			<image class="re-succ-img" src="../../static/img/success.png"></image>
			<view class="re-succ-tit">{{type ==2? '挂售成功' : '提交成功'}}</view>
			<view class="btn-box flex">
				<view class="re-succ-btn" @click="goBack()">返回首页</view>
				<view class="go-btn " @click="go()">{{ type == 2? '返回挂售' : '返回支付'}}</view>
			</view>
		</view>
	</view>
</template>

<script>
export default {
	data() {
		return{
			type:1,
		}
	},
	onLoad(option) {
		if(option.type) {
			this.type = option.type
		}
	},
	methods: {
		goBack() {
			uni.switchTab({
				url: '/pages/index/index'
			})
		},
		go() {
			let url
			if(this.type == 1){
				url = '/pages/order/order?state=1'
				uni.navigateTo({
					url: url
				})
			}else if(this.type == 2) {
				url = '/pages/order/order?state=3'
				uni.switchTab({
					url
				})
			}
			
		}
	}
}
</script>

<style lang="scss">
page {
	height: 100%;
}
.container {
	height: 100%;
	background: #FFFFFF;
	.line-top {
		width: 750rpx;
		height: 20rpx;
		background: #F5F5F5;
	}
	.re-succ-box {
		padding-top: 170rpx;
		display: flex;
		flex-direction: column;
		align-items: center;
		.re-succ-img {
			margin-left: -30rpx;
			width: 362rpx;
			height: 267rpx;
			display: block;
		}
		.re-succ-tit {
			margin-top: -26rpx;
			font-size: 40rpx;
			font-family: PingFang SC;
			font-weight: 500;
			color: #333333;
		}
		.btn-box{
			width: 750rpx;
			margin-top: 80rpx;
			padding: 0 50rpx;
		}
		.re-succ-btn {
			width: 300rpx;
			height: 80rpx;
			background: linear-gradient(180deg, #FD4646, #FF3535);
			border-radius: 40rpx;
			font-size: 36rpx;
			font-family: PingFang SC;
			font-weight: bold;
			color: #FFFFFF;
			display: flex;
			align-items: center;
			justify-content: center;
		}
		.go-btn {
			width: 300rpx;
			height: 80rpx;
			border: 1px solid #FD4646;
			border-radius: 40rpx;
			font-size: 36rpx;
			font-family: PingFang SC;
			font-weight: bold;
			color: #FD4646;
			display: flex;
			align-items: center;
			justify-content: center;
		}
	}
}
</style>
