diff --git a/app/DataBase/output_pc.py b/app/DataBase/output_pc.py index ed1db8c..2a78a96 100644 --- a/app/DataBase/output_pc.py +++ b/app/DataBase/output_pc.py @@ -293,13 +293,14 @@ class ChildThread(QThread): content = parser_reply(message[11]) refer_msg = content.get('refer') if self.output_type == Output.HTML: - doc.write( - f'''{{ type:1, text: '{content.get('title')}',is_send:{is_send},avatar_path:'{avatar}'}},''' - ) - - doc.write( - f'''{{ type:{49},sub_type:{content.get('type')}, text: '{refer_msg.get('displayname')}:{refer_msg.get('content')}',is_send:{is_send},avatar_path:''}},''' - ) + if refer_msg: + doc.write( + f'''{{ type:49, text: '{content.get('title')}',is_send:{is_send},sub_type:{content.get('type')},refer_text: '{refer_msg.get('displayname')}:{refer_msg.get('content')}',avatar_path:'{avatar}'}},''' + ) + else: + doc.write( + f'''{{ type:49, text: '{content.get('title')}',is_send:{is_send},sub_type:{content.get('type')},avatar_path:'{avatar}'}},''' + ) elif self.output_type==Output.TXT: name = '你' if is_send else self.contact.remark doc.write( @@ -641,7 +642,7 @@ body{ } .chat-refer{ max-width: 400px; - padding: 3px; + padding: 6px; border-radius: 5px; position: relative; color: #000; @@ -690,6 +691,9 @@ body{ display: flex; width: 100%; } +.item-refer{ + margin-top: 4px; +} .item.item-right{ justify-content: flex-end; } @@ -908,6 +912,7 @@ html_end = ''' for (let i = startIndex; i < endIndex && i < chatMessages.length; i++) { const message = chatMessages[i]; const messageElement = document.createElement('div'); + const messageElementRefer = document.createElement('div'); if (message.type == 1) { if (message.is_send == 1) { messageElement.className = "item item-right"; @@ -946,11 +951,19 @@ html_end = ''' if (message.sub_type == 57){ if (message.is_send == 1) { messageElement.className = "item item-right"; - messageElement.innerHTML = `