<template>
	<view class="flex flex-direction align-center">
		<view class="flex flex-direction align-center margin-bottom-xl">
			<image :src="successImg" mode="" class="i-success"></image>
			<text class="success-txt">恭喜您，{{ txt }}成功～</text>
		</view>
		<button class="main-end-button-kong" style="width: 240rpx;" @tap="tapEndPackSure">确定</button>
	</view>
</template>

<script>
	import i_success from '../static/img/hcdb/i-success.png'
	export default {
		name: 'q-success',
		data() {
			return {
				successImg: i_success
			};
		},
		props: {
			txt: {
				type: String,
				default () {
					return '';
				}
			},
			url: {
				type: String,
				default: ''
			}
		},
		methods: {
			tapEndPackSure() {
				uni.redirectTo({
					url: this.url || '/pages/home/homeIndex'
				});
			}
		}
	};
</script>

<style lang="less" scoped>
	.i-success {
		width: 300rpx;
		height: 300rpx;
	}

	.success-txt {
		color: #34c46e;
	}
</style>