<template>
	<view class="">
		<view class="content">
			<view class="content-top">恭喜您！兑换成功！</view>
			<image src="../../static/gift/success.png" mode="widthFix" style="width: 310rpx;212rpx"></image>
			<text style="font-size: 28rpx;color: #999;margin-top: 54rpx">感觉你对大卫博士的支持，欢迎你继续兑换</text>
			<view class="content-middle">
				消耗金额:<text style="color: #EA4A41;margin-left: 20rpx;">{{totalPrice}}奖学金</text>
			</view>
			<view class="content-bottom">
				<view class="goon" @click="goon">
					继续兑换
				</view>
				<view class="check"  @click="check">
					查看兑换记录
				</view>
			</view>
		</view>
	</view>
	
</template>

<script>
	export default {
		data() {
			return {
				totalPrice: ''
			}
		},
		computed: {
			userServerInfo() {
				//用户服务器信息
				return this.$store.state.userServerInfo;
			},
		},
		onLoad: function (option) { //option为object类型，会序列化上个页面传递的参数
			this.totalPrice = option.totalPrice
		},
		methods: {
			//继续兑换
			goon(){
				uni.reLaunch({
				    url: '../exchange/exchange'
				})
			},
			//兑换记录
			check(){
				if (this.userServerInfo.type === 1) {
					uni.navigateTo({ url: '../exchangerecord/exchangerecord' })
				} else if (this.userServerInfo.type === 2) {
					uni.navigateTo({ url: '../mygift/mygift' })
				} else {
					uni.showModal({
						content: '无兑换记录',
						showCancel: false
					})
				}
			}
		}
	}
</script>
<style lang="scss">
	// page{
	// 	background-color: #fff;
	// }
	.content {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		&-top{
			margin-top: 150rpx;
			color: #333;
			font-weight: bold;
			font-size: 36rpx;
		}
		image{
			margin-top: 30rpx;
		}
		&-middle{
			margin-top: 54rpx;
			font-size: 36rpx;
			color: #333;
			font-weight: bold;
		}
		&-bottom{
			display: flex;
			margin-top: 72rpx;
			.goon{
				width: 300rpx;
				line-height: 88rpx;
				color: #FB231F;
				border-radius: 44rpx;
				border: 2rpx #FB231F solid;
				background-color: #FFF4F3;
				text-align: center;
			}
			.check{
				width: 300rpx;
				color: #fff;
				line-height: 88rpx;
				margin-left: 40rpx;
				border-radius: 44rpx;
				background: linear-gradient(93deg, #F97C55 0%, #F44545 100%);
				text-align: center;
			}
		}
	}

</style>
