<template>
    <view class="container">
        <!-- 自定义导航栏 -->
        <view class="nav-bar">
            <view class="nav-left" @click="navBack">
                <image class="back-icon" src="/static/icons/chevron_right_dark.svg" style="transform: rotate(180deg);">
                </image>
            </view>
            <text class="nav-title">消息中心</text>
            <view class="nav-right">
                <view class="more-dots">
                    <view class="dot"></view>
                    <view class="dot"></view>
                    <view class="dot"></view>
                </view>
            </view>
        </view>
        <view class="nav-placeholder"></view>

        <!-- 消息分类列表 -->
        <view class="message-list">
            <!-- 订单消息 -->
            <view class="message-item" @click="navToOrderMsg">
                <view class="icon-wrapper">
                    <image class="msg-icon" src="/static/icons/icon_order_msg.svg"></image>
                    <view class="red-dot-badge"></view>
                </view>
                <view class="content-wrapper">
                    <view class="top-row">
                        <text class="msg-title">订单消息</text>
                        <text class="msg-time">5分钟前</text>
                    </view>
                    <text class="msg-preview">你收到一个站长手动派单的新订单</text>
                </view>
            </view>

            <!-- 系统消息 -->
            <view class="message-item" @click="navToSystemMsg">
                <view class="icon-wrapper">
                    <image class="msg-icon" src="/static/icons/icon_system_msg.svg"></image>
                </view>
                <view class="content-wrapper">
                    <view class="top-row">
                        <text class="msg-title">系统消息</text>
                        <text class="msg-time">7天前</text>
                    </view>
                    <text class="msg-preview">你的健康证明认证审核已通过。</text>
                </view>
            </view>
        </view>

    </view>
</template>

<script>
export default {
    data() {
        return {}
    },
    methods: {
        navBack() {
            uni.navigateBack();
        },
        navToOrderMsg() {
            uni.navigateTo({
                url: '/pages/mine/message/order/index'
            });
        },
        navToSystemMsg() {
            uni.navigateTo({
                url: '/pages/mine/message/system/index'
            });
        }
    }
}
</script>

<style>
page {
    background-color: #fff;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

.nav-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 88rpx;
    padding-top: var(--status-bar-height);
    background-color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30rpx;
    padding-top: var(--status-bar-height);
    /* Ensure padding top includes status bar */
    box-sizing: border-box;
    z-index: 100;
    border-bottom: 1rpx solid #f5f5f5;
}

.nav-placeholder {
    height: calc(88rpx + var(--status-bar-height));
}

.back-icon {
    width: 40rpx;
    height: 40rpx;
}

.nav-title {
    font-size: 34rpx;
    font-weight: bold;
    color: #333;
}

.nav-right {
    width: 40rpx;
    display: flex;
    justify-content: flex-end;
}

.more-dots {
    display: flex;
    gap: 4rpx;
}

.dot {
    width: 6rpx;
    height: 6rpx;
    background-color: #333;
    border-radius: 50%;
}

.message-list {
    padding: 0 30rpx;
}

.message-item {
    display: flex;
    align-items: center;
    padding: 30rpx 0;
    border-bottom: 1rpx solid #f5f5f5;
}

.icon-wrapper {
    position: relative;
    margin-right: 30rpx;
}

.msg-icon {
    width: 96rpx;
    height: 96rpx;
    border-radius: 50%;
}

.red-dot-badge {
    position: absolute;
    top: 0;
    right: 0;
    width: 16rpx;
    height: 16rpx;
    background-color: #FF3B30;
    border-radius: 50%;
    border: 2rpx solid #fff;
}

.content-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10rpx;
}

.msg-title {
    font-size: 28rpx;
    font-weight: bold;
    color: #333;
}

.msg-time {
    font-size: 24rpx;
    color: #999;
}

.msg-preview {
    font-size: 26rpx;
    color: #666;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    width: 500rpx;
}
</style>
