From 5b8b51a89487d247e2ec22f6f32877ea4fc35ecb Mon Sep 17 00:00:00 2001 From: dylanmay <670374839@qq.com> Date: Wed, 20 Sep 2023 17:51:50 +0800 Subject: [PATCH 1/3] feat: friends --- src/views/chat/ChatPage/Index.vue | 18 ++++---- .../chat/components/FriendItem/Index.vue | 32 ++++++++++++++ src/views/chat/components/Friends/Index.vue | 28 +++++++++++++ .../chat/components/ToolSection/Index.vue | 36 ++++++++++++++++ src/views/chat/model/Friend.ts | 15 +++++++ src/views/chat/store/friendstore.ts | 42 +++++++++++++++++++ src/views/chat/types/index.d.ts | 5 +++ 7 files changed, 169 insertions(+), 7 deletions(-) create mode 100644 src/views/chat/components/FriendItem/Index.vue create mode 100644 src/views/chat/components/Friends/Index.vue create mode 100644 src/views/chat/model/Friend.ts create mode 100644 src/views/chat/store/friendstore.ts diff --git a/src/views/chat/ChatPage/Index.vue b/src/views/chat/ChatPage/Index.vue index b17e70645..e81604a5b 100644 --- a/src/views/chat/ChatPage/Index.vue +++ b/src/views/chat/ChatPage/Index.vue @@ -1,7 +1,8 @@ @@ -22,6 +23,7 @@ import Friends from '../components/Friends/Index.vue' import ChatHeader from '../components/ChatHeader/Index.vue' import ChatMessage from '../components/ChatMessage/Index.vue' import InputSection from '../components/InputSection/index.vue' +import FriendDetail from '../components/FriendDetail/Index.vue' import { MENU_LIST_ENUM } from '../types/index.d.ts' defineOptions({ name: 'ChatPage' }) diff --git a/src/views/chat/components/FriendDetail/Index.vue b/src/views/chat/components/FriendDetail/Index.vue new file mode 100644 index 000000000..474ebfcdf --- /dev/null +++ b/src/views/chat/components/FriendDetail/Index.vue @@ -0,0 +1,29 @@ + + + diff --git a/src/views/chat/components/FriendItem/Index.vue b/src/views/chat/components/FriendItem/Index.vue index 0cd5d841a..9f3eaea72 100644 --- a/src/views/chat/components/FriendItem/Index.vue +++ b/src/views/chat/components/FriendItem/Index.vue @@ -7,26 +7,22 @@ diff --git a/src/views/chat/components/Friends/Index.vue b/src/views/chat/components/Friends/Index.vue index 80cf8113c..55df4e295 100644 --- a/src/views/chat/components/Friends/Index.vue +++ b/src/views/chat/components/Friends/Index.vue @@ -5,10 +5,11 @@ > @@ -18,11 +19,17 @@ import FriendItem from '../FriendItem/Index.vue' import { useFriendStore } from '../../store/friendstore' import { onMounted } from 'vue' +import Friend from '../../model/Friend' defineOptions({ name: 'Friends' }) -const { friendList } = useFriendStore() +const friendStore = useFriendStore() onMounted(() => { // set default conversation }) + +const onFriendClick = (friend: Friend) => { + console.log('====>', friend) + friendStore.setCurrentFriend(friend) +} diff --git a/src/views/chat/components/ToolSection/Index.vue b/src/views/chat/components/ToolSection/Index.vue index 405fdbfe2..769e66399 100644 --- a/src/views/chat/components/ToolSection/Index.vue +++ b/src/views/chat/components/ToolSection/Index.vue @@ -1,5 +1,5 @@