新增对话情感分析,增加窗口自适应,新增emotion界面

This commit is contained in:
shuaikangzhou 2023-04-02 21:23:20 +08:00
parent 5faa0cb1e6
commit 19d529c36e
22 changed files with 1351 additions and 994 deletions

46
TEST.py
View File

@ -1,40 +1,8 @@
import json from snownlp import SnowNLP
from pyecharts import options as opts # 文本
from pyecharts.charts import Graph text = u'🙄”'
# 分析
with open(r'data/npmdepgraph.min10.json', 'r') as f: s = SnowNLP(text)
data = json.load(f) # 输出情绪为积极的概率
print(s)
nodes = [
{
'x': node['x'],
'y': node['y'],
'name': node['label'],
'symbolSize': node['size'],
'itemStyle': {'color': node['color']}
}
for node in data['nodes']
]
edges = [
{
'source': edge['sourceID'],
'target': edge['targetID']
}
for edge in data['edges']
]
G = Graph(init_opts=opts.InitOpts(width='900', height='900'))
G.add(
series_name='',
nodes=nodes,
links=edges,
layout='none',
is_roam=True,
is_focusnode=True,
label_opts=opts.LabelOpts(is_show=True),
linestyle_opts=opts.LineStyleOpts(width=0.5, curve=0.3, opacity=0.7)
)
G.set_global_opts(title_opts=opts.TitleOpts(title='NPM Dependencies'))
G.render('npm_dependencies.html')

103
TEST/mainwindow.ui Normal file
View File

@ -0,0 +1,103 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>MainWindow</class>
<widget class="QMainWindow" name="MainWindow">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>800</width>
<height>600</height>
</rect>
</property>
<property name="windowTitle">
<string>MainWindow</string>
</property>
<widget class="QWidget" name="centralwidget">
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="1">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>30</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="2">
<widget class="QPushButton" name="pushButton">
<property name="text">
<string>PushButton</string>
</property>
</widget>
</item>
<item row="0" column="3">
<widget class="QPushButton" name="pushButton_2">
<property name="text">
<string>PushButton</string>
</property>
</widget>
</item>
<item row="0" column="4">
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>29</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</widget>
<widget class="QMenuBar" name="menubar">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>800</width>
<height>23</height>
</rect>
</property>
<widget class="QMenu" name="menu">
<property name="title">
<string>你好</string>
</property>
</widget>
<widget class="QMenu" name="menuOK">
<property name="title">
<string>OK</string>
</property>
</widget>
<addaction name="menu"/>
<addaction name="menuOK"/>
</widget>
<widget class="QStatusBar" name="statusbar"/>
</widget>
<resources/>
<connections/>
</ui>

View File

@ -200,13 +200,25 @@ def get_message(wxid, num):
sql = ''' sql = '''
select * from message select * from message
where talker = ? where talker = ?
order by msgId desc order by createTime desc
limit ?,100 limit ?,100
''' '''
cursor.execute(sql, [wxid, num * 100]) cursor.execute(sql, [wxid, num * 100])
return cursor.fetchall() return cursor.fetchall()
def get_text_by_num(wxid, num):
sql = '''
SELECT content,strftime('%Y-%m-%d',createTime/1000,'unixepoch','localtime') as days
from message
where talker = ? and type=1
order by days
'''
'''group by days'''
cursor.execute(sql, [wxid])
return cursor.fetchall()
def search_send_message(start_time, end_time): def search_send_message(start_time, end_time):
start_time = '2022-1-1 00:00:00' start_time = '2022-1-1 00:00:00'
end_time = '2023-1-1 00:00:00' end_time = '2023-1-1 00:00:00'
@ -261,7 +273,7 @@ def get_emoji(imgPath):
except sqlite3.ProgrammingError as e: except sqlite3.ProgrammingError as e:
print(e, imgPath) print(e, imgPath)
return False return False
return newPath return False
def download_emoji(imgPath, url): def download_emoji(imgPath, url):
@ -654,6 +666,12 @@ def chat_start_endTime(username):
print(year, month, day, hour, minute, second) print(year, month, day, hour, minute, second)
if __name__ == '__main__':
wxid = 'wxid_8piw6sb4hvfm22'
wxid = 'wxid_wt2vsktnu4z022'
# emotion_analysis(wxid)
plot_emotion(wxid)
'''
if __name__ == '__main__': if __name__ == '__main__':
# rconversation = get_rconversation() # rconversation = get_rconversation()
# for i in rconversation: # for i in rconversation:
@ -680,5 +698,17 @@ if __name__ == '__main__':
# print(result) # print(result)
# radar_hour('wxid_8piw6sb4hvfm22') # radar_hour('wxid_8piw6sb4hvfm22')
# print(result) # print(result)
print(get_msg_start_time('wxid_8piw6sb4hvfm22'), get_msg_end_time('wxid_8piw6sb4hvfm22')) # print(get_msg_start_time('wxid_8piw6sb4hvfm22'), get_msg_end_time('wxid_8piw6sb4hvfm22'))
chat_start_endTime('wxid_8piw6sb4hvfm22') # chat_start_endTime('wxid_8piw6sb4hvfm22')
msg = get_text_by_num('wxid_8piw6sb4hvfm22', 1)
from snownlp import SnowNLP
# print(msg[0])
for m in msg:
content = m[0]
print(content)
s = SnowNLP(content)
# # 输出情绪为积极的概率
print(s.sentiments)
# print(msg)
'''

View File

@ -14,11 +14,11 @@ from . import data
def IS_5_min(last_m, now_m): def IS_5_min(last_m, now_m):
''' """
#! 判断两次聊天时间是不是大于五分钟 #! 判断两次聊天时间是不是大于五分钟
#! 若大于五分钟则显示时间 #! 若大于五分钟则显示时间
#! 否则不显示 #! 否则不显示
''' """
'''两次聊天记录时间差,单位是秒''' '''两次聊天记录时间差,单位是秒'''
dt = now_m - last_m dt = now_m - last_m
return abs(dt // 1000) >= 300 return abs(dt // 1000) >= 300
@ -55,7 +55,6 @@ class Output(QThread):
def merge_docx(self, conRemark, n): def merge_docx(self, conRemark, n):
origin_docx_path = f"{os.path.abspath('.')}/data/聊天记录/{conRemark}" origin_docx_path = f"{os.path.abspath('.')}/data/聊天记录/{conRemark}"
all_word = os.listdir(origin_docx_path)
all_file_path = [] all_file_path = []
for i in range(n): for i in range(n):
file_name = f"{conRemark}{i}.docx" file_name = f"{conRemark}{i}.docx"
@ -295,14 +294,14 @@ class ChildThread(QThread):
doc.add_paragraph() doc.add_paragraph()
def pat_a_pat(self, doc, isSend, content, status): def pat_a_pat(self, doc, isSend, content, status):
''' """
#! 添加拍一拍信息 #! 添加拍一拍信息
todo 把wxid转化成昵称 todo 把wxid转化成昵称
:param isSend: :param isSend:
:param content: :param content:
:param status: :param status:
:return: :return:
''' """
try: try:
pat_data = xmltodict.parse(content) pat_data = xmltodict.parse(content)
pat_data = pat_data['msg']['appmsg']['patMsg']['records']['record'] pat_data = pat_data['msg']['appmsg']['patMsg']['records']['record']

5
app/Ui/123.py Normal file
View File

@ -0,0 +1,5 @@
# This Python file uses the following encoding: utf-8
# if __name__ == "__main__":
# pass
print('hello')

View File

@ -21,7 +21,7 @@ from ...DataBase import data
from ...ImageBox.ui import MainDemo from ...ImageBox.ui import MainDemo
class ChatController(QWidget, Ui_Dialog): class ChatController(QWidget, Ui_Form):
exitSignal = pyqtSignal() exitSignal = pyqtSignal()
urlSignal = pyqtSignal(QUrl) urlSignal = pyqtSignal(QUrl)
@ -32,6 +32,11 @@ class ChatController(QWidget, Ui_Dialog):
self.chatroomFlag = None self.chatroomFlag = None
self.ta_avatar = None self.ta_avatar = None
self.setupUi(self) self.setupUi(self)
self.message = self.message_2
self.frame = self.frame_2
self.scrollAreaWidgetContents = self.scrollAreaWidgetContents_2
self.label_remark = self.label_remark_2
self.textEdit = self.textEdit_2
self.setWindowTitle('WeChat') self.setWindowTitle('WeChat')
self.setWindowIcon(QIcon('./app/data/icon.png')) self.setWindowIcon(QIcon('./app/data/icon.png'))
self.initui() self.initui()
@ -43,6 +48,7 @@ class ChatController(QWidget, Ui_Dialog):
self.last_btn = None self.last_btn = None
self.chat_flag = True self.chat_flag = True
# self.showChat() # self.showChat()
self.message.verticalScrollBar().valueChanged.connect(self.textbrower_verticalScrollBar) self.message.verticalScrollBar().valueChanged.connect(self.textbrower_verticalScrollBar)
self.show_flag = False self.show_flag = False
self.ta_username = None self.ta_username = None
@ -59,29 +65,29 @@ class ChatController(QWidget, Ui_Dialog):
self.message.setOpenExternalLinks(False) self.message.setOpenExternalLinks(False)
# self.message.anchorClicked(self.hyperlink()) # self.message.anchorClicked(self.hyperlink())
self.message.anchorClicked.connect(self.hyperlink) self.message.anchorClicked.connect(self.hyperlink)
self.btn_sendMsg = QtWidgets.QPushButton(self.frame) # self.btn_sendMsg = QtWidgets.QPushButton(self.textEdit)
self.btn_sendMsg.setGeometry(QtCore.QRect(680, 670, 121, 51)) # self.btn_sendMsg.setGeometry(QtCore.QRect(1, 1, 121, 51))
font = QtGui.QFont() # font = QtGui.QFont()
font.setFamily("黑体") # font.setFamily("黑体")
font.setPointSize(15) # font.setPointSize(15)
font.setBold(False) # font.setBold(False)
font.setWeight(50) # font.setWeight(50)
self.btn_sendMsg.setFont(font) # self.btn_sendMsg.setFont(font)
self.btn_sendMsg.setCursor(QtGui.QCursor(QtCore.Qt.ArrowCursor)) # self.btn_sendMsg.setCursor(QtGui.QCursor(QtCore.Qt.ArrowCursor))
self.btn_sendMsg.setMouseTracking(False) # self.btn_sendMsg.setMouseTracking(False)
self.btn_sendMsg.setAutoFillBackground(False) # self.btn_sendMsg.setAutoFillBackground(False)
self.btn_sendMsg.setStyleSheet("QPushButton {background-color: #f0f0f0;\n" # self.btn_sendMsg.setStyleSheet("QPushButton {background-color: #f0f0f0;\n"
"padding: 10px;\n" # "padding: 10px;\n"
"color:rgb(5,180,104);}\n" # "color:rgb(5,180,104);}\n"
"QPushButton:hover{background-color: rgb(198,198,198)}\n" # "QPushButton:hover{background-color: rgb(198,198,198)}\n"
) # )
self.btn_sendMsg.setIconSize(QtCore.QSize(40, 40)) # self.btn_sendMsg.setIconSize(QtCore.QSize(40, 40))
self.btn_sendMsg.setCheckable(False) # self.btn_sendMsg.setCheckable(False)
self.btn_sendMsg.setAutoDefault(True) # self.btn_sendMsg.setAutoDefault(True)
self.btn_sendMsg.setObjectName("btn_sendMsg") # self.btn_sendMsg.setObjectName("btn_sendMsg")
_translate = QtCore.QCoreApplication.translate # _translate = QtCore.QCoreApplication.translate
self.btn_sendMsg.setText(_translate("Dialog", "发送")) # self.btn_sendMsg.setText(_translate("Dialog", "发送"))
self.btn_sendMsg.setToolTip('按Enter键发送按Ctrl+Enter键换行') self.btn_sendMsg_2.setToolTip('按Enter键发送按Ctrl+Enter键换行')
def showChat(self): def showChat(self):
""" """
@ -92,7 +98,9 @@ class ChatController(QWidget, Ui_Dialog):
return return
self.show_flag = True self.show_flag = True
rconversations = data.get_rconversation() rconversations = data.get_rconversation()
max_hight = max(len(rconversations) * 80, 680) # max_hight = max(len(rconversations) * 80, 680)
max_hight = max(len(rconversations) * 80, self.size().height())
self.scrollAreaWidgetContents.setGeometry( self.scrollAreaWidgetContents.setGeometry(
QtCore.QRect(0, 0, 300, max_hight)) QtCore.QRect(0, 0, 300, max_hight))
for i in range(len(rconversations)): for i in range(len(rconversations)):
@ -117,8 +125,8 @@ class ChatController(QWidget, Ui_Dialog):
if self.last_talkerId and self.last_talkerId != talkerId: if self.last_talkerId and self.last_talkerId != talkerId:
print('对方账号:', self.last_talkerId) print('对方账号:', self.last_talkerId)
self.contacts[self.last_talkerId].setStyleSheet( self.contacts[self.last_talkerId].setStyleSheet(
"QPushButton {background-color: rgb(253,253,253);}" "QPushButton {background-color: rgb(220,220,220);}"
"QPushButton:hover{background-color: rgb(209,209,209);}\n" "QPushButton:hover{background-color: rgb(208,208,208);}\n"
) )
self.last_talkerId = talkerId self.last_talkerId = talkerId
self.contacts[talkerId].setStyleSheet( self.contacts[talkerId].setStyleSheet(
@ -264,6 +272,7 @@ class ChatController(QWidget, Ui_Dialog):
def show_emoji(self, isSend, imagePath, content): def show_emoji(self, isSend, imagePath, content):
imgPath = data.get_emoji(imagePath) imgPath = data.get_emoji(imagePath)
print('emoji:', imgPath)
if not imgPath: if not imgPath:
return False return False
image = Image.open(imgPath) image = Image.open(imgPath)
@ -496,8 +505,8 @@ class Contact(QtWidgets.QPushButton):
self.gridLayout1.setRowStretch(1, 3) self.gridLayout1.setRowStretch(1, 3)
self.setLayout(self.gridLayout1) self.setLayout(self.gridLayout1)
self.setStyleSheet( self.setStyleSheet(
"QPushButton {background-color: rgb(253,253,253);}" "QPushButton {background-color: rgb(220,220,220);}"
"QPushButton:hover{background-color: rgb(209,209,209);}\n" "QPushButton:hover{background-color: rgb(208,208,208);}\n"
) )
self.msgCount = contact[0] self.msgCount = contact[0]
self.username = contact[1] self.username = contact[1]

View File

@ -11,120 +11,140 @@
from PyQt5 import QtCore, QtGui, QtWidgets from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_Dialog(object): class Ui_Form(object):
def setupUi(self, Dialog): def setupUi(self, Form):
Dialog.setObjectName("Dialog") Form.setObjectName("Form")
Dialog.resize(1120, 720) Form.resize(878, 720)
Dialog.setCursor(QtGui.QCursor(QtCore.Qt.ArrowCursor)) self.horizontalLayout = QtWidgets.QHBoxLayout(Form)
Dialog.setAutoFillBackground(False) self.horizontalLayout.setObjectName("horizontalLayout")
self.frame_2 = QtWidgets.QFrame(Dialog) self.scrollArea_2 = QtWidgets.QScrollArea(Form)
self.frame_2.setGeometry(QtCore.QRect(0, 0, 1120, 720)) self.scrollArea_2.setEnabled(True)
self.scrollArea_2.setMaximumSize(QtCore.QSize(325, 150000))
self.scrollArea_2.setAutoFillBackground(False)
self.scrollArea_2.setFrameShape(QtWidgets.QFrame.WinPanel)
self.scrollArea_2.setFrameShadow(QtWidgets.QFrame.Raised)
self.scrollArea_2.setMidLineWidth(0)
self.scrollArea_2.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOn)
self.scrollArea_2.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff)
self.scrollArea_2.setSizeAdjustPolicy(QtWidgets.QAbstractScrollArea.AdjustToContentsOnFirstShow)
self.scrollArea_2.setWidgetResizable(False)
self.scrollArea_2.setObjectName("scrollArea_2")
self.scrollAreaWidgetContents_2 = QtWidgets.QWidget()
self.scrollAreaWidgetContents_2.setGeometry(QtCore.QRect(0, 0, 300, 12000))
self.scrollAreaWidgetContents_2.setObjectName("scrollAreaWidgetContents_2")
self.pushButton_3 = QtWidgets.QPushButton(self.scrollAreaWidgetContents_2)
self.pushButton_3.setGeometry(QtCore.QRect(0, 0, 300, 80))
self.pushButton_3.setLayoutDirection(QtCore.Qt.LeftToRight)
self.pushButton_3.setAutoFillBackground(False)
self.pushButton_3.setText("")
self.pushButton_3.setIconSize(QtCore.QSize(80, 80))
self.pushButton_3.setObjectName("pushButton_3")
self.label_2 = QtWidgets.QLabel(self.scrollAreaWidgetContents_2)
self.label_2.setGeometry(QtCore.QRect(220, 10, 72, 15))
self.label_2.setObjectName("label_2")
self.scrollArea_2.setWidget(self.scrollAreaWidgetContents_2)
self.horizontalLayout.addWidget(self.scrollArea_2)
self.frame_2 = QtWidgets.QFrame(Form)
self.frame_2.setMinimumSize(QtCore.QSize(500, 500))
self.frame_2.setStyleSheet("background-color: #F5F5F5;")
self.frame_2.setFrameShape(QtWidgets.QFrame.StyledPanel) self.frame_2.setFrameShape(QtWidgets.QFrame.StyledPanel)
self.frame_2.setFrameShadow(QtWidgets.QFrame.Raised) self.frame_2.setFrameShadow(QtWidgets.QFrame.Raised)
self.frame_2.setObjectName("frame_2") self.frame_2.setObjectName("frame_2")
self.scrollArea = QtWidgets.QScrollArea(self.frame_2) self.verticalLayout = QtWidgets.QVBoxLayout(self.frame_2)
self.scrollArea.setEnabled(True) self.verticalLayout.setContentsMargins(0, 5, 0, 0)
self.scrollArea.setGeometry(QtCore.QRect(0, 40, 326, 680)) self.verticalLayout.setObjectName("verticalLayout")
self.scrollArea.setMaximumSize(QtCore.QSize(400, 150000)) self.horizontalLayout_3 = QtWidgets.QHBoxLayout()
self.scrollArea.setAutoFillBackground(False) self.horizontalLayout_3.setObjectName("horizontalLayout_3")
self.scrollArea.setFrameShape(QtWidgets.QFrame.WinPanel) self.label_remark_2 = QtWidgets.QLabel(self.frame_2)
self.scrollArea.setFrameShadow(QtWidgets.QFrame.Raised) font = QtGui.QFont()
self.scrollArea.setMidLineWidth(0) font.setPointSize(12)
self.scrollArea.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOn) self.label_remark_2.setFont(font)
self.scrollArea.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff) self.label_remark_2.setText("")
self.scrollArea.setSizeAdjustPolicy(QtWidgets.QAbstractScrollArea.AdjustToContentsOnFirstShow) self.label_remark_2.setObjectName("label_remark_2")
self.scrollArea.setWidgetResizable(False) self.horizontalLayout_3.addWidget(self.label_remark_2)
self.scrollArea.setObjectName("scrollArea") spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.scrollAreaWidgetContents = QtWidgets.QWidget() self.horizontalLayout_3.addItem(spacerItem)
self.scrollAreaWidgetContents.setGeometry(QtCore.QRect(0, 0, 300, 12000)) self.toolButton_2 = QtWidgets.QToolButton(self.frame_2)
self.scrollAreaWidgetContents.setObjectName("scrollAreaWidgetContents") self.toolButton_2.setObjectName("toolButton_2")
self.pushButton_2 = QtWidgets.QPushButton(self.scrollAreaWidgetContents) self.horizontalLayout_3.addWidget(self.toolButton_2)
self.pushButton_2.setGeometry(QtCore.QRect(0, 0, 300, 80)) self.verticalLayout.addLayout(self.horizontalLayout_3)
self.pushButton_2.setLayoutDirection(QtCore.Qt.LeftToRight) self.line_5 = QtWidgets.QFrame(self.frame_2)
self.pushButton_2.setAutoFillBackground(False) self.line_5.setFrameShape(QtWidgets.QFrame.HLine)
self.pushButton_2.setText("") self.line_5.setFrameShadow(QtWidgets.QFrame.Sunken)
self.pushButton_2.setIconSize(QtCore.QSize(80, 80)) self.line_5.setObjectName("line_5")
self.pushButton_2.setObjectName("pushButton_2") self.verticalLayout.addWidget(self.line_5)
self.label = QtWidgets.QLabel(self.scrollAreaWidgetContents) self.message_2 = QtWidgets.QTextBrowser(self.frame_2)
self.label.setGeometry(QtCore.QRect(220, 10, 72, 15)) self.message_2.setContextMenuPolicy(QtCore.Qt.ActionsContextMenu)
self.label.setObjectName("label") self.message_2.setStyleSheet("background-color: #F5F5F5;")
self.scrollArea.setWidget(self.scrollAreaWidgetContents) self.message_2.setObjectName("message_2")
self.frame = QtWidgets.QFrame(self.frame_2) self.verticalLayout.addWidget(self.message_2)
self.frame.setGeometry(QtCore.QRect(321, 0, 801, 720)) self.line_6 = QtWidgets.QFrame(self.frame_2)
self.frame.setFrameShape(QtWidgets.QFrame.StyledPanel) self.line_6.setFrameShape(QtWidgets.QFrame.HLine)
self.frame.setFrameShadow(QtWidgets.QFrame.Raised) self.line_6.setFrameShadow(QtWidgets.QFrame.Sunken)
self.frame.setObjectName("frame") self.line_6.setObjectName("line_6")
self.message = QtWidgets.QTextBrowser(self.frame) self.verticalLayout.addWidget(self.line_6)
self.message.setGeometry(QtCore.QRect(9, 39, 801, 541)) self.textEdit_2 = QtWidgets.QTextEdit(self.frame_2)
self.message.setStyleSheet("background-color: #F5F5F5;")
self.message.setObjectName("message")
self.textEdit = QtWidgets.QTextEdit(self.frame)
self.textEdit.setGeometry(QtCore.QRect(9, 579, 821, 141))
font = QtGui.QFont() font = QtGui.QFont()
font.setPointSize(15) font.setPointSize(15)
self.textEdit.setFont(font) self.textEdit_2.setFont(font)
self.textEdit.setTabStopWidth(80) self.textEdit_2.setAutoFillBackground(False)
self.textEdit.setCursorWidth(1) self.textEdit_2.setStyleSheet("background-color: #F5F5F5;")
self.textEdit.setObjectName("textEdit") self.textEdit_2.setFrameShape(QtWidgets.QFrame.NoFrame)
self.btn_sendMsg = QtWidgets.QPushButton(self.frame) self.textEdit_2.setOverwriteMode(False)
self.btn_sendMsg.setGeometry(QtCore.QRect(680, 670, 121, 51)) self.textEdit_2.setTabStopWidth(80)
self.textEdit_2.setAcceptRichText(True)
self.textEdit_2.setCursorWidth(1)
self.textEdit_2.setTextInteractionFlags(QtCore.Qt.TextEditorInteraction)
self.textEdit_2.setObjectName("textEdit_2")
self.verticalLayout.addWidget(self.textEdit_2)
self.horizontalLayout_2 = QtWidgets.QHBoxLayout()
self.horizontalLayout_2.setObjectName("horizontalLayout_2")
spacerItem1 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.horizontalLayout_2.addItem(spacerItem1)
self.btn_sendMsg_2 = QtWidgets.QPushButton(self.frame_2)
font = QtGui.QFont() font = QtGui.QFont()
font.setFamily("黑体") font.setFamily("黑体")
font.setPointSize(15) font.setPointSize(15)
font.setBold(False) font.setBold(False)
font.setWeight(50) font.setWeight(50)
self.btn_sendMsg.setFont(font) self.btn_sendMsg_2.setFont(font)
self.btn_sendMsg.setCursor(QtGui.QCursor(QtCore.Qt.ArrowCursor)) self.btn_sendMsg_2.setCursor(QtGui.QCursor(QtCore.Qt.ArrowCursor))
self.btn_sendMsg.setMouseTracking(False) self.btn_sendMsg_2.setMouseTracking(False)
self.btn_sendMsg.setAutoFillBackground(False) self.btn_sendMsg_2.setAutoFillBackground(False)
self.btn_sendMsg.setStyleSheet("QPushButton {\n" self.btn_sendMsg_2.setStyleSheet("QPushButton {\n"
" background-color: #f0f0f0;\n" "background-color:rgb(233,233,233);\n"
" \n" "padding: 10px;\n"
" padding: 10px;\n" "color:rgb(5,180,104);}\n"
" color:rgb(5,180,104);\n" "QPushButton:hover{\n"
"}") "background-color:rgb(198,198,198)}")
self.btn_sendMsg.setIconSize(QtCore.QSize(40, 40)) self.btn_sendMsg_2.setIconSize(QtCore.QSize(40, 40))
self.btn_sendMsg.setCheckable(False) self.btn_sendMsg_2.setCheckable(False)
self.btn_sendMsg.setAutoDefault(True) self.btn_sendMsg_2.setAutoDefault(True)
self.btn_sendMsg.setObjectName("btn_sendMsg") self.btn_sendMsg_2.setObjectName("btn_sendMsg_2")
self.toolButton = QtWidgets.QToolButton(self.frame) self.horizontalLayout_2.addWidget(self.btn_sendMsg_2)
self.toolButton.setGeometry(QtCore.QRect(760, 0, 47, 41)) self.horizontalLayout_2.setStretch(0, 7)
self.toolButton.setObjectName("toolButton") self.horizontalLayout_2.setStretch(1, 2)
self.line_3 = QtWidgets.QFrame(self.frame) self.verticalLayout.addLayout(self.horizontalLayout_2)
self.line_3.setGeometry(QtCore.QRect(2, 0, 3, 720)) self.verticalLayout.setStretch(0, 2)
self.line_3.setLineWidth(6) self.verticalLayout.setStretch(1, 2)
self.line_3.setFrameShape(QtWidgets.QFrame.VLine) self.verticalLayout.setStretch(2, 60)
self.line_3.setFrameShadow(QtWidgets.QFrame.Sunken) self.verticalLayout.setStretch(3, 2)
self.line_3.setObjectName("line_3") self.verticalLayout.setStretch(4, 2)
self.line_2 = QtWidgets.QFrame(self.frame) self.verticalLayout.setStretch(5, 1)
self.line_2.setGeometry(QtCore.QRect(9, 30, 831, 20)) self.horizontalLayout.addWidget(self.frame_2)
self.line_2.setFrameShape(QtWidgets.QFrame.HLine)
self.line_2.setFrameShadow(QtWidgets.QFrame.Sunken)
self.line_2.setObjectName("line_2")
self.label_remark = QtWidgets.QLabel(self.frame)
self.label_remark.setGeometry(QtCore.QRect(30, 0, 351, 41))
font = QtGui.QFont()
font.setPointSize(12)
self.label_remark.setFont(font)
self.label_remark.setText("")
self.label_remark.setObjectName("label_remark")
self.line = QtWidgets.QFrame(self.frame)
self.line.setGeometry(QtCore.QRect(20, 580, 800, 3))
self.line.setFrameShape(QtWidgets.QFrame.HLine)
self.line.setFrameShadow(QtWidgets.QFrame.Sunken)
self.line.setObjectName("line")
self.retranslateUi(Dialog) self.retranslateUi(Form)
QtCore.QMetaObject.connectSlotsByName(Dialog) QtCore.QMetaObject.connectSlotsByName(Form)
def retranslateUi(self, Dialog): def retranslateUi(self, Form):
_translate = QtCore.QCoreApplication.translate _translate = QtCore.QCoreApplication.translate
Dialog.setWindowTitle(_translate("Dialog", "Dialog")) Form.setWindowTitle(_translate("Form", "Form"))
self.label.setText(_translate("Dialog", "TextLabel")) self.label_2.setText(_translate("Form", "TextLabel"))
self.textEdit.setHtml(_translate("Dialog", "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n" self.toolButton_2.setText(_translate("Form", "..."))
"<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n" self.textEdit_2.setHtml(_translate("Form",
"p, li { white-space: pre-wrap; }\n" "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n"
"</style></head><body style=\" font-family:\'SimSun\'; font-size:15pt; font-weight:400; font-style:normal;\">\n" "<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n"
"<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><br /></p></body></html>")) "p, li { white-space: pre-wrap; }\n"
self.btn_sendMsg.setText(_translate("Dialog", "发送")) "</style></head><body style=\" font-family:\'SimSun\'; font-size:15pt; font-weight:400; font-style:normal;\">\n"
self.toolButton.setText(_translate("Dialog", "...")) "<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><br /></p></body></html>"))
self.btn_sendMsg_2.setText(_translate("Form", "发送"))

View File

@ -1,315 +1,306 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0"> <ui version="4.0">
<class>Dialog</class> <class>Form</class>
<widget class="QDialog" name="Dialog"> <widget class="QWidget" name="Form">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>1120</width> <width>878</width>
<height>720</height> <height>720</height>
</rect> </rect>
</property> </property>
<property name="cursor"> <property name="windowTitle">
<cursorShape>ArrowCursor</cursorShape> <string>Form</string>
</property> </property>
<property name="windowTitle"> <layout class="QHBoxLayout" name="horizontalLayout">
<string>Dialog</string> <item>
</property> <widget class="QScrollArea" name="scrollArea_2">
<property name="autoFillBackground"> <property name="enabled">
<bool>false</bool> <bool>true</bool>
</property> </property>
<widget class="QFrame" name="frame_2"> <property name="maximumSize">
<property name="geometry"> <size>
<rect> <width>325</width>
<x>0</x> <height>150000</height>
<y>0</y> </size>
<width>1120</width> </property>
<height>720</height> <property name="autoFillBackground">
</rect> <bool>false</bool>
</property> </property>
<property name="frameShape"> <property name="frameShape">
<enum>QFrame::StyledPanel</enum> <enum>QFrame::WinPanel</enum>
</property> </property>
<property name="frameShadow"> <property name="frameShadow">
<enum>QFrame::Raised</enum> <enum>QFrame::Raised</enum>
</property> </property>
<widget class="QScrollArea" name="scrollArea"> <property name="midLineWidth">
<property name="enabled"> <number>0</number>
<bool>true</bool> </property>
</property> <property name="verticalScrollBarPolicy">
<property name="geometry"> <enum>Qt::ScrollBarAlwaysOn</enum>
<rect> </property>
<x>0</x> <property name="horizontalScrollBarPolicy">
<y>40</y> <enum>Qt::ScrollBarAlwaysOff</enum>
<width>326</width> </property>
<height>680</height> <property name="sizeAdjustPolicy">
</rect> <enum>QAbstractScrollArea::AdjustToContentsOnFirstShow</enum>
</property> </property>
<property name="maximumSize"> <property name="widgetResizable">
<size> <bool>false</bool>
<width>400</width> </property>
<height>150000</height> <widget class="QWidget" name="scrollAreaWidgetContents_2">
</size> <property name="geometry">
</property> <rect>
<property name="autoFillBackground"> <x>0</x>
<bool>false</bool> <y>0</y>
</property> <width>300</width>
<property name="frameShape"> <height>12000</height>
<enum>QFrame::WinPanel</enum> </rect>
</property> </property>
<property name="frameShadow"> <widget class="QPushButton" name="pushButton_3">
<enum>QFrame::Raised</enum> <property name="geometry">
</property> <rect>
<property name="midLineWidth"> <x>0</x>
<number>0</number> <y>0</y>
</property> <width>300</width>
<property name="verticalScrollBarPolicy"> <height>80</height>
<enum>Qt::ScrollBarAlwaysOn</enum> </rect>
</property> </property>
<property name="horizontalScrollBarPolicy"> <property name="layoutDirection">
<enum>Qt::ScrollBarAlwaysOff</enum> <enum>Qt::LeftToRight</enum>
</property> </property>
<property name="sizeAdjustPolicy"> <property name="autoFillBackground">
<enum>QAbstractScrollArea::AdjustToContentsOnFirstShow</enum> <bool>false</bool>
</property> </property>
<property name="widgetResizable"> <property name="text">
<bool>false</bool> <string/>
</property> </property>
<widget class="QWidget" name="scrollAreaWidgetContents"> <property name="iconSize">
<property name="geometry"> <size>
<rect> <width>80</width>
<x>0</x> <height>80</height>
<y>0</y> </size>
<width>300</width> </property>
<height>12000</height> </widget>
</rect> <widget class="QLabel" name="label_2">
</property> <property name="geometry">
<widget class="QPushButton" name="pushButton_2"> <rect>
<property name="geometry"> <x>220</x>
<rect> <y>10</y>
<x>0</x> <width>72</width>
<y>0</y> <height>15</height>
<width>300</width> </rect>
<height>80</height> </property>
</rect> <property name="text">
</property> <string>TextLabel</string>
<property name="layoutDirection"> </property>
<enum>Qt::LeftToRight</enum> </widget>
</property> </widget>
<property name="autoFillBackground"> </widget>
<bool>false</bool> </item>
</property> <item>
<property name="text"> <widget class="QFrame" name="frame_2">
<string/> <property name="minimumSize">
</property> <size>
<property name="iconSize"> <width>500</width>
<size> <height>500</height>
<width>80</width> </size>
<height>80</height> </property>
</size> <property name="styleSheet">
</property> <string notr="true">background-color: #F5F5F5;</string>
</widget> </property>
<widget class="QLabel" name="label"> <property name="frameShape">
<property name="geometry"> <enum>QFrame::StyledPanel</enum>
<rect> </property>
<x>220</x> <property name="frameShadow">
<y>10</y> <enum>QFrame::Raised</enum>
<width>72</width> </property>
<height>15</height> <layout class="QVBoxLayout" name="verticalLayout" stretch="2,2,60,2,2,1">
</rect> <property name="leftMargin">
</property> <number>0</number>
<property name="text"> </property>
<string>TextLabel</string> <property name="topMargin">
</property> <number>5</number>
</widget> </property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QLabel" name="label_remark_2">
<property name="font">
<font>
<pointsize>12</pointsize>
</font>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QToolButton" name="toolButton_2">
<property name="text">
<string>...</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="Line" name="line_5">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
<widget class="QTextBrowser" name="message_2">
<property name="contextMenuPolicy">
<enum>Qt::ActionsContextMenu</enum>
</property>
<property name="styleSheet">
<string notr="true">background-color: #F5F5F5;</string>
</property>
</widget>
</item>
<item>
<widget class="Line" name="line_6">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
<widget class="QTextEdit" name="textEdit_2">
<property name="font">
<font>
<pointsize>15</pointsize>
</font>
</property>
<property name="autoFillBackground">
<bool>false</bool>
</property>
<property name="styleSheet">
<string notr="true">background-color: #F5F5F5;</string>
</property>
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="html">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot;
/&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'SimSun';
font-size:15pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px;
margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br
/&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;
</string>
</property>
<property name="overwriteMode">
<bool>false</bool>
</property>
<property name="tabStopWidth">
<number>80</number>
</property>
<property name="acceptRichText">
<bool>true</bool>
</property>
<property name="cursorWidth">
<number>1</number>
</property>
<property name="textInteractionFlags">
<set>Qt::TextEditorInteraction</set>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2" stretch="7,2">
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="btn_sendMsg_2">
<property name="font">
<font>
<family>黑体</family>
<pointsize>15</pointsize>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="cursor">
<cursorShape>ArrowCursor</cursorShape>
</property>
<property name="mouseTracking">
<bool>false</bool>
</property>
<property name="autoFillBackground">
<bool>false</bool>
</property>
<property name="styleSheet">
<string notr="true">QPushButton {
background-color:rgb(233,233,233);
padding: 10px;
color:rgb(5,180,104);}
QPushButton:hover{
background-color:rgb(198,198,198)}
</string>
</property>
<property name="text">
<string>发送</string>
</property>
<property name="iconSize">
<size>
<width>40</width>
<height>40</height>
</size>
</property>
<property name="checkable">
<bool>false</bool>
</property>
<property name="autoDefault">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
</layout>
</widget> </widget>
</widget> <resources/>
<widget class="QFrame" name="frame"> <connections/>
<property name="geometry">
<rect>
<x>321</x>
<y>0</y>
<width>801</width>
<height>720</height>
</rect>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<widget class="QTextBrowser" name="message">
<property name="geometry">
<rect>
<x>9</x>
<y>39</y>
<width>801</width>
<height>541</height>
</rect>
</property>
<property name="contextMenuPolicy">
<enum>Qt::ActionsContextMenu</enum>
</property>
<property name="styleSheet">
<string notr="true">background-color: #F5F5F5;</string>
</property>
</widget>
<widget class="QTextEdit" name="textEdit">
<property name="geometry">
<rect>
<x>9</x>
<y>579</y>
<width>821</width>
<height>141</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>15</pointsize>
</font>
</property>
<property name="html">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'SimSun'; font-size:15pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="tabStopWidth">
<number>80</number>
</property>
<property name="cursorWidth">
<number>1</number>
</property>
</widget>
<widget class="QPushButton" name="btn_sendMsg">
<property name="geometry">
<rect>
<x>680</x>
<y>670</y>
<width>121</width>
<height>51</height>
</rect>
</property>
<property name="font">
<font>
<family>黑体</family>
<pointsize>15</pointsize>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="cursor">
<cursorShape>ArrowCursor</cursorShape>
</property>
<property name="mouseTracking">
<bool>false</bool>
</property>
<property name="autoFillBackground">
<bool>false</bool>
</property>
<property name="styleSheet">
<string notr="true">QPushButton {
background-color: #f0f0f0;
padding: 10px;
color:rgb(5,180,104);
}</string>
</property>
<property name="text">
<string>发送</string>
</property>
<property name="iconSize">
<size>
<width>40</width>
<height>40</height>
</size>
</property>
<property name="checkable">
<bool>false</bool>
</property>
<property name="autoDefault">
<bool>true</bool>
</property>
</widget>
<widget class="QToolButton" name="toolButton">
<property name="geometry">
<rect>
<x>760</x>
<y>0</y>
<width>47</width>
<height>41</height>
</rect>
</property>
<property name="text">
<string>...</string>
</property>
</widget>
<widget class="Line" name="line_3">
<property name="geometry">
<rect>
<x>2</x>
<y>0</y>
<width>3</width>
<height>720</height>
</rect>
</property>
<property name="lineWidth">
<number>6</number>
</property>
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
<widget class="Line" name="line_2">
<property name="geometry">
<rect>
<x>9</x>
<y>30</y>
<width>831</width>
<height>20</height>
</rect>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
<widget class="QLabel" name="label_remark">
<property name="geometry">
<rect>
<x>30</x>
<y>0</y>
<width>351</width>
<height>41</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>12</pointsize>
</font>
</property>
<property name="text">
<string/>
</property>
</widget>
<widget class="Line" name="line">
<property name="geometry">
<rect>
<x>20</x>
<y>580</y>
<width>800</width>
<height>3</height>
</rect>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</widget>
</widget>
</widget>
<resources/>
<connections/>
</ui> </ui>

View File

@ -5,19 +5,20 @@ from PyQt5.QtGui import *
from PyQt5.QtWebEngineWidgets import QWebEngineView from PyQt5.QtWebEngineWidgets import QWebEngineView
from PyQt5.QtWidgets import * from PyQt5.QtWidgets import *
QCoreApplication.setAttribute(Qt.AA_UseSoftwareOpenGL)
from . import charts from . import charts
class AnalysisController(QWidget): class AnalysisController(QWidget):
def __init__(self, username): def __init__(self, username, parent=None):
super().__init__() super().__init__(parent)
self.ta_username = username self.ta_username = username
self.setWindowTitle('数据分析') self.setWindowTitle('数据分析')
self.setWindowIcon(QIcon('./app/data/icon.png')) self.setWindowIcon(QIcon('./app/data/icon.png'))
# self.setWindowFlag(Qt.FramelessWindowHint) # self.setWindowFlag(Qt.FramelessWindowHint)
# self.setStyleSheet('''QWidget{background-color:rgb(255, 255, 255);}''') self.setStyleSheet('''QWidget{background-color:rgb(255, 255, 255);}''')
# self.setBackground() # self.setBackground()
self.resize(400, 300) # self.resize(400, 300)
self.center() self.center()
self.setAttribute(Qt.WA_AttributeCount) self.setAttribute(Qt.WA_AttributeCount)
self.label_01() self.label_01()
@ -47,6 +48,7 @@ class AnalysisController(QWidget):
def initUI(self): def initUI(self):
self.label.setVisible(False) self.label.setVisible(False)
self.setStyleSheet('''QWidget{background-color:rgb(244, 244, 244);}''')
main_box = QHBoxLayout(self) main_box = QHBoxLayout(self)
self.browser1 = QWebEngineView() self.browser1 = QWebEngineView()
self.browser1.load(QUrl('file:///data/聊天统计/title.html')) self.browser1.load(QUrl('file:///data/聊天统计/title.html'))

View File

@ -286,7 +286,8 @@ def sport(username):
.set_global_opts( .set_global_opts(
title_opts=opts.TitleOpts(title="{}".format(months[i + 1].strftime("%Y-%m"))), title_opts=opts.TitleOpts(title="{}".format(months[i + 1].strftime("%Y-%m"))),
# legend_opts=opts.LegendOpts(is_show=False), # legend_opts=opts.LegendOpts(is_show=False),
yaxis_opts=opts.AxisOpts(is_inverse=True) yaxis_opts=opts.AxisOpts(is_inverse=True),
# xaxis_opts=opts.AxisOpts(type_='time')
) )
.set_series_opts( .set_series_opts(
label_opts=opts.LabelOpts( label_opts=opts.LabelOpts(
@ -307,7 +308,8 @@ def sport(username):
) )
.set_global_opts( .set_global_opts(
yaxis_opts=opts.AxisOpts(is_inverse=True) yaxis_opts=opts.AxisOpts(is_inverse=True),
# xaxis_opts=opts.AxisOpts(type_='time')
) )
.set_series_opts( .set_series_opts(
label_opts=opts.LabelOpts( label_opts=opts.LabelOpts(

View File

@ -8,13 +8,19 @@
@comment : ··· @comment : ···
""" """
import datetime import datetime
from PyQt5.QtWidgets import *
from PyQt5.QtCore import * from PyQt5.QtCore import *
from PyQt5.QtGui import * from PyQt5.QtGui import *
from .contactUi import * from PyQt5.QtWidgets import *
from ...DataBase import data, output
from .userinfo import userinfoUi
from .analysis import analysis from .analysis import analysis
from .contactUi import *
from .emotion import emotion
from .userinfo import userinfoUi
from ...DataBase import data, output
EMOTION = 1
ANALYSIS = 2
class ContactController(QWidget, Ui_Dialog): class ContactController(QWidget, Ui_Dialog):
@ -25,6 +31,8 @@ class ContactController(QWidget, Ui_Dialog):
def __init__(self, Me, parent=None): def __init__(self, Me, parent=None):
super(ContactController, self).__init__(parent) super(ContactController, self).__init__(parent)
self.emotionView = None
self.analysisView = None
self.chatroomFlag = None self.chatroomFlag = None
self.ta_avatar = None self.ta_avatar = None
self.setupUi(self) self.setupUi(self)
@ -42,18 +50,32 @@ class ContactController(QWidget, Ui_Dialog):
self.last_msg_time = 0 # 上次信息的时间 self.last_msg_time = 0 # 上次信息的时间
self.last_talkerId = None self.last_talkerId = None
self.now_talkerId = None self.now_talkerId = None
self.last_analysis = None
self.now_analysis = None
self.view_emotion = {}
self.view_analysis = {}
self.showContact() self.showContact()
self.userinfo = userinfoUi.Ui_Frame() # 联系人信息界面
self.userinfo.setupUi(self.frame) self.now_btn = self.userinfo
self.userinfo.btn_outbut.clicked.connect(self.output) self.last_btn = None
self.userinfo.progressBar.setVisible(False)
self.userinfo.btn_analysis.clicked.connect(self.analysis)
def initui(self): def initui(self):
self.btn_back.clicked.connect(self.back)
self.btn_output.clicked.connect(self.output)
self.btn_analysis.clicked.connect(self.analysis)
self.btn_emotion.clicked.connect(self.emotionale_Analysis)
self.qurl = QUrl('baidu.com') self.qurl = QUrl('baidu.com')
# self.urlSignal.connect(self.hyperlink) self.lay0 = QHBoxLayout()
# self.message.setOpenLinks(False) self.widget.setLayout(self.lay0)
# self.message.setOpenExternalLinks(False)
self.frame = QtWidgets.QFrame()
self.frame.setObjectName("frame")
self.userinfo = userinfoUi.Ui_Frame() # 联系人信息界面
self.userinfo.setupUi(self.frame)
# self.userinfo.btn_outbut.clicked.connect(self.output)
self.userinfo.progressBar.setVisible(False)
self.lay0.addWidget(self.frame)
# self.userinfo.btn_analysis.clicked.connect(self.analysis)
def showContact(self): def showContact(self):
""" """
@ -86,6 +108,8 @@ class ContactController(QWidget, Ui_Dialog):
:return: :return:
""" """
self.now_talkerId = talkerId self.now_talkerId = talkerId
self.frame.setVisible(True)
self.setViewVisible(self.now_talkerId)
# 把当前按钮设置为灰色 # 把当前按钮设置为灰色
if self.last_talkerId and self.last_talkerId != talkerId: if self.last_talkerId and self.last_talkerId != talkerId:
print('对方账号:', self.last_talkerId) print('对方账号:', self.last_talkerId)
@ -149,10 +173,70 @@ class ContactController(QWidget, Ui_Dialog):
聊天分析 聊天分析
:return: :return:
""" """
self.analysisView = analysis.AnalysisController(self.now_talkerId) self.frame.setVisible(False)
self.analysisView.show()
if self.now_talkerId in self.view_analysis:
self.setViewVisible(self.now_talkerId, mod=ANALYSIS)
return True
else:
self.setViewVisible(self.now_talkerId)
self.view_analysis[self.now_talkerId] = analysis.AnalysisController(self.now_talkerId)
self.lay0.addWidget(self.view_analysis[self.now_talkerId])
self.last_analysis = self.now_talkerId
def emotionale_Analysis(self):
print('情感分析', data.get_conRemark(self.now_talkerId))
self.frame.setVisible(False)
if self.now_talkerId in self.view_emotion:
self.setViewVisible(self.now_talkerId, mod=EMOTION)
return True
else:
self.setViewVisible(self.now_talkerId)
self.view_emotion[self.now_talkerId] = emotion.EmotionController(self.ta_username)
self.lay0.addWidget(self.view_emotion[self.now_talkerId])
self.last_analysis = self.now_talkerId
pass pass
def showUserinfo(self):
self.analysisView = analysis.AnalysisController(self.now_talkerId)
self.lay0 = QHBoxLayout()
self.widget.setLayout(self.lay0)
self.lay0.addWidget(self.analysisView)
def back(self):
self.frame.setVisible(True)
self.setViewVisible(self.now_talkerId)
def setViewVisible(self, wxid: str, mod=None):
"""将wxid的视图设置为可见"""
if not self.last_analysis:
return False
if mod == EMOTION:
for key, value in self.view_emotion.items():
# 如果key==wxid则将该视图设置为可见否则不可见
if key == wxid:
print(data.get_conRemark(wxid), '视图可见')
value.setVisible(True)
else:
print(data.get_conRemark(key), '视图不可见')
value.setVisible(False)
for key, value in self.view_analysis.items():
value.setVisible(False)
elif mod == ANALYSIS:
for key, value in self.view_analysis.items():
# 如果key==wxid则将该视图设置为可见否则不可见
if key == wxid:
value.setVisible(True)
else:
value.setVisible(False)
for key, value in self.view_emotion.items():
value.setVisible(False)
else:
for key, value in self.view_analysis.items():
value.setVisible(False)
for key, value in self.view_emotion.items():
value.setVisible(False)
class Contact(QtWidgets.QPushButton): class Contact(QtWidgets.QPushButton):
""" """
@ -235,6 +319,7 @@ class Contact(QtWidgets.QPushButton):
self.show_info(id) self.show_info(id)
def show_info(self, id): def show_info(self, id):
avatar = data.get_avator(self.username) avatar = data.get_avator(self.username)
# print(avatar) # print(avatar)
remark = data.get_conRemark(self.username) remark = data.get_conRemark(self.username)

View File

@ -14,18 +14,25 @@ from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_Dialog(object): class Ui_Dialog(object):
def setupUi(self, Dialog): def setupUi(self, Dialog):
Dialog.setObjectName("Dialog") Dialog.setObjectName("Dialog")
Dialog.resize(1120, 720) Dialog.resize(1141, 740)
Dialog.setCursor(QtGui.QCursor(QtCore.Qt.ArrowCursor)) Dialog.setCursor(QtGui.QCursor(QtCore.Qt.ArrowCursor))
Dialog.setAutoFillBackground(False) Dialog.setAutoFillBackground(False)
self.horizontalLayout = QtWidgets.QHBoxLayout(Dialog)
self.horizontalLayout.setContentsMargins(0, 0, 0, 0)
self.horizontalLayout.setSpacing(0)
self.horizontalLayout.setObjectName("horizontalLayout")
self.frame_2 = QtWidgets.QFrame(Dialog) self.frame_2 = QtWidgets.QFrame(Dialog)
self.frame_2.setGeometry(QtCore.QRect(0, 0, 1120, 720))
self.frame_2.setFrameShape(QtWidgets.QFrame.StyledPanel) self.frame_2.setFrameShape(QtWidgets.QFrame.StyledPanel)
self.frame_2.setFrameShadow(QtWidgets.QFrame.Raised) self.frame_2.setFrameShadow(QtWidgets.QFrame.Raised)
self.frame_2.setObjectName("frame_2") self.frame_2.setObjectName("frame_2")
self.horizontalLayout_2 = QtWidgets.QHBoxLayout(self.frame_2)
self.horizontalLayout_2.setContentsMargins(0, 0, 0, 0)
self.horizontalLayout_2.setSpacing(0)
self.horizontalLayout_2.setObjectName("horizontalLayout_2")
self.scrollArea = QtWidgets.QScrollArea(self.frame_2) self.scrollArea = QtWidgets.QScrollArea(self.frame_2)
self.scrollArea.setEnabled(True) self.scrollArea.setEnabled(True)
self.scrollArea.setGeometry(QtCore.QRect(0, 40, 326, 680)) self.scrollArea.setMinimumSize(QtCore.QSize(325, 0))
self.scrollArea.setMaximumSize(QtCore.QSize(400, 150000)) self.scrollArea.setMaximumSize(QtCore.QSize(325, 150000))
self.scrollArea.setAutoFillBackground(False) self.scrollArea.setAutoFillBackground(False)
self.scrollArea.setFrameShape(QtWidgets.QFrame.WinPanel) self.scrollArea.setFrameShape(QtWidgets.QFrame.WinPanel)
self.scrollArea.setFrameShadow(QtWidgets.QFrame.Raised) self.scrollArea.setFrameShadow(QtWidgets.QFrame.Raised)
@ -49,34 +56,43 @@ class Ui_Dialog(object):
self.label.setGeometry(QtCore.QRect(220, 10, 72, 15)) self.label.setGeometry(QtCore.QRect(220, 10, 72, 15))
self.label.setObjectName("label") self.label.setObjectName("label")
self.scrollArea.setWidget(self.scrollAreaWidgetContents) self.scrollArea.setWidget(self.scrollAreaWidgetContents)
self.horizontalLayout_2.addWidget(self.scrollArea)
self.frame = QtWidgets.QFrame(self.frame_2) self.frame = QtWidgets.QFrame(self.frame_2)
self.frame.setGeometry(QtCore.QRect(321, 0, 801, 720))
self.frame.setFrameShape(QtWidgets.QFrame.StyledPanel) self.frame.setFrameShape(QtWidgets.QFrame.StyledPanel)
self.frame.setFrameShadow(QtWidgets.QFrame.Raised) self.frame.setFrameShadow(QtWidgets.QFrame.Raised)
self.frame.setObjectName("frame") self.frame.setObjectName("frame")
self.line_3 = QtWidgets.QFrame(self.frame) self.verticalLayout = QtWidgets.QVBoxLayout(self.frame)
self.line_3.setGeometry(QtCore.QRect(2, 0, 3, 720)) self.verticalLayout.setObjectName("verticalLayout")
self.line_3.setLineWidth(6) self.horizontalLayout_3 = QtWidgets.QHBoxLayout()
self.line_3.setFrameShape(QtWidgets.QFrame.VLine) self.horizontalLayout_3.setObjectName("horizontalLayout_3")
self.line_3.setFrameShadow(QtWidgets.QFrame.Sunken)
self.line_3.setObjectName("line_3")
self.line_2 = QtWidgets.QFrame(self.frame)
self.line_2.setGeometry(QtCore.QRect(9, 30, 831, 20))
self.line_2.setFrameShape(QtWidgets.QFrame.HLine)
self.line_2.setFrameShadow(QtWidgets.QFrame.Sunken)
self.line_2.setObjectName("line_2")
self.label_remark = QtWidgets.QLabel(self.frame) self.label_remark = QtWidgets.QLabel(self.frame)
self.label_remark.setGeometry(QtCore.QRect(30, 0, 351, 41)) self.label_remark.setMaximumSize(QtCore.QSize(16777215, 100))
font = QtGui.QFont() font = QtGui.QFont()
font.setPointSize(12) font.setPointSize(12)
self.label_remark.setFont(font) self.label_remark.setFont(font)
self.label_remark.setText("") self.label_remark.setText("")
self.label_remark.setObjectName("label_remark") self.label_remark.setObjectName("label_remark")
self.line = QtWidgets.QFrame(self.frame) self.horizontalLayout_3.addWidget(self.label_remark)
self.line.setGeometry(QtCore.QRect(20, 580, 800, 3)) self.btn_analysis = QtWidgets.QPushButton(self.frame)
self.line.setFrameShape(QtWidgets.QFrame.HLine) self.btn_analysis.setObjectName("btn_analysis")
self.line.setFrameShadow(QtWidgets.QFrame.Sunken) self.horizontalLayout_3.addWidget(self.btn_analysis)
self.line.setObjectName("line") self.btn_emotion = QtWidgets.QPushButton(self.frame)
self.btn_emotion.setObjectName("btn_emotion")
self.horizontalLayout_3.addWidget(self.btn_emotion)
self.btn_output = QtWidgets.QPushButton(self.frame)
self.btn_output.setObjectName("btn_output")
self.horizontalLayout_3.addWidget(self.btn_output)
self.btn_back = QtWidgets.QPushButton(self.frame)
self.btn_back.setObjectName("btn_back")
self.horizontalLayout_3.addWidget(self.btn_back)
self.verticalLayout.addLayout(self.horizontalLayout_3)
self.widget = QtWidgets.QWidget(self.frame)
self.widget.setObjectName("widget")
self.verticalLayout.addWidget(self.widget)
self.verticalLayout.setStretch(0, 1)
self.verticalLayout.setStretch(1, 30)
self.horizontalLayout_2.addWidget(self.frame)
self.horizontalLayout.addWidget(self.frame_2)
self.retranslateUi(Dialog) self.retranslateUi(Dialog)
QtCore.QMetaObject.connectSlotsByName(Dialog) QtCore.QMetaObject.connectSlotsByName(Dialog)
@ -85,3 +101,7 @@ class Ui_Dialog(object):
_translate = QtCore.QCoreApplication.translate _translate = QtCore.QCoreApplication.translate
Dialog.setWindowTitle(_translate("Dialog", "Dialog")) Dialog.setWindowTitle(_translate("Dialog", "Dialog"))
self.label.setText(_translate("Dialog", "TextLabel")) self.label.setText(_translate("Dialog", "TextLabel"))
self.btn_analysis.setText(_translate("Dialog", "统计信息"))
self.btn_emotion.setText(_translate("Dialog", "情感分析"))
self.btn_output.setText(_translate("Dialog", "导出聊天记录"))
self.btn_back.setText(_translate("Dialog", "退出"))

View File

@ -1,208 +1,225 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0"> <ui version="4.0">
<class>Dialog</class> <class>Dialog</class>
<widget class="QDialog" name="Dialog"> <widget class="QDialog" name="Dialog">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>1120</width> <width>1141</width>
<height>720</height> <height>740</height>
</rect> </rect>
</property> </property>
<property name="cursor"> <property name="cursor">
<cursorShape>ArrowCursor</cursorShape> <cursorShape>ArrowCursor</cursorShape>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
<string>Dialog</string> <string>Dialog</string>
</property> </property>
<property name="autoFillBackground"> <property name="autoFillBackground">
<bool>false</bool> <bool>false</bool>
</property> </property>
<widget class="QFrame" name="frame_2"> <layout class="QHBoxLayout" name="horizontalLayout">
<property name="geometry"> <property name="spacing">
<rect> <number>0</number>
<x>0</x> </property>
<y>0</y> <property name="leftMargin">
<width>1120</width> <number>0</number>
<height>720</height> </property>
</rect> <property name="topMargin">
</property> <number>0</number>
<property name="frameShape"> </property>
<enum>QFrame::StyledPanel</enum> <property name="rightMargin">
</property> <number>0</number>
<property name="frameShadow"> </property>
<enum>QFrame::Raised</enum> <property name="bottomMargin">
</property> <number>0</number>
<widget class="QScrollArea" name="scrollArea"> </property>
<property name="enabled"> <item>
<bool>true</bool> <widget class="QFrame" name="frame_2">
</property> <property name="frameShape">
<property name="geometry"> <enum>QFrame::StyledPanel</enum>
<rect> </property>
<x>0</x> <property name="frameShadow">
<y>40</y> <enum>QFrame::Raised</enum>
<width>326</width> </property>
<height>680</height> <layout class="QHBoxLayout" name="horizontalLayout_2">
</rect> <property name="spacing">
</property> <number>0</number>
<property name="maximumSize"> </property>
<size> <property name="leftMargin">
<width>400</width> <number>0</number>
<height>150000</height> </property>
</size> <property name="topMargin">
</property> <number>0</number>
<property name="autoFillBackground"> </property>
<bool>false</bool> <property name="rightMargin">
</property> <number>0</number>
<property name="frameShape"> </property>
<enum>QFrame::WinPanel</enum> <property name="bottomMargin">
</property> <number>0</number>
<property name="frameShadow"> </property>
<enum>QFrame::Raised</enum> <item>
</property> <widget class="QScrollArea" name="scrollArea">
<property name="midLineWidth"> <property name="enabled">
<number>0</number> <bool>true</bool>
</property> </property>
<property name="verticalScrollBarPolicy"> <property name="minimumSize">
<enum>Qt::ScrollBarAlwaysOn</enum> <size>
</property> <width>325</width>
<property name="horizontalScrollBarPolicy"> <height>0</height>
<enum>Qt::ScrollBarAlwaysOff</enum> </size>
</property> </property>
<property name="sizeAdjustPolicy"> <property name="maximumSize">
<enum>QAbstractScrollArea::AdjustToContentsOnFirstShow</enum> <size>
</property> <width>325</width>
<property name="widgetResizable"> <height>150000</height>
<bool>false</bool> </size>
</property> </property>
<widget class="QWidget" name="scrollAreaWidgetContents"> <property name="autoFillBackground">
<property name="geometry"> <bool>false</bool>
<rect> </property>
<x>0</x> <property name="frameShape">
<y>0</y> <enum>QFrame::WinPanel</enum>
<width>300</width> </property>
<height>12000</height> <property name="frameShadow">
</rect> <enum>QFrame::Raised</enum>
</property> </property>
<widget class="QPushButton" name="pushButton_2"> <property name="midLineWidth">
<property name="geometry"> <number>0</number>
<rect> </property>
<x>0</x> <property name="verticalScrollBarPolicy">
<y>0</y> <enum>Qt::ScrollBarAlwaysOn</enum>
<width>300</width> </property>
<height>80</height> <property name="horizontalScrollBarPolicy">
</rect> <enum>Qt::ScrollBarAlwaysOff</enum>
</property> </property>
<property name="layoutDirection"> <property name="sizeAdjustPolicy">
<enum>Qt::LeftToRight</enum> <enum>QAbstractScrollArea::AdjustToContentsOnFirstShow</enum>
</property> </property>
<property name="autoFillBackground"> <property name="widgetResizable">
<bool>false</bool> <bool>false</bool>
</property> </property>
<property name="text"> <widget class="QWidget" name="scrollAreaWidgetContents">
<string/> <property name="geometry">
</property> <rect>
<property name="iconSize"> <x>0</x>
<size> <y>0</y>
<width>80</width> <width>300</width>
<height>80</height> <height>12000</height>
</size> </rect>
</property> </property>
</widget> <widget class="QPushButton" name="pushButton_2">
<widget class="QLabel" name="label"> <property name="geometry">
<property name="geometry"> <rect>
<rect> <x>0</x>
<x>220</x> <y>0</y>
<y>10</y> <width>300</width>
<width>72</width> <height>80</height>
<height>15</height> </rect>
</rect> </property>
</property> <property name="layoutDirection">
<property name="text"> <enum>Qt::LeftToRight</enum>
<string>TextLabel</string> </property>
</property> <property name="autoFillBackground">
</widget> <bool>false</bool>
</property>
<property name="text">
<string/>
</property>
<property name="iconSize">
<size>
<width>80</width>
<height>80</height>
</size>
</property>
</widget>
<widget class="QLabel" name="label">
<property name="geometry">
<rect>
<x>220</x>
<y>10</y>
<width>72</width>
<height>15</height>
</rect>
</property>
<property name="text">
<string>TextLabel</string>
</property>
</widget>
</widget>
</widget>
</item>
<item>
<widget class="QFrame" name="frame">
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QVBoxLayout" name="verticalLayout" stretch="1,30">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QLabel" name="label_remark">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>100</height>
</size>
</property>
<property name="font">
<font>
<pointsize>12</pointsize>
</font>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="btn_analysis">
<property name="text">
<string>统计信息</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="btn_emotion">
<property name="text">
<string>情感分析</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="btn_output">
<property name="text">
<string>导出聊天记录</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="btn_back">
<property name="text">
<string>退出</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QWidget" name="widget" native="true"/>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget> </widget>
</widget> <resources/>
<widget class="QFrame" name="frame"> <connections/>
<property name="geometry">
<rect>
<x>321</x>
<y>0</y>
<width>801</width>
<height>720</height>
</rect>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<widget class="Line" name="line_3">
<property name="geometry">
<rect>
<x>2</x>
<y>0</y>
<width>3</width>
<height>720</height>
</rect>
</property>
<property name="lineWidth">
<number>6</number>
</property>
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
<widget class="Line" name="line_2">
<property name="geometry">
<rect>
<x>9</x>
<y>30</y>
<width>831</width>
<height>20</height>
</rect>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
<widget class="QLabel" name="label_remark">
<property name="geometry">
<rect>
<x>30</x>
<y>0</y>
<width>351</width>
<height>41</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>12</pointsize>
</font>
</property>
<property name="text">
<string/>
</property>
</widget>
<widget class="Line" name="line">
<property name="geometry">
<rect>
<x>20</x>
<y>580</y>
<width>800</width>
<height>3</height>
</rect>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</widget>
</widget>
</widget>
<resources/>
<connections/>
</ui> </ui>

View File

View File

@ -0,0 +1,19 @@
<ui version="4.0">
<class>Dialog</class>
<widget class="QDialog" name="Dialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>300</height>
</rect>
</property>
<property name="windowTitle">
<string>Dialog</string>
</property>
</widget>
<resources/>
<connections/>
</ui>

View File

@ -13,12 +13,12 @@ from PyQt5.QtGui import *
from PyQt5.QtWidgets import * from PyQt5.QtWidgets import *
from app.DataBase import data from app.DataBase import data
from . import mainwindow
from .chat import chat from .chat import chat
from .contact import contact from .contact import contact
from .mainviewUi import *
class MainWinController(QMainWindow, Ui_Dialog): class MainWinController(QMainWindow, mainwindow.Ui_MainWindow):
exitSignal = pyqtSignal() exitSignal = pyqtSignal()
# username = '' # username = ''
@ -28,10 +28,22 @@ class MainWinController(QMainWindow, Ui_Dialog):
self.setWindowTitle('WeChat') self.setWindowTitle('WeChat')
self.setWindowIcon(QIcon('./app/data/icon.png')) self.setWindowIcon(QIcon('./app/data/icon.png'))
self.Me = data.get_myinfo() self.Me = data.get_myinfo()
self.chatView = chat.ChatController(self.Me, parent=self.frame_main) self.setAttribute(Qt.WA_AttributeCount)
self.chatView = chat.ChatController(self.Me, parent=None)
self.chatView.setVisible(False) self.chatView.setVisible(False)
self.contactView = contact.ContactController(self.Me, parent=self.frame_main) # self.chatView.setLayout()
self.lay = QHBoxLayout()
self.frame_main.setLayout(self.lay)
self.lay.addWidget(self.chatView)
# self.frame_main.setLayout(self.chatView)
# self.frame_main.setLayout()
self.contactView = contact.ContactController(self.Me, parent=None)
self.contactView.setVisible(False) self.contactView.setVisible(False)
self.lay0 = QHBoxLayout()
self.frame_main.setLayout(self.lay0)
self.lay.addWidget(self.contactView)
# self.myinfoView = userinfo.MyinfoController(self.Me, parent=self.frame_main) # self.myinfoView = userinfo.MyinfoController(self.Me, parent=self.frame_main)
# self.myinfoView.setVisible(False) # self.myinfoView.setVisible(False)
self.btn_chat.clicked.connect(self.chat_view) # 聊天按钮 self.btn_chat.clicked.connect(self.chat_view) # 聊天按钮

View File

@ -14,61 +14,70 @@ from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_Dialog(object): class Ui_Dialog(object):
def setupUi(self, Dialog): def setupUi(self, Dialog):
Dialog.setObjectName("Dialog") Dialog.setObjectName("Dialog")
Dialog.resize(1280, 720) Dialog.resize(1244, 738)
Dialog.setCursor(QtGui.QCursor(QtCore.Qt.ArrowCursor)) Dialog.setCursor(QtGui.QCursor(QtCore.Qt.ArrowCursor))
Dialog.setAutoFillBackground(False) Dialog.setAutoFillBackground(False)
self.frame_main = QtWidgets.QFrame(Dialog) self.frame_main = QtWidgets.QFrame(Dialog)
self.frame_main.setGeometry(QtCore.QRect(160, 0, 1120, 720)) self.frame_main.setGeometry(QtCore.QRect(115, 9, 1120, 720))
self.frame_main.setMinimumSize(QtCore.QSize(1120, 720))
self.frame_main.setLayoutDirection(QtCore.Qt.LeftToRight)
self.frame_main.setFrameShape(QtWidgets.QFrame.StyledPanel) self.frame_main.setFrameShape(QtWidgets.QFrame.StyledPanel)
self.frame_main.setFrameShadow(QtWidgets.QFrame.Raised) self.frame_main.setFrameShadow(QtWidgets.QFrame.Raised)
self.frame_main.setObjectName("frame_main") self.frame_main.setObjectName("frame_main")
self.frame_info = QtWidgets.QFrame(Dialog) self.frame_info = QtWidgets.QFrame(Dialog)
self.frame_info.setGeometry(QtCore.QRect(0, 0, 161, 721)) self.frame_info.setGeometry(QtCore.QRect(9, 9, 100, 720))
self.frame_info.setMinimumSize(QtCore.QSize(100, 500))
self.frame_info.setStyleSheet("background-color:rgb(240,240,240)") self.frame_info.setStyleSheet("background-color:rgb(240,240,240)")
self.frame_info.setFrameShape(QtWidgets.QFrame.StyledPanel) self.frame_info.setFrameShape(QtWidgets.QFrame.StyledPanel)
self.frame_info.setFrameShadow(QtWidgets.QFrame.Sunken) self.frame_info.setFrameShadow(QtWidgets.QFrame.Sunken)
self.frame_info.setObjectName("frame_info") self.frame_info.setObjectName("frame_info")
self.verticalLayoutWidget = QtWidgets.QWidget(self.frame_info) self.verticalLayoutWidget = QtWidgets.QWidget(self.frame_info)
self.verticalLayoutWidget.setGeometry(QtCore.QRect(20, 190, 111, 501)) self.verticalLayoutWidget.setGeometry(QtCore.QRect(0, 190, 91, 271))
self.verticalLayoutWidget.setObjectName("verticalLayoutWidget") self.verticalLayoutWidget.setObjectName("verticalLayoutWidget")
self.verticalLayout_2 = QtWidgets.QVBoxLayout(self.verticalLayoutWidget) self.verticalLayout_2 = QtWidgets.QVBoxLayout(self.verticalLayoutWidget)
self.verticalLayout_2.setContentsMargins(0, 0, 0, 0) self.verticalLayout_2.setContentsMargins(0, 0, 0, 0)
self.verticalLayout_2.setSpacing(0) self.verticalLayout_2.setSpacing(0)
self.verticalLayout_2.setObjectName("verticalLayout_2") self.verticalLayout_2.setObjectName("verticalLayout_2")
self.btn_chat = QtWidgets.QPushButton(self.verticalLayoutWidget) self.btn_chat = QtWidgets.QPushButton(self.verticalLayoutWidget)
self.btn_chat.setMinimumSize(QtCore.QSize(0, 80)) self.btn_chat.setMinimumSize(QtCore.QSize(0, 60))
self.btn_chat.setStyleSheet("QPushButton {background-color: rgb(240,240,240);}\n" self.btn_chat.setStyleSheet("QPushButton {background-color: rgb(240,240,240);}\n"
"QPushButton:hover{background-color: rgb(209,209,209);}") " QPushButton:hover{background-color: rgb(209,209,209);}\n"
" ")
self.btn_chat.setObjectName("btn_chat") self.btn_chat.setObjectName("btn_chat")
self.verticalLayout_2.addWidget(self.btn_chat) self.verticalLayout_2.addWidget(self.btn_chat)
self.btn_contact = QtWidgets.QPushButton(self.verticalLayoutWidget) self.btn_contact = QtWidgets.QPushButton(self.verticalLayoutWidget)
self.btn_contact.setMinimumSize(QtCore.QSize(0, 80)) self.btn_contact.setMinimumSize(QtCore.QSize(0, 60))
self.btn_contact.setStyleSheet("QPushButton {background-color: rgb(240,240,240);}\n" self.btn_contact.setStyleSheet("QPushButton {background-color: rgb(240,240,240);}\n"
"QPushButton:hover{background-color: rgb(209,209,209);}") " QPushButton:hover{background-color: rgb(209,209,209);}\n"
" ")
self.btn_contact.setObjectName("btn_contact") self.btn_contact.setObjectName("btn_contact")
self.verticalLayout_2.addWidget(self.btn_contact) self.verticalLayout_2.addWidget(self.btn_contact)
self.btn_myinfo = QtWidgets.QPushButton(self.verticalLayoutWidget) self.btn_myinfo = QtWidgets.QPushButton(self.verticalLayoutWidget)
self.btn_myinfo.setMinimumSize(QtCore.QSize(100, 80)) self.btn_myinfo.setMinimumSize(QtCore.QSize(60, 60))
self.btn_myinfo.setStyleSheet("QPushButton {background-color: rgb(240,240,240);}\n" self.btn_myinfo.setStyleSheet("QPushButton {background-color: rgb(240,240,240);}\n"
"QPushButton:hover{background-color: rgb(209,209,209);}") " QPushButton:hover{background-color: rgb(209,209,209);}\n"
" ")
self.btn_myinfo.setObjectName("btn_myinfo") self.btn_myinfo.setObjectName("btn_myinfo")
self.verticalLayout_2.addWidget(self.btn_myinfo) self.verticalLayout_2.addWidget(self.btn_myinfo)
self.btn_about = QtWidgets.QPushButton(self.verticalLayoutWidget) self.btn_about = QtWidgets.QPushButton(self.verticalLayoutWidget)
self.btn_about.setMinimumSize(QtCore.QSize(100, 80)) self.btn_about.setMinimumSize(QtCore.QSize(60, 60))
self.btn_about.setStyleSheet("QPushButton {background-color: rgb(240,240,240);}\n" self.btn_about.setStyleSheet("QPushButton {background-color: rgb(240,240,240);}\n"
"QPushButton:hover{background-color: rgb(209,209,209);}") " QPushButton:hover{background-color: rgb(209,209,209);}\n"
" ")
self.btn_about.setObjectName("btn_about") self.btn_about.setObjectName("btn_about")
self.verticalLayout_2.addWidget(self.btn_about) self.verticalLayout_2.addWidget(self.btn_about)
self.verticalLayout_2.setStretch(0, 1) self.verticalLayout_2.setStretch(0, 1)
self.verticalLayout_2.setStretch(1, 1)
self.verticalLayout_2.setStretch(2, 1) self.verticalLayout_2.setStretch(2, 1)
self.verticalLayout_2.setStretch(3, 1)
self.myavatar = QtWidgets.QLabel(self.frame_info) self.myavatar = QtWidgets.QLabel(self.frame_info)
self.myavatar.setGeometry(QtCore.QRect(30, 50, 100, 100)) self.myavatar.setGeometry(QtCore.QRect(10, 40, 80, 80))
self.myavatar.setObjectName("myavatar") self.myavatar.setObjectName("myavatar")
self.sign_up = QtWidgets.QPushButton(self.frame_info) self.sign_up = QtWidgets.QPushButton(self.frame_info)
self.sign_up.setGeometry(QtCore.QRect(0, 0, 71, 28)) self.sign_up.setGeometry(QtCore.QRect(0, 0, 40, 28))
self.sign_up.setObjectName("sign_up") self.sign_up.setObjectName("sign_up")
self.btn_destroy = QtWidgets.QPushButton(self.frame_info) self.btn_destroy = QtWidgets.QPushButton(self.frame_info)
self.btn_destroy.setGeometry(QtCore.QRect(80, 0, 71, 28)) self.btn_destroy.setGeometry(QtCore.QRect(50, 0, 40, 28))
self.btn_destroy.setObjectName("btn_destroy") self.btn_destroy.setObjectName("btn_destroy")
self.retranslateUi(Dialog) self.retranslateUi(Dialog)
@ -82,5 +91,5 @@ class Ui_Dialog(object):
self.btn_myinfo.setText(_translate("Dialog", "我的")) self.btn_myinfo.setText(_translate("Dialog", "我的"))
self.btn_about.setText(_translate("Dialog", "关于")) self.btn_about.setText(_translate("Dialog", "关于"))
self.myavatar.setText(_translate("Dialog", "avatar")) self.myavatar.setText(_translate("Dialog", "avatar"))
self.sign_up.setText(_translate("Dialog", "退出登录")) self.sign_up.setText(_translate("Dialog", "退出"))
self.btn_destroy.setText(_translate("Dialog", "注销账户")) self.btn_destroy.setText(_translate("Dialog", "注销"))

View File

@ -6,8 +6,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>1280</width> <width>1244</width>
<height>720</height> <height>738</height>
</rect> </rect>
</property> </property>
<property name="cursor"> <property name="cursor">
@ -22,12 +22,21 @@
<widget class="QFrame" name="frame_main"> <widget class="QFrame" name="frame_main">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>160</x> <x>115</x>
<y>0</y> <y>9</y>
<width>1120</width> <width>1120</width>
<height>720</height> <height>720</height>
</rect> </rect>
</property> </property>
<property name="minimumSize">
<size>
<width>1120</width>
<height>720</height>
</size>
</property>
<property name="layoutDirection">
<enum>Qt::LeftToRight</enum>
</property>
<property name="frameShape"> <property name="frameShape">
<enum>QFrame::StyledPanel</enum> <enum>QFrame::StyledPanel</enum>
</property> </property>
@ -38,12 +47,18 @@
<widget class="QFrame" name="frame_info"> <widget class="QFrame" name="frame_info">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>0</x> <x>9</x>
<y>0</y> <y>9</y>
<width>161</width> <width>100</width>
<height>721</height> <height>720</height>
</rect> </rect>
</property> </property>
<property name="minimumSize">
<size>
<width>100</width>
<height>500</height>
</size>
</property>
<property name="styleSheet"> <property name="styleSheet">
<string notr="true">background-color:rgb(240,240,240)</string> <string notr="true">background-color:rgb(240,240,240)</string>
</property> </property>
@ -56,13 +71,13 @@
<widget class="QWidget" name="verticalLayoutWidget"> <widget class="QWidget" name="verticalLayoutWidget">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>20</x> <x>0</x>
<y>190</y> <y>190</y>
<width>111</width> <width>91</width>
<height>501</height> <height>271</height>
</rect> </rect>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_2" stretch="1,0,1,0"> <layout class="QVBoxLayout" name="verticalLayout_2" stretch="1,1,1,1">
<property name="spacing"> <property name="spacing">
<number>0</number> <number>0</number>
</property> </property>
@ -71,7 +86,7 @@
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>0</width> <width>0</width>
<height>80</height> <height>60</height>
</size> </size>
</property> </property>
<property name="styleSheet"> <property name="styleSheet">
@ -89,7 +104,7 @@
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>0</width> <width>0</width>
<height>80</height> <height>60</height>
</size> </size>
</property> </property>
<property name="styleSheet"> <property name="styleSheet">
@ -106,8 +121,8 @@
<widget class="QPushButton" name="btn_myinfo"> <widget class="QPushButton" name="btn_myinfo">
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>100</width> <width>60</width>
<height>80</height> <height>60</height>
</size> </size>
</property> </property>
<property name="styleSheet"> <property name="styleSheet">
@ -124,8 +139,8 @@
<widget class="QPushButton" name="btn_about"> <widget class="QPushButton" name="btn_about">
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>100</width> <width>60</width>
<height>80</height> <height>60</height>
</size> </size>
</property> </property>
<property name="styleSheet"> <property name="styleSheet">
@ -143,10 +158,10 @@
<widget class="QLabel" name="myavatar"> <widget class="QLabel" name="myavatar">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>30</x> <x>10</x>
<y>50</y> <y>40</y>
<width>100</width> <width>80</width>
<height>100</height> <height>80</height>
</rect> </rect>
</property> </property>
<property name="text"> <property name="text">
@ -158,25 +173,25 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>71</width> <width>40</width>
<height>28</height> <height>28</height>
</rect> </rect>
</property> </property>
<property name="text"> <property name="text">
<string>退出登录</string> <string>退出</string>
</property> </property>
</widget> </widget>
<widget class="QPushButton" name="btn_destroy"> <widget class="QPushButton" name="btn_destroy">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>80</x> <x>50</x>
<y>0</y> <y>0</y>
<width>71</width> <width>40</width>
<height>28</height> <height>28</height>
</rect> </rect>
</property> </property>
<property name="text"> <property name="text">
<string>注销账户</string> <string>注销</string>
</property> </property>
</widget> </widget>
</widget> </widget>

251
app/Ui/mainwindow.ui Normal file
View File

@ -0,0 +1,251 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>MainWindow</class>
<widget class="QMainWindow" name="MainWindow">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>1280</width>
<height>779</height>
</rect>
</property>
<property name="windowTitle">
<string>MainWindow</string>
</property>
<widget class="QWidget" name="centralwidget">
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="spacing">
<number>0</number>
</property>
<property name="leftMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<item>
<widget class="QFrame" name="frame_info">
<property name="minimumSize">
<size>
<width>100</width>
<height>500</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>100</width>
<height>16777215</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">background-color:rgb(240,240,240)</string>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Sunken</enum>
</property>
<widget class="QWidget" name="verticalLayoutWidget">
<property name="geometry">
<rect>
<x>0</x>
<y>190</y>
<width>91</width>
<height>271</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2" stretch="1,1,1,1">
<property name="spacing">
<number>0</number>
</property>
<item>
<widget class="QPushButton" name="btn_chat">
<property name="minimumSize">
<size>
<width>0</width>
<height>60</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">QPushButton {background-color: rgb(240,240,240);}
QPushButton:hover{background-color: rgb(209,209,209);}
</string>
</property>
<property name="text">
<string>聊天</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="btn_contact">
<property name="minimumSize">
<size>
<width>0</width>
<height>60</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">QPushButton {background-color: rgb(240,240,240);}
QPushButton:hover{background-color: rgb(209,209,209);}
</string>
</property>
<property name="text">
<string>联系人</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="btn_myinfo">
<property name="minimumSize">
<size>
<width>60</width>
<height>60</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">QPushButton {background-color: rgb(240,240,240);}
QPushButton:hover{background-color: rgb(209,209,209);}
</string>
</property>
<property name="text">
<string>我的</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="btn_about">
<property name="minimumSize">
<size>
<width>60</width>
<height>60</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">QPushButton {background-color: rgb(240,240,240);}
QPushButton:hover{background-color: rgb(209,209,209);}
</string>
</property>
<property name="text">
<string>关于</string>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QLabel" name="myavatar">
<property name="geometry">
<rect>
<x>10</x>
<y>40</y>
<width>80</width>
<height>80</height>
</rect>
</property>
<property name="text">
<string>avatar</string>
</property>
</widget>
<widget class="QPushButton" name="sign_up">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>40</width>
<height>28</height>
</rect>
</property>
<property name="text">
<string>退出</string>
</property>
</widget>
<widget class="QPushButton" name="btn_destroy">
<property name="geometry">
<rect>
<x>50</x>
<y>0</y>
<width>40</width>
<height>28</height>
</rect>
</property>
<property name="text">
<string>注销</string>
</property>
</widget>
</widget>
</item>
<item>
<widget class="QFrame" name="frame_main">
<property name="minimumSize">
<size>
<width>1120</width>
<height>720</height>
</size>
</property>
<property name="layoutDirection">
<enum>Qt::LeftToRight</enum>
</property>
<property name="frameShape">
<enum>QFrame::Box</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QMenuBar" name="menubar">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>1280</width>
<height>23</height>
</rect>
</property>
<widget class="QMenu" name="menu_F">
<property name="title">
<string>文件(F)</string>
</property>
<addaction name="separator"/>
<addaction name="separator"/>
<addaction name="action_3"/>
<addaction name="action_4"/>
</widget>
<widget class="QMenu" name="menu">
<property name="title">
<string>编辑</string>
</property>
</widget>
<widget class="QMenu" name="menu_2">
<property name="title">
<string>帮助</string>
</property>
<addaction name="action"/>
</widget>
<addaction name="menu_F"/>
<addaction name="menu"/>
<addaction name="menu_2"/>
</widget>
<widget class="QStatusBar" name="statusbar"/>
<action name="action_3">
<property name="text">
<string>保存</string>
</property>
</action>
<action name="action_4">
<property name="text">
<string>退出</string>
</property>
</action>
<action name="action">
<property name="text">
<string>关于</string>
</property>
</action>
</widget>
<resources/>
<connections/>
</ui>

12
main.py
View File

@ -7,12 +7,16 @@ from app.Ui import *
# #
class ViewController: class ViewController:
def __init__(self):
self.viewMainWIn = None
self.viewDecrypt = None
def loadDecryptView(self): def loadDecryptView(self):
""" """
登录界面 登录界面
:return: :return:
""" """
self.viewDecrypt = decrypt.DecryptControl() # 需要将viewlogin设为成员变量 self.viewDecrypt = decrypt.DecryptControl() # 需要将view login设为成员变量
self.viewDecrypt.DecryptSignal.connect(self.loadMainWinView) self.viewDecrypt.DecryptSignal.connect(self.loadMainWinView)
self.viewDecrypt.registerSignal.connect(self.loadRegisterView) self.viewDecrypt.registerSignal.connect(self.loadRegisterView)
self.viewDecrypt.show() self.viewDecrypt.show()
@ -24,7 +28,7 @@ class ViewController:
:return: :return:
""" """
pass pass
# self.viewDecrypt = register.registerControl() # 需要将viewlogin设为成员变量 # self.viewDecrypt = register.registerControl() # 需要将view login设为成员变量
# self.viewDecrypt.DecryptSignal.connect(self.loadDecryptView) # self.viewDecrypt.DecryptSignal.connect(self.loadDecryptView)
# self.viewDecrypt.show() # self.viewDecrypt.show()
@ -47,6 +51,6 @@ class ViewController:
if __name__ == '__main__': if __name__ == '__main__':
app = QApplication(sys.argv) app = QApplication(sys.argv)
view = ViewController() view = ViewController()
view.loadDecryptView() # 进入登录界面如果viewlogin不是成员变量则离开作用域后失效。 # view.loadDecryptView() # 进入登录界面如果view login不是成员变量则离开作用域后失效。
# view.loadMainWinView('102') view.loadMainWinView('102')
sys.exit(app.exec_()) sys.exit(app.exec_())

149
test.html
View File

@ -1,149 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<style type="text/css">
.mobile-page .admin-reply{
box-shadow: 0px 0px 2px #ddd;
}
.mobile-page .user-msg, .mobile-page .admin-msg{
width: 75%;
position: relative;
}
</style>
</head>
<body>
<div>
<table align="right" style="vertical-align: middle;">
<tbody>
<tr>
<td style="border: 1px #000000 solid;" height="150">
<a href="%s" target="_blank">
<img herf="baidu.com" align="right" src="./app/data/image2/ff/92/ff921ad247c22e77b9da5aadf2fd8a5e.jpg
" style="max-height:100%">
</a>
</td>
<td></td>
<td rowspan="2" style="border: 1px #000000 solid">
<a href="D:\Project\Python\WeChatMsg\app\data\icon.png" target="_blank">
<img align="right" src="./app/data/avatar/2a/42/user_2a427a26f96058921da245444ab542f5.png"
width="45" height="45"/>
</a>
</td>
<td rowspan="2">ADC</td>
</tr>
>
<tr>
<td style="background-color: #9EEA6A;right: 4px;border-radius: 4px;">
%s 13245:
</td>
<td width="55" style=""></td>
<!-- <td style="border: 1px #000000 solid"><img align="right" src="./app/data/avatar/2a/42/user_2a427a26f96058921da245444ab542f5.png" width="45" height="45"/></td>-->
<td width="15"></td>
</tr>
</tbody>
</table>
</div>
</body>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<table height="300" width="300" border="1">
<caption>我是标题</caption>
<thead>
<tr>
<th>英雄</th>
<th>性别</th>
<th>职业</th>
</tr>
</thead>
<tbody>
<tr>
<td>亚索</td>
<td></td>
<td>中单</td>
</tr>
<tr>
<td>卡莎</td>
<td></td>
<td rowspan="2">ADC</td>
</tr>
<tr>
<td>寒冰</td>
<td></td>
</tr>
</tbody>
</table>
</body>
</html>
<!-- <body>
<div class="mobile-page">
<div class="user-group" style="padding: 6px;
display: flex;
display: -webkit-flex;
justify-content: flex-end;
-webkit-justify-content: flex-end;
">
<div class="user-msg" style="text-align: right;
width: 75%;
position: relative;">
<span class="user-reply" style="display: inline-block;
padding: 8px;
border-radius: 4px;
margin:0 15px 12px;
text-align: left;
background-color: #9EEA6A;
box-shadow: 0px 0px 2px #bbb;
">我要抢楼</span>
<i style="width: 0;
height: 0;
position: absolute;
top: 10px;
display: inline-block;
border-top: 10px solid transparent;
border-bottom: 10px solid transparent;
right: 4px;
border-left: 12px solid #9EEA6A;"></i>
</div>
<img class="user-img" src="./app/data/avatar/2a/42/user_2a427a26f96058921da245444ab542f5.png" width="45px" height="45px";/>
</div>
<div class="admin-group">
<img class="admin-img" src="http://localhost/public/img/aa.jpg"/>
<div class="admin-msg">
<i class="triangle-admin"></i>
<span class="admin-reply">欢迎来抢楼!欢迎来抢楼!欢迎来抢楼!欢迎来抢楼!欢迎来抢楼!欢迎来抢楼!欢迎来抢楼!</span>
</div>
</div>
<div class="user-group">
<div class="user-msg">
<span class="user-reply">我要抢楼我要抢楼我要抢楼。</span>
<i class="triangle-user"></i>
</div>
<img class="user-img" src="img/cc.jpg"/>
</div>
<div class="admin-group">
<img class="admin-img" src="./app/data/avatar/2a/42/user_2a427a26f96058921da245444ab542f5.png"/>
<div class="admin-msg">
<i class="triangle-admin"></i>
<span class="admin-reply">欢迎来抢楼!欢迎来抢楼!欢迎来抢楼!欢迎来抢楼!欢迎来抢楼!欢迎来抢楼!</span>
</div>
</div>
</div>
</body> -->
</html>

View File

@ -1,55 +0,0 @@
<html>
<head>
<meta charset="UTF-8">
<title>聊天时间</title>
<style>
<style type="text/css">
#nav {
height: 40px;
margin-top: 50px;
background-color: #690;
}
#nav ul {
list-style: none;
margin-left: 50px;
}
#nav li {
display: block;
float: left;
}
#nav a {
line-height: 40px;
display: block;
color: #fff;
text-decoration: none;
padding: 0 20px;
}
#nav a:hover {
background-color: #060;
}
#menu li {
float:left; /* 往左浮动 */
}
</style>
</head>
<body>
<div>
你好
</div>
<div>
<ul id="menu">
<li><a href="http://www.baidu.com">Baidu.Com</a></li>
<li><a href="http://www.Code52.Net">Code52.Net</a></li>
<li><a href="http://www.yahoo.com">Yahoo.com</a></li>
<li><a href="http://www.google.com" class="last">Google.com</a></li>
</ul>
</div>
</body>
</html>