|
@@ -0,0 +1,90 @@
|
|
|
+<template>
|
|
|
+ <div class="min-h-screen bg-gray-100">
|
|
|
+ <!-- Top Navigation -->
|
|
|
+ <header class="bg-purple-900 text-white border-b">
|
|
|
+ <div class="flex items-center justify-between px-4 py-2">
|
|
|
+ <div class="flex items-center space-x-2">
|
|
|
+ <span class="text-2xl font-bold">应用名称</span>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="flex-1 max-w-xl mx-4">
|
|
|
+ <div class="relative">
|
|
|
+ <input
|
|
|
+ type="text"
|
|
|
+ placeholder="搜索联系人或历史消息"
|
|
|
+ class="w-full pl-10 pr-4 py-2 border rounded-lg focus:outline-none focus:ring-2 focus:ring-purple-500"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="flex items-center space-x-4">
|
|
|
+ <button class="px-3 py-1 text-white bg-purple-500 rounded-md">登录/注册</button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </header>
|
|
|
+
|
|
|
+ <div class="flex">
|
|
|
+ <!-- Sidebar -->
|
|
|
+ <aside class="w-64 min-h-screen bg-purple-900 border-r">
|
|
|
+ <div class="p-4 bg-purple-800 text-white text-center">
|
|
|
+ <h2 class="text-lg font-bold">应用标题</h2>
|
|
|
+ </div>
|
|
|
+ <nav class="p-4">
|
|
|
+ <ul class="space-y-2">
|
|
|
+ <li v-for="(contact, index) in contacts" :key="index" class="flex items-center p-4 hover:bg-purple-800 cursor-pointer">
|
|
|
+ <img :src="contact.avatar" alt="Contact Avatar" class="w-10 h-10 rounded-full mr-3" />
|
|
|
+ <span>{{ contact.name }}</span>
|
|
|
+ </li>
|
|
|
+ </ul>
|
|
|
+ </nav>
|
|
|
+ </aside>
|
|
|
+
|
|
|
+ <!-- Main Content -->
|
|
|
+ <main class="flex-1 p-6 bg-gray-100">
|
|
|
+ <!-- Conversation Area -->
|
|
|
+ <div class="bg-gray-200 rounded-lg p-6 mb-4 h-full overflow-y-auto">
|
|
|
+ <div v-for="(message, index) in messages" :key="index" class="mb-4">
|
|
|
+ <div v-if="message.sender === 'user'" class="flex justify-end">
|
|
|
+ <div class="bg-purple-500 text-white p-3 rounded-lg max-w-2/3">
|
|
|
+ {{ message.text }}
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div v-else class="flex justify-start">
|
|
|
+ <div class="bg-gray-300 p-3 rounded-lg max-w-2/3">
|
|
|
+ {{ message.text }}
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <!-- Input Area -->
|
|
|
+ <div class="flex items-center border-t">
|
|
|
+ <button class="bg-purple-500 text-white px-4 py-2 rounded-l-lg">发送</button>
|
|
|
+ <input
|
|
|
+ type="text"
|
|
|
+ placeholder="输入消息..."
|
|
|
+ class="flex-1 p-2 border-t border-b"
|
|
|
+ />
|
|
|
+ <button class="bg-purple-500 text-white px-4 py-2 rounded-r-lg">+</button>
|
|
|
+ </div>
|
|
|
+ </main>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script setup>
|
|
|
+import { ref } from 'vue'
|
|
|
+
|
|
|
+const contacts = [
|
|
|
+ { name: '张三', avatar: 'https://via.placeholder.com/100' },
|
|
|
+ { name: '李四', avatar: 'https://via.placeholder.com/100' },
|
|
|
+ { name: '王五', avatar: 'https://via.placeholder.com/100' },
|
|
|
+ { name: '赵六', avatar: 'https://via.placeholder.com/100' },
|
|
|
+ { name: '孙七', avatar: 'https://via.placeholder.com/100' }
|
|
|
+]
|
|
|
+
|
|
|
+const messages = [
|
|
|
+ { sender: 'user', text: '你好,有什么我可以帮忙的吗?' },
|
|
|
+ { sender: 'other', text: '你好,我想了解一下你们的服务。' }
|
|
|
+]
|
|
|
+</script>
|