diff --git a/bingchat/app.wxss b/bingchat/app.wxss
index b7f63e5..e1452e6 100644
--- a/bingchat/app.wxss
+++ b/bingchat/app.wxss
@@ -1,5 +1,4 @@
page {
background-color: #fff;
font-size: 28rpx;
- line-height: 1.7em;
}
\ No newline at end of file
diff --git a/bingchat/components/chatbox/index.js b/bingchat/components/chatbox/index.js
index 0e6b4a4..11cfe08 100644
--- a/bingchat/components/chatbox/index.js
+++ b/bingchat/components/chatbox/index.js
@@ -85,12 +85,15 @@ Component({
var data = this.data.chatList[index]
var content = data.originContent
if (!this.data.chatList[index].content) {
- var matches = content.match(/```markdown[\s\S]*(```)?/g)
+ var matches = content.match(/```markdown[\s\S]*```/g)
+ if (null == matches) {
+ matches = content.match(/```markdown[\s\S]*/g)
+ }
if (null != matches) {
matches.forEach(m => {
- var m1 = m.replace('```markdown', '')
- if (m1.trim().endsWith('```')) {
- m1 = m1.substring(0, m1.trim().length - 3)
+ var m1 = m.replace('```markdown', '').trim()
+ if (m1.endsWith('```')) {
+ m1 = m1.substring(0, m1.length - 3)
}
content = content.replace(m, m1)
})
@@ -116,7 +119,7 @@ Component({
"cancelReceive", {}, {}
)
},
- deletAllChat: function (e) {
+ deleteAllChat: function () {
var that = this
wx.showModal({
content: "是否删除全部聊天?",
@@ -133,6 +136,21 @@ Component({
},
})
},
+ longPress: function (e) {
+ var that = this
+ wx.showActionSheet({
+ itemList: ['删除全部聊天记录', '切换聊天请求方式'],
+ success(res) {
+ if (res.tapIndex == 0) {
+ that.deleteAllChat()
+ } else if (res.tapIndex == 1) {
+ that.triggerEvent(
+ "switchRequestMethod", {}, {}
+ )
+ }
+ }
+ })
+ },
showOriginContent: function (e) {
var index = e.currentTarget.dataset.index
var data = this.data.chatList[index]
diff --git a/bingchat/components/chatbox/index.wxml b/bingchat/components/chatbox/index.wxml
index 9713aad..0506f68 100644
--- a/bingchat/components/chatbox/index.wxml
+++ b/bingchat/components/chatbox/index.wxml
@@ -1,6 +1,6 @@
-
-输入问题开始和New Bing聊天吧~
+
+输入问题开始和New Bing聊天吧~
@@ -9,7 +9,7 @@
{{item.dt}}{{item.num_in_conversation}}
{{item.originContent}}
- {{suggest}}
+ {{suggest}}
@@ -23,5 +23,5 @@
-
+
\ No newline at end of file
diff --git a/bingchat/components/chatbox/index.wxss b/bingchat/components/chatbox/index.wxss
index 9ed1549..3f098f9 100644
--- a/bingchat/components/chatbox/index.wxss
+++ b/bingchat/components/chatbox/index.wxss
@@ -35,6 +35,7 @@
word-break: break-all;
white-space: pre-wrap;
margin-top: 10rpx;
+ line-height: 1.65em;
}
.bg-green {
diff --git a/bingchat/miniprogram_npm/mp-html/index.js b/bingchat/miniprogram_npm/mp-html/index.js
index 3adf894..a865c86 100644
--- a/bingchat/miniprogram_npm/mp-html/index.js
+++ b/bingchat/miniprogram_npm/mp-html/index.js
@@ -1,8 +1,8 @@
-"use strict";function e(t){"@babel/helpers - typeof";return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(t)}function t(e,t,i){return t=n(t),t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function n(t){var n=i(t,"string");return"symbol"===e(n)?n:String(n)}function i(t,n){if("object"!==e(t)||null===t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var o=i.call(t,n||"default");if("object"!==e(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(t)}function o(e){return e.replace(//g,">")}/*!
+"use strict";function e(t){"@babel/helpers - typeof";return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(t)}function t(e,t,i){return t=n(t),t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function n(t){var n=i(t,"string");return"symbol"===e(n)?n:String(n)}function i(t,n){if("object"!==e(t)||null===t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var o=i.call(t,n||"default");if("object"!==e(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(t)}function o(e){return a.forEach(function(t){var n=e.match(new RegExp("<"+t+".*>"));null!=n&&n.forEach(function(t){e=e.replace(t,t.replace("<","<").replace(">",">"))}),-1!=e.indexOf(""+t+">")&&(e=e.replace(""+t+">","</"+t+">"))}),e}/*!
* mp-html v2.4.1
* https://github.com/jin-yufeng/mp-html
*
* Released under the MIT license
* Author: Jin Yufeng
*/
-var r=require("./parser"),a=[require("./markdown/index.js"),require("./emoji/index.js"),require("./highlight/index.js"),require("./latex/index.js"),require("./style/index.js")];Component({data:{nodes:[]},properties:{markdown:Boolean,containerStyle:String,content:{type:String,value:"",observer:function(e){this.setContent(e)}},copyLink:{type:Boolean,value:!0},domain:String,errorImg:String,lazyLoad:Boolean,loadingImg:String,pauseVideo:{type:Boolean,value:!0},previewImg:{type:Boolean,value:!0},scrollTable:Boolean,selectable:null,setTitle:{type:Boolean,value:!0},showImgMenu:{type:Boolean,value:!0},tagStyle:Object,useAnchor:null},created:function(){this.plugins=[];for(var e=a.length;e--;)this.plugins.push(new a[e](this))},detached:function(){this._hook("onDetached")},methods:{in:function(e,t,n){e&&t&&n&&(this._in={page:e,selector:t,scrollTop:n})},navigateTo:function(e,n){var i=this;return e=this._ids[decodeURI(e)]||e,new Promise(function(o,r){if(!i.data.useAnchor)return void r(Error("Anchor is disabled"));var a=wx.createSelectorQuery().in(i._in?i._in.page:i).select((i._in?i._in.selector:"._root")+(e?"".concat(">>>","#").concat(e):"")).boundingClientRect();i._in?a.select(i._in.selector).scrollOffset().select(i._in.selector).boundingClientRect():a.selectViewport().scrollOffset(),a.exec(function(e){if(!e[0])return void r(Error("Label not found"));var a=e[1].scrollTop+e[0].top-(e[2]?e[2].top:0)+(n||parseInt(i.data.useAnchor)||0);i._in?i._in.page.setData(t({},i._in.scrollTop,a)):wx.pageScrollTo({scrollTop:a,duration:300}),o()})})},getText:function(e){var t="";return function e(n){for(var i=0;i"0"&&o.name[1]<"7";r&&t&&"\n"!==t[t.length-1]&&(t+="\n"),o.children&&e(o.children),r&&"\n"!==t[t.length-1]?t+="\n":"td"!==o.name&&"th"!==o.name||(t+="\t")}}}(e||this.data.nodes),t},getRect:function(){var e=this;return new Promise(function(t,n){wx.createSelectorQuery().in(e).select("._root").boundingClientRect().exec(function(e){return e[0]?t(e[0]):n(Error("Root label not found"))})})},pauseMedia:function(){for(var e=(this._videos||[]).length;e--;)this._videos[e].pause()},setPlaybackRate:function(e){this.playbackRate=e;for(var t=(this._videos||[]).length;t--;)this._videos[t].playbackRate(e)},setContent:function(e,t){var n=this;e=o(e),this.imgList&&t||(this.imgList=[]),this._videos=[];var i={},a=new r(this).parse(e);if(t)for(var s=this.data.nodes.length,l=a.length;l--;)i["nodes[".concat(s+l,"]")]=a[l];else i.nodes=a;if(this.setData(i,function(){n._hook("onLoad"),n.triggerEvent("load")}),this.data.lazyLoad||this.imgList._unloadimgs>>","#").concat(e):"")).boundingClientRect();i._in?a.select(i._in.selector).scrollOffset().select(i._in.selector).boundingClientRect():a.selectViewport().scrollOffset(),a.exec(function(e){if(!e[0])return void r(Error("Label not found"));var a=e[1].scrollTop+e[0].top-(e[2]?e[2].top:0)+(n||parseInt(i.data.useAnchor)||0);i._in?i._in.page.setData(t({},i._in.scrollTop,a)):wx.pageScrollTo({scrollTop:a,duration:300}),o()})})},getText:function(e){var t="";return function e(n){for(var i=0;i"0"&&o.name[1]<"7";r&&t&&"\n"!==t[t.length-1]&&(t+="\n"),o.children&&e(o.children),r&&"\n"!==t[t.length-1]?t+="\n":"td"!==o.name&&"th"!==o.name||(t+="\t")}}}(e||this.data.nodes),t},getRect:function(){var e=this;return new Promise(function(t,n){wx.createSelectorQuery().in(e).select("._root").boundingClientRect().exec(function(e){return e[0]?t(e[0]):n(Error("Root label not found"))})})},pauseMedia:function(){for(var e=(this._videos||[]).length;e--;)this._videos[e].pause()},setPlaybackRate:function(e){this.playbackRate=e;for(var t=(this._videos||[]).length;t--;)this._videos[t].playbackRate(e)},setContent:function(e,t){var n=this;-1!=e.indexOf("python代码")&&-1==e.indexOf("```")&&(e="```\n\n"+e+"\n\n```"),this.imgList&&t||(this.imgList=[]),this._videos=[];var i={},o=new r(this).parse(e);if(t)for(var a=this.data.nodes.length,l=o.length;l--;)i["nodes[".concat(a+l,"]")]=o[l];else i.nodes=o;if(this.setData(i,function(){n._hook("onLoad"),n.triggerEvent("load")}),this.data.lazyLoad||this.imgList._unloadimgs
+
-
- 发送
+
+ 发送
\ No newline at end of file