Commit 9509982a authored by xuchaozou's avatar xuchaozou

fix: 修复打开首页没有提示

parent b3fc196c
Pipeline #86495 waiting for manual action with stages
......@@ -83,6 +83,7 @@ const Dialog = props => {
const frame = useCallback((data) => {
const { resultText, resultTextTemp } = data
console.log(resultTextTemp)
if (!resultTextTemp) return
setData(data => {
const length = data.length
......
......@@ -11,9 +11,11 @@ class AwakenDirective extends BaseDirective {
return false;
}
async excute({ sendMsg = function() {
async excute({
sendMsg = function () { }
}) {
sendMsg("已经打开首页了")
} }) {}
}
}
export default AwakenDirective;
......@@ -18,6 +18,29 @@ const testText = text =>
}, 500);
});
const testFrameText = (text) => {
let timer = null , _text = "" , index = 0
return new Promise((resolve , reject) => {
timer = setInterval(() => {
_text += text.charAt(index)
event.emit("aiSound:frame", {
resultTextTemp : _text
})
if(index == text.length) {
clearInterval(timer)
setTimeout(() => {
event.emit('aiSound:finish', {
resultText: text,
});
resolve()
}, 500)
}
index++
}, 100)
})
}
const testCommand = async () => {
await Utils.delayTime(500);
// await testText("打开泵站。")
......@@ -26,9 +49,7 @@ const testCommand = async () => {
// await testText("打开顺平全景图菜单。")
// await testText("关闭全景图菜单。")
// await testText("关闭第1个。");
await testText("打开实景。")
await testText("打开第1个。")
await testText("打开第4个。")
await testFrameText("打开熊猫智慧水务实景菜单。")
}
export default testCommand
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment