From ce0b73fdf9c299199d558a7db1ca315071c64aac Mon Sep 17 00:00:00 2001 From: reddigriz Date: Thu, 22 Sep 2022 19:49:45 +0200 Subject: [PATCH] ChatMsg funzionanti, da stilizzare --- geografia-vue/src/assets/demo_messages.json | 62 +++++++------------ geografia-vue/src/components/ChatList.vue | 7 ++- .../src/components/keyboard/Keyboard.vue | 2 +- .../components/single_chat/ChatHistory.vue | 14 +++-- .../src/components/single_chat/ChatMsg.vue | 8 +++ 5 files changed, 45 insertions(+), 48 deletions(-) diff --git a/geografia-vue/src/assets/demo_messages.json b/geografia-vue/src/assets/demo_messages.json index 804c1b6..83b37a8 100644 --- a/geografia-vue/src/assets/demo_messages.json +++ b/geografia-vue/src/assets/demo_messages.json @@ -2,63 +2,45 @@ "history": [ { "id": 1, - "picture": "../assets/cat_skate.png", - "name": "test-name1", - "last_message": "🐱⛸️➡️?", + "text": "🐱⛸️➡️?", + "is_user": false, "seen": false, - "date": "25/08/22", - "new_messages": 1, - "is_user": false + "date": "22/09 12:12" }, { "id": 2, - "picture": "../assets/cat_skate.png", - "name": "test-name2", - "last_message": "🐱⛸️➡️?", - "seen": false, - "date": "25/08/22", - "new_messages": 1, - "is_user": true + "text": "🐱⛸️➡️?", + "is_user": true, + "seen": true, + "date": "22/09 12:12" }, { "id": 3, - "picture": "../assets/cat_skate.png", - "name": "test-name3", - "last_message": "🐱⛸️➡️?", - "seen": false, - "date": "25/08/22", - "new_messages": 1, - "is_user": false + "text": "🐱⛸️➡️?", + "is_user": false, + "seen": true, + "date": "22/09 12:12" }, { "id": 4, - "picture": "../assets/cat_skate.png", - "name": "test-name4", - "last_message": "🐱⛸️➡️?", - "seen": false, - "date": "25/08/22", - "new_messages": 1, - "is_user": true + "text": "🐱⛸️➡️?", + "is_user": true, + "seen": true, + "date": "22/09 12:12" }, { "id": 5, - "picture": "../assets/cat_skate.png", - "name": "test-name5", - "last_message": "🐱⛸️➡️?", + "text": "🐱⛸️➡️?", + "is_user": false, "seen": false, - "date": "25/08/22", - "new_messages": 1, - "is_user": false + "date": "22/09 12:12" }, { "id": 6, - "picture": "../assets/cat_skate.png", - "name": "test-name6", - "last_message": "🐱⛸️➡️?", - "seen": false, - "date": "25/08/22", - "new_messages": 1, - "is_user": true + "text": "🐱⛸️➡️?", + "is_user": true, + "seen": true, + "date": "22/09 12:12" } ] } diff --git a/geografia-vue/src/components/ChatList.vue b/geografia-vue/src/components/ChatList.vue index 7b436a9..630901a 100644 --- a/geografia-vue/src/components/ChatList.vue +++ b/geografia-vue/src/components/ChatList.vue @@ -1,7 +1,7 @@ @@ -26,10 +26,13 @@ import demo_chats_json from "../assets/demo_chats.json"; export default { demo_chats: demo_chats_json, selectedChat: false, + chatId: Number, methods: { showChat(chat) { + console.log(chat); this.$emit("change-header", [chat.picture, chat.name]); this.selectedChat = true; + this.chatId = chat.id; }, }, }; diff --git a/geografia-vue/src/components/keyboard/Keyboard.vue b/geografia-vue/src/components/keyboard/Keyboard.vue index fc829e1..29a8c41 100644 --- a/geografia-vue/src/components/keyboard/Keyboard.vue +++ b/geografia-vue/src/components/keyboard/Keyboard.vue @@ -1,5 +1,5 @@ \ No newline at end of file diff --git a/geografia-vue/src/components/single_chat/ChatHistory.vue b/geografia-vue/src/components/single_chat/ChatHistory.vue index 2f330f4..b1c8bfa 100644 --- a/geografia-vue/src/components/single_chat/ChatHistory.vue +++ b/geografia-vue/src/components/single_chat/ChatHistory.vue @@ -7,18 +7,22 @@ import ChatMsg from "./ChatMsg.vue"; per permettero lo scrolling e una dimensione fissa -->
-
diff --git a/geografia-vue/src/components/single_chat/ChatMsg.vue b/geografia-vue/src/components/single_chat/ChatMsg.vue index 6571c7e..e34f5fa 100644 --- a/geografia-vue/src/components/single_chat/ChatMsg.vue +++ b/geografia-vue/src/components/single_chat/ChatMsg.vue @@ -4,15 +4,23 @@ class="bubble bubble-bottom-left" >

{{ messageText }}

+
+

✓✓

+

+

{{messageDate}}

+