优化聊天:配对群组、稳定连接、消息列表与订单详情跳转

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
XingQue
2026-06-23 22:48:42 +08:00
parent 5e90f7c87c
commit 1ea106f101
8 changed files with 365 additions and 365 deletions

View File

@@ -131,7 +131,9 @@ function ensureConnection(app) {
function getSavedConnection(app) {
try {
const saved = wx.getStorageSync(app.globalData.goEasyConnection.cacheKeys.savedConnection);
return saved ? JSON.parse(saved) : null;
if (!saved) return null;
if (typeof saved === 'string') return JSON.parse(saved);
return saved;
} catch (error) {
console.error('获取保存的连接信息失败:', error);
return null;
@@ -583,8 +585,9 @@ function updateCurrentPageState(app) {
const pages = getCurrentPages();
if (pages.length > 0) {
const currentPage = pages[pages.length - 1];
const chatPages = ['pages/liaotian/liaotian', 'pages/qunliaotian/qunliaotian', 'pages/kefuliaotian/kefuliaotian'];
app.globalData.pageState.currentPage = currentPage.route;
app.globalData.pageState.isInChatPage = currentPage.route === 'pages/liaotian/liaotian';
app.globalData.pageState.isInChatPage = chatPages.indexOf(currentPage.route) >= 0;
app.globalData.pageState.lastPageUpdate = Date.now();
}
} catch (error) {