Commit d1bc94ee by 前端

优化对练

1 parent fc2652d8
...@@ -83,10 +83,6 @@ Page({ ...@@ -83,10 +83,6 @@ Page({
Sentences = [...Sentences, ...i.Sentences?i.Sentences:[]] Sentences = [...Sentences, ...i.Sentences?i.Sentences:[]]
} }
}); });
if(Sentences.length == 0) {
wx.$util.showToast("对话内容太少");
return;
}
if (isJump) { if (isJump) {
return this.back(); return this.back();
} }
...@@ -94,6 +90,10 @@ Page({ ...@@ -94,6 +90,10 @@ Page({
wx.$util.showToast("AI还未回复"); wx.$util.showToast("AI还未回复");
return; return;
} }
if(Sentences.length == 0) {
wx.$util.showToast("对话内容太短");
return;
}
const chatList = JSON.stringify(audioBox.data.list); const chatList = JSON.stringify(audioBox.data.list);
wx.setStorageSync("chatList", chatList); wx.setStorageSync("chatList", chatList);
const { const {
...@@ -144,6 +144,7 @@ Page({ ...@@ -144,6 +144,7 @@ Page({
wx.$util.showToast("语音还未识别"); wx.$util.showToast("语音还未识别");
return; return;
} }
this.data.isSend = false;
const addVal = { const addVal = {
role: 1, role: 1,
content: "", content: "",
...@@ -156,6 +157,7 @@ Page({ ...@@ -156,6 +157,7 @@ Page({
message message
}) })
const content = Phrases.similar_words const content = Phrases.similar_words
this.data.isSend = true;
audioBox.setList({ audioBox.setList({
content, content,
times: Math.ceil(content.length / 4), times: Math.ceil(content.length / 4),
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!