diff --git a/app/ui/contact/contactInfo.py b/app/ui/contact/contactInfo.py index 0d11f1e..df09a99 100644 --- a/app/ui/contact/contactInfo.py +++ b/app/ui/contact/contactInfo.py @@ -60,11 +60,7 @@ class ContactInfo(QWidget, Ui_Form): self.toolButton_output.showMenu() def analysis(self): - QMessageBox.warning(self, - "别急别急", - "马上就实现该功能" - ) - return + QDesktopServices.openUrl(QUrl("https://memotrace.lc044.love/")) def annual_report(self): if 'room' in self.contact.wxid: @@ -81,17 +77,7 @@ class ContactInfo(QWidget, Ui_Form): QDesktopServices.openUrl(QUrl("http://127.0.0.1:21314/christmas")) def emotionale_Analysis(self): - if 'room' in self.contact.wxid: - QMessageBox.warning( - self, '警告', - '暂不支持群组' - ) - return - QMessageBox.warning(self, - "别急别急", - "马上就实现该功能" - ) - return + QDesktopServices.openUrl(QUrl("https://memotrace.lc044.love/")) def back(self): """ diff --git a/app/web_ui/templates/christmas.html b/app/web_ui/templates/christmas.html index 1bcb794..44b1ea4 100644 --- a/app/web_ui/templates/christmas.html +++ b/app/web_ui/templates/christmas.html @@ -7,9 +7,9 @@ - + - +
diff --git a/app/web_ui/web.py b/app/web_ui/web.py index e579f57..f6feabf 100644 --- a/app/web_ui/web.py +++ b/app/web_ui/web.py @@ -1,6 +1,7 @@ import os import sys +import requests from flask import Flask, render_template, send_file from app.DataBase import msg_db @@ -13,6 +14,9 @@ app = Flask(__name__) wxid = '' contact: Contact = None +html: str = '' +api_url = 'http://api.lc044.love/upload' + @app.route("/") def index(): @@ -28,8 +32,8 @@ def christmas(): except TypeError: first_time = '2023-01-01 00:00:00' data = { - 'ta_avatar_path': contact.avatar_path, - 'my_avatar_path': Me().avatar_path, + 'ta_avatar_path': contact.smallHeadImgUrl, + 'my_avatar_path': Me().smallHeadImgUrl, 'ta_nickname': contact.remark, 'my_nickname': Me().name, 'first_time': first_time, @@ -84,8 +88,11 @@ def christmas(): 'emoji_url': url, 'emoji_num': num, } - return render_template("christmas.html", **data, **wordcloud_cloud_data, **time_data, **month_data, **calendar_data, + global html + html = render_template("christmas.html", **data, **wordcloud_cloud_data, **time_data, **month_data, **calendar_data, **emoji_data) + return html + @app.route('/home') def home(): @@ -103,6 +110,19 @@ def home(): return render_template('home.html', **data) +@app.route('/upload') +def upload(): + global html + data = { + 'html_content': html, + 'wxid': contact.wxid, + 'username': Me().wxid, + } + response = requests.post(api_url, data=data) + print(response.json()) + return response.json() + + @app.route('/wordcloud/