diff --git a/index.html b/index.html
index 1bf8a2b..c717f87 100755
--- a/index.html
+++ b/index.html
@@ -38,13 +38,18 @@
font-size: 15px;
opacity: 0;
transition: opacity 0.3s ease;
- z-index: 9999;
+ z-index: 9999999999;
}
.toast.show {
opacity: 1;
}
+ .toast.success {
+ background-color: #09db45;
+ }
+
+
/* 侧边栏 */
.sidebar {
width: 240px;
@@ -55,6 +60,7 @@
transition: all 0.3s ease;
box-shadow: 2px 0 5px rgba(0, 0, 0, 0.04);
z-index: 10;
+ height: 100%;
}
.sidebar.collapsed {
@@ -172,7 +178,8 @@
flex-direction: column;
background: #f9fcff;
justify-content: space-between;
- width: calc(100% - 240px)
+ width: calc(100% - 240px);
+ height: 100%;
}
.chat-container .content {
@@ -520,6 +527,7 @@
/* 手机端适配 */
@media (max-width: 768px) {
+
.mobilelogo {
display: flex;
@@ -543,6 +551,7 @@
position: absolute;
top: 10px;
height: 100%;
+ left: 0px;
}
.sidebar.sidebar.collapsed>.toggle-btn {
@@ -752,6 +761,105 @@
display: none;
}
+
@@ -910,6 +1018,51 @@
+
+
+
+
+
@@ -1127,10 +1280,10 @@
console.error("请求异常:", err);
}
}
- function showToast(message) {
+ function showToast(message, type = '') {
// 创建元素
const toast = document.createElement("div");
- toast.className = "toast";
+ toast.className = `toast${type == "success" ? " success" : ""}`;
toast.innerText = message;
document.body.appendChild(toast);
@@ -1242,6 +1395,34 @@
});
setTimeout(scrollToBottom, 0);
}
+ function setCookie(name, value) {
+ const d = new Date();
+ d.setFullYear(d.getFullYear() + 100); // +100 年
+ document.cookie = `${name}=${value};expires=${d.toUTCString()};path=/`;
+ }
+ function getCookie(name) {
+ const cookies = document.cookie.split("; ");
+ for (let c of cookies) {
+ const [key, val] = c.split("=");
+ if (key === name) return val;
+ }
+ return null;
+ }
+
+ function showPop(userId) {
+ if (!userId) {
+ console.error("userId 缺失,无法记录点击次数");
+ return;
+ }
+ const cookieName = `popupClickCount_${userId}`;
+ let clickCount = parseInt(getCookie(cookieName) || "0", 10);
+ clickCount++;
+ setCookie(cookieName, clickCount, 7);
+ console.log(`用户 ${userId} 当前点击次数:`, clickCount);
+ if (clickCount == 10) {
+ document.querySelector(".popbgc").classList.remove("none");
+ }
+ }
// 内容 角色 图片 创造时间
function addMessage(content = '', role = "assistant", imgUrl = null, time = null) {
const msg = document.createElement("div");
@@ -1391,6 +1572,7 @@
const decoder = new TextDecoder("utf-8");
let buffer = "";
msgDiv.classList.remove("thinking");
+ showPop(userId);
clearInterval(interval);
console.log(isStopped, '是否点击停止')
@@ -1749,6 +1931,80 @@
}
});
+
+