<template>
    <view class="pay-success">
        <view class="success-icon">
            <image src="../static/pay-success.png" mode="aspectFit"></image>
        </view>
        <view class="success-title">支付成功</view>
        <view class="success-desc">您发书籍将邮寄，请坐等快递</view>
        <view class="action-buttons">
            <button class="btn-return" @click="handleReturn">返回首页</button>
            <button class="btn-view" @click="handleViewOrder">查看订单</button>
        </view>
    </view>
</template>

<script>
export default {
    data() {
        return {
            orderId:''
        }
    },
    onLoad(options){
        this.orderId = options.orderId
    },
    methods: {
        handleReturn() {
            uni.switchTab({
                url: '/pages/home/index'
            })
        },
        handleViewOrder() {
            uni.navigateTo({
                url: '/pages-mine/pages/return-detail?orderId=' + this.orderId
            })
        }
    }
}
</script>

<style lang="scss" scoped>
.pay-success {
    min-height: 100vh;
    background: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 120rpx;

    .success-icon {
        width: 160rpx;
        height: 160rpx;
        margin-bottom: 40rpx;

        image {
            width: 100%;
            height: 100%;
        }
    }

    .success-title {
        font-size: 36rpx;
        font-weight: 500;
        color: #333;
        margin-bottom: 20rpx;
    }

    .success-desc {
        font-size: 28rpx;
        color: #999;
        margin-bottom: 80rpx;
    }

    .action-buttons {
        display: flex;
        gap: 30rpx;
        padding: 0 40rpx;
        width: 100%;
        box-sizing: border-box;

        button {
            flex: 1;
            height: 88rpx;
            border-radius: 10rpx;
            font-size: 32rpx;
            display: flex;
            align-items: center;
            justify-content: center;

            &.btn-return {
                background: #f5f5f5;
                color: #666;
            }

            &.btn-view {
                background: #07c160;
                color: #fff;
            }
        }
    }
}
</style>
