<template>
	<view>
		<u-popup :custom-style="popupStyle" :closeable="true" close-icon-size="40" close-icon-color="#fff" close-icon="close-circle"
			class="auth-point" v-model="show" mode="center" width="70%" border-radius="28">
			<view class="auth-bg">
				<image style="width: 100%;" src="../../static/poster/votesuccess.png" mode="widthFix"></image>
				<view class="avatar-vote flex justify-center align-center">
					<u-avatar size="159" :src="avatar"></u-avatar>
				</view>
				<view class="info-box">
					<view class="main-info">兑换商品成功</view>
					<view class="sub-info" style="padding: 0 50rpx;">
						您可以在个人中心的我的兑换里查看所兑换的商品
					</view>
					<view class="flex justify-center" style="margin-top: 90rpx;">
						<u-button @click="show=false" shape="circle" :custom-style="customStyle">继续兑换</u-button>
						<u-button shape="circle" :custom-style="customStyle" @click="view">立即查看</u-button>
					</view>
				</view>
			</view>
		</u-popup>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				show: false,
				avatar: '',
				popupStyle: {
					'u-mode-center-box': 'red'
				},
				customStyle: {
					color: 'white',
					background: "#E72226",
					width: '200rpx',
					margin: '10rpx',
					height: "60rpx",
					fontSize: "26rpx"
				}
			};
		},

		methods: {
			toIndex() {
				uni.switchTab({
					url: "/pages/index/home"
				})
			},
			showSuccess(avatar) {
				this.avatar = avatar;
				this.show = true;
			},
			hide() {
				this.show = false;
			},
			support() {
				this.hide()
				this.$emit('support')
			},
			view(){
				uni.navigateTo({
					url:"/pages/mine/order/order"
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.auth-bg {
		width: 100%;
		background: transparent;
	}

	.auth-msg {
		padding: 40rpx 40rpx 20rpx 40rpx;
		display: flex;
		align-items: center;
		justify-content: left;
	}

	.avatar-vote {
		position: absolute;
		width: 200rpx;
		height: 200rpx;
		top: 100rpx;
		left: calc(50% - 100rpx);
		border: 2px dashed #E8E8E8;
		border-radius: 50%;
	}

	.info-box {
		position: absolute;
		width: 100%;
		height: auto;
		top: 360rpx;
		left: 0;

		.main-info {
			margin: 10rpx;
			font-size: 30rpx;
			color: #353535;
			font-weight: 800;
			text-align: center;
		}

		.sub-info {
			margin: 15rpx auto 40rpx auto;
			text-align: center;
			color: #AAAAAA;
			font-size: 24rpx;
			font-weight: 400;
		}
	}
</style>
