mirror of
https://github.com/LC044/WeChatMsg
synced 2025-02-22 10:52:18 +08:00
增加年度报告分享重复上传判断
This commit is contained in:
parent
36bf9a1b3c
commit
1f9f478ed3
@ -5,6 +5,7 @@ from app.DataBase import msg_db, MsgType
|
|||||||
from pyecharts import options as opts
|
from pyecharts import options as opts
|
||||||
from pyecharts.charts import WordCloud, Calendar, Bar, Line
|
from pyecharts.charts import WordCloud, Calendar, Bar, Line
|
||||||
|
|
||||||
|
|
||||||
def wordcloud_(wxid, time_range=None):
|
def wordcloud_(wxid, time_range=None):
|
||||||
import jieba
|
import jieba
|
||||||
txt_messages = msg_db.get_messages_by_type(wxid, MsgType.TEXT, time_range=time_range)
|
txt_messages = msg_db.get_messages_by_type(wxid, MsgType.TEXT, time_range=time_range)
|
||||||
@ -64,7 +65,7 @@ def wordcloud_christmas(wxid, year='2023'):
|
|||||||
txt_messages = msg_db.get_messages_by_type(wxid, MsgType.TEXT, year)
|
txt_messages = msg_db.get_messages_by_type(wxid, MsgType.TEXT, year)
|
||||||
if not txt_messages:
|
if not txt_messages:
|
||||||
return {
|
return {
|
||||||
'chart_data': None,
|
'wordcloud_chart_data': None,
|
||||||
'keyword': "没有聊天你想分析啥",
|
'keyword': "没有聊天你想分析啥",
|
||||||
'max_num': '0',
|
'max_num': '0',
|
||||||
'dialogs': [],
|
'dialogs': [],
|
||||||
@ -116,7 +117,14 @@ def wordcloud_christmas(wxid, year='2023'):
|
|||||||
|
|
||||||
|
|
||||||
def calendar_chart(wxid, time_range=None):
|
def calendar_chart(wxid, time_range=None):
|
||||||
calendar_data = msg_db.get_messages_by_days(wxid,time_range)
|
calendar_data = msg_db.get_messages_by_days(wxid, time_range)
|
||||||
|
if not calendar_data:
|
||||||
|
return {
|
||||||
|
'chart_data': None,
|
||||||
|
'calendar_chart_data': None,
|
||||||
|
'chat_days': 0,
|
||||||
|
# 'chart':c,
|
||||||
|
}
|
||||||
min_ = min(map(lambda x: x[1], calendar_data))
|
min_ = min(map(lambda x: x[1], calendar_data))
|
||||||
max_ = max(map(lambda x: x[1], calendar_data))
|
max_ = max(map(lambda x: x[1], calendar_data))
|
||||||
start_date_ = calendar_data[0][0]
|
start_date_ = calendar_data[0][0]
|
||||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -185,8 +185,8 @@ class DecryptControl(QWidget, decryptUi.Ui_Dialog, QCursorGif):
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
os.makedirs('./app/data', exist_ok=True)
|
os.makedirs('./app/data', exist_ok=True)
|
||||||
with open('./app/data/info.json', 'w', encoding='utf-8') as f:
|
with open('./app/data/info.json', "w", encoding="utf-8") as f:
|
||||||
f.write(json.dumps(dic))
|
json.dump(dic, f, ensure_ascii=False, indent=4)
|
||||||
except:
|
except:
|
||||||
with open('./info.json', 'w', encoding='utf-8') as f:
|
with open('./info.json', 'w', encoding='utf-8') as f:
|
||||||
f.write(json.dumps(dic))
|
f.write(json.dumps(dic))
|
||||||
|
@ -229,14 +229,14 @@
|
|||||||
<div id="calendar-chart" class="calendar-chart"></div>
|
<div id="calendar-chart" class="calendar-chart"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="section" style="text-align: center;display:flex;justify-content: center;align-items: center;">
|
<div class="section" style="text-align: center;display:flex;justify-content: center;align-items: center;">
|
||||||
<h1 style="text-align: center;">敬请期待</h1>
|
|
||||||
<a href="https://memotrace.lc044.love/" target="_blank">点击生成我的年度聊天报告</a>
|
|
||||||
<h1>分享此页面</h1>
|
<h1>分享此页面</h1>
|
||||||
|
<div>
|
||||||
|
<a id="share" href="https://memotrace.lc044.love/" target="_blank">https://memotrace.lc044.love/</a>
|
||||||
|
</div>
|
||||||
<button onclick="confirmUpload()">上传并显示二维码</button>
|
<button onclick="confirmUpload()">上传并显示二维码</button>
|
||||||
|
|
||||||
<div id="qrcode"></div>
|
<div id="qrcode"></div>
|
||||||
<a href="https://memotrace.lc044.love/" target="_blank">https://memotrace.lc044.love/</a>
|
<a href="https://memotrace.lc044.love/" target="_blank">点击生成我的年度聊天报告</a>
|
||||||
</div>
|
</div>
|
||||||
<!-- Add more sections as needed -->
|
<!-- Add more sections as needed -->
|
||||||
</div>
|
</div>
|
||||||
@ -261,7 +261,10 @@
|
|||||||
if (data.success) {
|
if (data.success) {
|
||||||
displayQRCode(data.url);
|
displayQRCode(data.url);
|
||||||
} else {
|
} else {
|
||||||
alert('错误: 数据错误,可能您的上传次数已达上限,请联系作者:863909694@qq.com增加上传次数');
|
if(data.code==201){
|
||||||
|
displayQRCode(data.url);
|
||||||
|
alert(data.errmsg);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
@ -276,6 +279,10 @@
|
|||||||
width: 128,
|
width: 128,
|
||||||
height: 128
|
height: 128
|
||||||
});
|
});
|
||||||
|
var aObj = document.getElementById("share");
|
||||||
|
aObj.href = url;
|
||||||
|
//根据id获取超链接,设置文字内容
|
||||||
|
aObj.innerText = url;
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<script>
|
<script>
|
||||||
|
Loading…
Reference in New Issue
Block a user