<template>
	<view class="content" :class="[AppTheme]">
		<view class="success">
			<u-icon name="checkmark-circle-fill" :color="primary" size="45"></u-icon>
			<text class="tit">支付成功</text>
		</view>
		<view class="btn-group">
			<view @click="goorder(1)">
				<view class="mix-btn bg-linear-gradient">
					查看订单
				</view>
			</view>
			<view @click="goorder(2)">
				<view class="mix-btn hollow">
					返回首页
				</view>
			</view>
		</view>
	</view>
</template>
<script>
	export default {
		data() {
			return {
				primary: this.$theme.primary,
				channel: 0,
				gourl: '/pages/index/index'
			}
		},
		methods: {
			goorder(type) {
				if (type == 1) {
					uni.navigateTo({
						url: this.gourl
					});
				} else {
					uni.switchTab({
						url: '/pages/index/index'
					});
				}
			}
		},
		onLoad(options) {
			this.channel = options.channel ? options.channel : 0
			console.log('channel', this.channel)
			//1:（商品，砍价 ，拼团），2：认养，,3:充值,4：租地，5：活动
			if (this.channel == 1) {
				this.gourl = '/pagesD/pages/order/order?state=0';
			} else if (this.channel == 2) {
				this.gourl = '/pagesA/pages/subrecord/subrecord';
			} else if (this.channel == 3) {
				this.gourl = '/pagesA/pages/mypurse/mypurse';

			} else if (this.channel == 4) {
				this.gourl = '/pagesB/pages/myland/myland';

			} else if (this.channel == 5) {
				this.gourl = '/pagesB/pages/activitylist/myactivity/myactivity';
			}
		},
	}
</script>

<style lang='scss'>
	.content {
		display: flex;
		flex-direction: column;
		justify-content: center;
		align-items: center;
	}

	.success-icon {
		font-size: 160upx;
		color: limegreen;
		margin-top: 100upx;
	}

	.success {
		display: flex;
		justify-content: center;
		align-items: center;
		padding-top: 100upx;

		.tit {
			font-size: 38upx;
			color: #303133;
		}
	}


	.btn-group {
		padding-top: 100upx;
	}

	.mix-btn {
		margin-top: 30upx;
		display: flex;
		align-items: center;
		justify-content: center;
		width: 600upx;
		height: 80upx;
		font-size: $font-lg;
		color: #fff;
		border-radius: 10upx;

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