From 362861f34f7914bb848b4bad4725f9f8a68a87b3 Mon Sep 17 00:00:00 2001 From: linghaihui <75124771@qq.com> Date: Sun, 26 Mar 2023 00:45:04 +0800 Subject: [PATCH] =?UTF-8?q?=E9=98=B2=E6=AD=A2=E5=90=8C=E6=97=B6=E5=A4=9A?= =?UTF-8?q?=E6=AC=A1=E6=90=9C=E7=B4=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bingchat/pages/index/index.js | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/bingchat/pages/index/index.js b/bingchat/pages/index/index.js index 36cd2b4..db77c12 100644 --- a/bingchat/pages/index/index.js +++ b/bingchat/pages/index/index.js @@ -51,6 +51,7 @@ Page({ content: "", systemInfo: systemInfo, textareaFocus: false, + searching: false, }, InputFocus(e) { if (inputPop()) { @@ -88,6 +89,17 @@ Page({ }, onLoad() {}, submitContent: function (content) { + if (this.data.searching) { + wx.showToast({ + title: '请等待完成', + icon: 'error' + }) + return + } else { + this.setData({ + searching: true + }) + } var that = this; const cht = app.globalData.cht; that.pushStorageMessage(cht, content, "man", [], false) @@ -120,7 +132,7 @@ Page({ robContent = res.data["data"]["text"]; suggests = res.data["data"]["suggests"]; if (robContent.indexOf("New topic") != -1) { - robContent += "\n发送“重新对话!”开始新的对话"; + robContent += "\n\n发送“重新对话!”开始新的对话"; suggests.push("重新对话!"); suggests.push(content); } @@ -146,8 +158,8 @@ Page({ } catch (error) { wx.showToast({ title: "fatal error", - }); - that.pushStorageMessage(cht, "发生致命错误😱", "rob", [], false, true) + }); + that.pushStorageMessage(cht, "发生致命错误😱", "rob", [], false, true) } }).catch(e => { that.pushStorageMessage(cht, e.errMsg, "rob", [], false, true) @@ -169,6 +181,11 @@ Page({ cht.setData({ chatList: cht.data.chatList, }); + if (role == "rob" && !blink) { + this.setData({ + searching: false + }) + } wx.setStorage({ key: "chatList", data: cht.data.chatList,