<template>
	<view class="content">
		<view class="box">
			<image class="img" src="../../../static/image/success.png" mode="widthFix"></image>
			<text class="tit">支付成功</text>
			<view class="tip" >
				<text v-if="type==0">
				请前往母婴界严选加盟商一领取
				</text>
			</view>
			<view class="btn-group flex">
				<navigator v-if="type==0" :url="'/pages/order/orderDetail?id='+orderId" open-type="redirect"
					class="mix-btn hollow">查看订单</navigator>
				<view v-if="type==1" class="mix-btn hollow" @click="navBack">返回</view>
				<navigator url="/pages/index/index" open-type="switchTab" class="mix-btn ">返回首页</navigator>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				orderId: '',
				type: 0 //0为订单1为充值
			}
		},
		onLoad(opt) {
			// 保存订单号
			if (opt.orderid) {
				this.orderId = opt.orderid;
			}
			// 分类
			if (opt.type) {
				this.type = opt.type;
			}
		},
		methods: {
			// 返回上一页
			navBack() {
				uni.navigateBack()
			}
		}
	}
</script>

<style lang='scss'>
	.content {
		padding-top: 30rpx;
	}

	.box {
		margin: 0 $page-row-spacing;
		display: flex;
		flex-direction: column;
		justify-content: center;
		align-items: center;
		background-color: #FFFFFF;
		border-radius: 20rpx;
		padding: 50rpx;
		padding-top: 80rpx;
	}

	.tip {
		color: $font-color-disabled;
		font-size: 24rpx;
		margin-top: 30rpx;
		padding-bottom: 30rpx;
	}

	.img {
		width: 200rpx;

	}

	.tit {
		font-size: 38rpx;
		font-weight: bold;
		color: #303133;
		margin-top: 30rpx;
	}

	.btn-group {
		padding-top: 100rpx;
		width: 100%;
		justify-content: space-around;
		padding: 0 10rpx;
	}

	.mix-btn {
		margin-top: 30upx;
		display: flex;
		align-items: center;
		font-size: $font-lg;
		color: #fff;
		background-color: $base-color;
		padding: 20rpx 50rpx;
		border-radius: 100rpx;
		line-height: 1;

		&.hollow {
			background: #fff;
			color: #303133;
			border: 1px solid #ccc;
		}
	}
</style>
