vue3布局实现一个pc端即时通讯聊天软件ui原型图代码

代码语言:html

所属分类:布局界面

代码描述:vue3布局实现一个pc端即时通讯聊天软件ui原型图代码

代码标签: vue pc端 即时 通讯 聊天 软件 ui 原型图 代码

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>微信PC端原型</title>
  <!-- Vue 3 CDN -->
<script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/vue.global.3.2.37.js"></script>
    <!-- ECharts CDN -->
 <script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/echarts.5.5.0.js"></script>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
            background: #f5f5f5;
            overflow: hidden;
        }

        .app-container {
            display: flex;
            height: 100vh;
            background: #fff;
        }

        /* 侧边栏样式 */
        .sidebar {
            width: 60px;
            background: #2c3e50;
            display: flex;
            flex-direction: column;
            align-items: center;
            padding: 20px 0;
        }

        .sidebar-item {
            width: 40px;
            height: 40px;
            margin-bottom: 20px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 8px;
            transition: background 0.3s;
        }

        .sidebar-item:hover,
        .sidebar-item.active {
            background: #3498db;
        }

        .sidebar-item svg {
            width: 24px;
            height: 24px;
            fill: #ecf0f1;
        }

        /* 联系人列表样式 */
        .contacts-panel {
            width: 280px;
            background: #fff;
            border-right: 1px solid #e1e8ed;
            display: flex;
            flex-direction: column;
        }

        .panel-header {
            height: 60px;
            padding: 0 20px;
            border-bottom: 1px solid #e1e8ed;
            display: flex;
            align-items: center;
            justify-content: space-between;
            background: #3498db;
            color: white;
        }

        .search-box {
            padding: 15px 20px;
            border-bottom: 1px solid #e1e8ed;
        }

        .search-input {
            width: 100%;
            padding: 8px 12px;
            border: 1px solid #ddd;
            border-radius: 20px;
            outline: none;
            font-size: 14px;
        }

        .contacts-list {
            flex: 1;
            overflow-y: auto;
        }

        .contact-item {
            padding: 12px 20px;
            border-bottom: 1px solid #f0f0f0;
            cursor: pointer;
            display: flex;
            align-items: center;
            transition: background 0.3s;
        }

        .contact-item:hover,
        .contact-item.active {
            background: #e8f4fd;
        }

        .contact-avatar {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            margin-right: 12px;
            object-fit: cover;
        }

        .contact-info {
            flex: 1;
        }

        .contact-name {
            font-size: 14px;
            color: #333;
            margin-bottom: 4px;
        }

        .contact-message {
            font-size: 12px;
            color: #999;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .contact-time {
            font-size: 12px;
            color: #999;
        }

        /* 聊天区域样式 */
        .chat-area {
            flex: 1;
            display: flex;
            flex-direction: column;
        }

        .chat-header {
            height: 60px;
            padding: 0 20px;
            border-bottom: 1px solid #e1e8ed;
            display: flex;
            align-items: center;
            justify-content: space-between;
            background: #3498db;
            color: white;
        }

        .chat-messages {
            flex: 1;
            padding: 20px;
            overflow-y: auto;
            background: #f8f9fa;
        }

        .message {
            margin-bottom: 20px;
            display: flex;
        }

        .message.sent {
            justify-content: flex-end;
        }

        .message-avatar {
            width: 36px;
            height: 36px;
            border-radius: 50%;
            margin: 0 10px;
            object-fit: cover;
        }

        .message-content {
            max-width: 60%;
            padding: 10px 15px;
            border-radius: 10px;
            background: #fff;
            box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        }

        .message.sent .message-content {
            background: #3498db;
            color: white;
        }

        .chat-input-area {
            height: 120px;
            border-top: 1px solid #e1e8ed;
            display: flex;
            flex-direction: column;
        }

        .chat-toolbar {
            height: 40px;
            padding: 0 20px;
            display: flex;
            align-items: center;
            border-bottom: 1px solid #e1e8ed;
        }

        .toolbar-btn {
            margin-right: 15px;
            cursor: pointer;
            padding: 5px;
            border-radius: 4px;
            transition: background 0.3s;
        }

        .toolbar-btn:hover {
            background: #f0f0f0;
        }

        .toolbar-btn svg {
            width: 20px;
            height: 20px;
            fill: #666;
        }

        .chat-input {
            flex: 1;
            padding: 10px 20px;
            display: flex;
            align-items: center;
        }

        .input-field {
            flex: 1;
            border: none;
            outline: none;
            font-size: 14px;
            resize: none;
            height: 40px;
            line-height: 40px;
        }

        .send-btn {
            padding: 8px 20px;
            background: #3498db;
            color: white;
            border: none;
            border-radius: 4px;
            cursor: pointer;
            margin-left: 10px;
        }

        .send-btn:hover {
            background: #2980b9;
        }

        /* 模态框样式 */
        .modal {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0,0,0,0.5);
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 1000;
        }

        .modal-content {
            background: white;
            padding: 20px;
            border-radius: 8px;
            width: 400px;
            max-width: 90vw;
        }

        .modal-header {
            margin-bottom: 20px;
            font-size: 18px;
            font-weight: bold;
        }

        .form-group {
            margin-bottom: 15px;
        }

        .form-label {
            display: block;
            margin-bottom: 5px;
            f.........完整代码请登录后点击上方下载按钮下载查看

网友评论0