From ceaaf975e182b67ed4babaa1605a863d4a369f98 Mon Sep 17 00:00:00 2001 From: linghaihui <75124771@qq.com> Date: Thu, 23 Mar 2023 19:06:42 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=82=E9=85=8DMac=E7=AB=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bingchat/app.js | 3 ++- bingchat/app.json | 5 +++-- bingchat/components/chatbox/index.wxml | 16 ++++++++----- bingchat/pages/index/index.js | 31 +++++++++++++++++++------- bingchat/pages/index/index.wxml | 6 ++--- bingchat/project.config.json | 2 +- bingchat/project.private.config.json | 2 +- 7 files changed, 44 insertions(+), 21 deletions(-) diff --git a/bingchat/app.js b/bingchat/app.js index 037920c..25a4ca3 100644 --- a/bingchat/app.js +++ b/bingchat/app.js @@ -1,7 +1,8 @@ import { SERVER_HOST } from "config"; App({ - onShow: function () {}, + onShow: function () { + }, onLaunch: function () { this.getSid(); }, diff --git a/bingchat/app.json b/bingchat/app.json index 1998d22..acfed0d 100644 --- a/bingchat/app.json +++ b/bingchat/app.json @@ -12,10 +12,11 @@ "backgroundTextStyle": "light", "navigationBarBackgroundColor": "#ffffff", "navigationBarTitleText": "New Bing Bot 🤖", - "navigationBarTextStyle": "black" + "navigationBarTextStyle": "black" }, "sitemapLocation": "sitemap.json", "networkTimeout": { "request": 1800000 - } + }, + "resizable": true } diff --git a/bingchat/components/chatbox/index.wxml b/bingchat/components/chatbox/index.wxml index c9c2c59..a0c6355 100644 --- a/bingchat/components/chatbox/index.wxml +++ b/bingchat/components/chatbox/index.wxml @@ -6,16 +6,22 @@ {{item.dt}} - {{item.originContent}} - - {{suggest}} - + + + + + {{item.originContent}} + + + + {{suggest}} + {{item.dt}} - {{item.originContent}} + {{item.originContent}} diff --git a/bingchat/pages/index/index.js b/bingchat/pages/index/index.js index 6d3a77a..4cd29b6 100644 --- a/bingchat/pages/index/index.js +++ b/bingchat/pages/index/index.js @@ -1,4 +1,14 @@ -import { SERVER_HOST } from "../../config"; +import { + SERVER_HOST +} from "../../config"; + +const systemInfo = wx.getSystemInfoSync() + +function inputPop() { + return systemInfo.platform == "ios" || systemInfo.platform == "android" +} + +const initHeight = inputPop() ? 20 : 2 Date.prototype.format = function (fmt) { var o = { @@ -37,18 +47,21 @@ const personAvatar = "../../image/person.jpeg"; Page({ data: { - InputBottom: 24, + InputBottom: initHeight, content: "", + systemInfo: systemInfo }, InputFocus(e) { - this.setData({ - InputBottom: e.detail.height, - }); + if (inputPop()) { + this.setData({ + InputBottom: e.detail.height, + }); + } }, InputBlur(e) { this.setData({ - InputBottom: 24, - }); + InputBottom: initHeight, + }); }, processContent(content) { return content.replace(/\\n/g, "\n"); @@ -71,6 +84,8 @@ Page({ }); } }, + onLoad() { + }, submitContent: function (content) { var that = this; const cht = app.globalData.cht; @@ -116,7 +131,7 @@ Page({ } wx.request({ url: SERVER_HOST + "/bing/chat", - method: "POST", + method: "POST", data: { q: content, t: new Date().getTime(), diff --git a/bingchat/pages/index/index.wxml b/bingchat/pages/index/index.wxml index 420ae49..b68d354 100644 --- a/bingchat/pages/index/index.wxml +++ b/bingchat/pages/index/index.wxml @@ -1,5 +1,5 @@ - - - + + + \ No newline at end of file diff --git a/bingchat/project.config.json b/bingchat/project.config.json index 5acc0ff..c5ffeb4 100644 --- a/bingchat/project.config.json +++ b/bingchat/project.config.json @@ -1,7 +1,7 @@ { "appid": "wxee7496be5b68b740", "compileType": "miniprogram", - "libVersion": "2.12.3", + "libVersion": "2.16.1", "packOptions": { "ignore": [], "include": [] diff --git a/bingchat/project.private.config.json b/bingchat/project.private.config.json index 2422f01..b31f0d7 100644 --- a/bingchat/project.private.config.json +++ b/bingchat/project.private.config.json @@ -5,5 +5,5 @@ "compileHotReLoad": true, "urlCheck": false }, - "libVersion": "2.15.0" + "libVersion": "2.16.1" } \ No newline at end of file