<template>
    <u-popup ref="popup" :show="showPopup" mode="center" :mask-close-able="false" :round="16">
        <view class="submit-result-modal">
            <!-- 成功图片 -->
            <image src="/static/images/submitOK.png" class="success-image" mode="aspectFit" />

            <!-- 成功提示文字 -->
            <text class="success-text">提交成功</text>

            <!-- 按钮区域 -->
            <view class="button-group">
                <view class="custom-btn-white" @click="handleBackToList">
                    返回列表
                </view>
                <view class="custom-btn-normal" @click="handleContinueSubmit">
                    继续提交
                </view>
            </view>
        </view>
    </u-popup>
</template>

<script>
export default {
    name: 'SubmitResult',
    data() {
        return {
            showPopup: false
        };
    },
    methods: {
        // 打开模态框
        open() {
            this.showPopup = true;
        },

        // 关闭模态框
        close() {
            this.showPopup = false;
        },

        // 返回列表
        handleBackToList() {
            this.close();
           
            uni.navigateBack({ delta: 1 });
        },

        // 继续提交
        handleContinueSubmit() {
            this.close();
            // 触发继续提交事件
            this.$emit('continue-submit');
        }
    }
}
</script>

<style scoped>
.submit-result-modal {
    background: #ffffff;
    border-radius: 16rpx;
    padding: 60rpx 40rpx 40rpx;
    width: 560rpx;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.success-image {
    width: 400rpx;
    height: 400rpx;
    margin-bottom: 32rpx;
}

.success-text {
    font-size: 36rpx;
    font-weight: 600;
    color: #333333;
    margin-bottom: 48rpx;
    text-align: center;
}

.button-group {
    display: flex;
    justify-content: space-between;
    width: 100%;
    gap: 20rpx;
}

.btn {
    flex: 1;
    height: 80rpx;
    border-radius: 12rpx;
    font-size: 28rpx;
    font-weight: 500;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-primary {
    background: #2979FF;
    color: #ffffff;
}

.btn-primary:active {
    background: #1E62D9;
}

.btn-secondary {
    background: #F2F2F2;
    color: #666666;
    border: 1px solid #E0E0E0;
}

.btn-secondary:active {
    background: #E8E8E8;
}
</style>