<template>
	<view>
		<view class="u-flex-col" style="justify-content: flex-end;align-items: center;margin-top: 100rpx;">
			<image src="/static/images/success.png" style="width: 86rpx;height: 86rpx;" mode=""></image>
			<view class="success">支付成功</view>
			<view class="" style="margin-top: 26rpx;">
				<text class="money">¥</text>
				<text class="money" style="font-size: 44rpx;">{{total_price}}</text>
			</view>
			<view class="order">
				<text class="one">订单编号： {{order_on}}</text>
				<text class="one" style="color: rgba(10, 109, 205, 1);margin-left: 20rpx;" @click="success">查看订单</text>
			</view>
			<view class="button" @click="accomplish">
				完成
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				id: '',
				bookid: '',
				order_on:'',
				total_price:''
			};
		},
		onLoad(options) {
			this.id = options.id
			this.orderinfo()
		},
		methods: {
			orderinfo(){
				this.$u.post("api/order/getOrderInfo",{
					id:this.id
				}).then(res=>{
					this.order_on = res.data.order_on
					this.total_price = res.data.total_price
				})
			},
			accomplish() {
				this.bookid = uni.getStorageSync('bookid')
				uni.switchTab({
					// url: '/pages/index/bookinfo?id=' + this.bookid
					url: '/pages/index/index'
				})
			},
			success() {
				uni.navigateTo({
					url: '/pages/success?id=' + this.id
				})
			}
		}
	}
</script>

<style lang="scss">
	.one {
		font-size: 26rpx;
		font-family: SFPro, SFPro;
		font-weight: 400;
		color: #222222;
	}

	.button {
		width: 290rpx;
		height: 88rpx;
		background: #06A971;
		border-radius: 12rpx;
		font-size: 32rpx;
		font-family: PingFangSC, PingFang SC;
		font-weight: 500;
		color: #FFFFFF;
		margin-top: 550rpx;
		line-height: 88rpx;
		text-align: center;
	}

	.order {
		margin-top: 62rpx;

	}

	.success {
		font-size: 28rpx;
		font-family: PingFangSC, PingFang SC;
		font-weight: 400;
		color: #222222;
		margin-top: 40rpx;
	}

	.money {
		font-size: 26rpx;
		font-family: JDZhengHT, JDZhengHT;
		font-weight: 400;
		color: #222222;
	}
</style>