From 1d61e5f74ea0fe35a7370881be1fc9ebce93af3d Mon Sep 17 00:00:00 2001 From: lik Date: Fri, 5 Jun 2026 05:31:22 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=BA=86=E6=9C=8B=E5=8F=8B?= =?UTF-8?q?=E5=9C=88=E8=BD=AC=E5=8F=91=E5=8A=9F=E8=83=BD=EF=BC=9B=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E4=BA=86AI=E8=81=8A=E5=A4=A9markdown=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E6=94=AF=E6=8C=81=EF=BC=9B=E5=A2=9E=E5=8A=A0=E4=BA=86?= =?UTF-8?q?=E6=96=B0=E7=89=88=E6=9C=AC=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.js | 38 +++++++++++- pages/ai/aichat.json | 3 +- pages/ai/aichat.wxml | 14 ++++- pages/ai/aichat.wxss | 8 +++ pages/escort/itemlist.js | 13 +++++ pages/home/index.js | 121 ++++++++++++++++++++++++++++++++------- pages/mine/about.js | 13 +++++ 7 files changed, 183 insertions(+), 27 deletions(-) diff --git a/app.js b/app.js index 0bad1a0..13fc9b3 100644 --- a/app.js +++ b/app.js @@ -58,7 +58,9 @@ App({ console.error('获取科室排名失败', err) resolve([]) }) - }) + }) + + this.checkUpdate(); }, onShow(options) { @@ -66,7 +68,9 @@ App({ wx.login({ success: res => { if (res.code) { - request.post('https://api.huashengtec.com/user/wxsignin', { code: res.code }) + request.post('https://api.huashengtec.com/user/wxsignin', { + code: res.code + }) .then((data) => { if (data.code == 0) { this.globalData.user = data.data.user @@ -110,6 +114,36 @@ App({ this.globalData.chatSocket = socket }, + checkUpdate() { + // 获取小程序更新管理器实例 + const updateManager = wx.getUpdateManager(); + + // 监听检查更新事件,当小程序有新版本时会触发此回调 + updateManager.onCheckForUpdate(function (res) { + // 请求完新版本信息的回调 + console.log(res.hasUpdate); // 打印是否有新版本 + }); + + // 监听更新准备就绪事件,当新版本下载完成时会触发此回调 + updateManager.onUpdateReady(function () { + wx.showModal({ + title: '更新提示', + content: '新版本已经准备好,可以重启应用小程序了!', + success(res) { + if (res.confirm) { + // 用户确认更新,调用 applyUpdate 应用新版本并重启小程序 + updateManager.applyUpdate(); + } + } + }); + }); + + // 监听更新失败事件,当新版本下载失败时会触发此回调 + updateManager.onUpdateFailed(function () { + // 新版本下载失败,可以在这里处理失败逻辑,例如提示用户稍后再试 + }); + }, + globalData: { appId: '', user: null, diff --git a/pages/ai/aichat.json b/pages/ai/aichat.json index 813e909..1b8c9d4 100644 --- a/pages/ai/aichat.json +++ b/pages/ai/aichat.json @@ -1,6 +1,7 @@ { "navigationBarTitleText": "AI陪诊助手", "usingComponents": { - "t-icon": "tdesign-miniprogram/icon/icon" + "t-icon": "tdesign-miniprogram/icon/icon", + "t-chat-markdown": "tdesign-miniprogram/chat-markdown/chat-markdown" } } \ No newline at end of file diff --git a/pages/ai/aichat.wxml b/pages/ai/aichat.wxml index a2a9ff2..12c37a4 100644 --- a/pages/ai/aichat.wxml +++ b/pages/ai/aichat.wxml @@ -39,7 +39,12 @@ - {{item.content}} + + {{item.content}} - {{item.content}} + + {{item.content}}