<template>
	<view class="pages">
		<view class="icon-wrap u-flex u-row-center" v-if="success=='true'">
			<u-icon name="checkmark" color="#fff" size="80"></u-icon>
		</view>
		<view class="icon-wrap u-flex u-row-center" v-else style="background-color: #FFB100;">
			<u-icon name="close" color="#fff" size="80"></u-icon>
		</view>
		<view class="title">{{title}}</view>
		<view class="full-btn" v-if="success=='true'" @click="btnClick">继续扫码核销</view>
		<view class="msg" v-else>{{msg}}</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				title:'核销成功',
				codeData:null,
				msg:null,
				success:null,
			}
		},
		onShow() {		
		},
		onLoad(page) {
			this.codeData = page.codeData;
			this.msg = page.msg;
			this.success = page.success;
			console.log('success',this.success);
			if(this.success=='true'){
				this.title = '核销成功';
			}else{
				this.title = '核销失败';
			}
			uni.setNavigationBarTitle({
			    title:this.title
			});
		},
		methods: {
			btnClick(){
				// uni.$u.route('/pages/index/index', {
				// });
				uni.reLaunch({url: `/pages/index/index`});
			}
		}
	}
</script>
<style>
	page{
		background-color: #F5F5F5;
	}
</style>
<style lang="scss" scoped>
.pages{
	text-align: center;
}

.icon-wrap{
	width: 180rpx;
	height: 180rpx;
	margin: 120rpx auto 20rpx;
	padding: 20rpx;
	background-color: #00EFB2;
	border-radius: 50%;
}
.title{
	font-size: 34rpx;
	font-family: PingFangSC-Semibold, PingFang SC;
	font-weight: 600;
	color: #333333;
	line-height: 48rpx;
	margin-bottom: 120rpx;
}
.full-btn{
	margin: 20rpx 10%;
	background-color: #009AEF;
}
.msg{
	font-size: 30rpx;
	font-family: PingFangSC-Regular, PingFang SC;
	font-weight: 400;
	color: #999999;
	line-height: 42rpx;
}
</style>