|
@@ -9,7 +9,7 @@
|
|
<p>访谈时你可以提出以下问题:</p>
|
|
<p>访谈时你可以提出以下问题:</p>
|
|
</div>
|
|
</div>
|
|
<div class="question-list">
|
|
<div class="question-list">
|
|
- <p class="question-list-item" v-for="(item, index) in questionBankList" :key="index" @click="quickSendMsg(item)">
|
|
|
|
|
|
+ <p class="question-list-item" v-for="(item, index) in questionBankList" :key="index" @click="sendRequest(item.question)">
|
|
{{index+1}}.{{item.question}}
|
|
{{index+1}}.{{item.question}}
|
|
</p>
|
|
</p>
|
|
</div>
|
|
</div>
|
|
@@ -82,8 +82,8 @@
|
|
<div>X</div>
|
|
<div>X</div>
|
|
</div>
|
|
</div>
|
|
<div style="display: flex;align-items: center;flex-wrap: wrap">
|
|
<div style="display: flex;align-items: center;flex-wrap: wrap">
|
|
- <div class="tip-item">
|
|
|
|
- 1.心理抑郁了怎么办?
|
|
|
|
|
|
+ <div class="tip-item" v-for="(item, index) in questionBankByKeywordList" :key="index" @click="tipSendRequest(item.question)">
|
|
|
|
+ {{index+1}}.{{item.question}}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@@ -94,6 +94,7 @@
|
|
v-model="inputMessage"
|
|
v-model="inputMessage"
|
|
style="width: 1220px;height: 84px"
|
|
style="width: 1220px;height: 84px"
|
|
placeholder="请输入消息"
|
|
placeholder="请输入消息"
|
|
|
|
+ @input="getQuestionBankByKeyword"
|
|
@keyup.enter="sendMessage"
|
|
@keyup.enter="sendMessage"
|
|
>
|
|
>
|
|
<template #suffix>
|
|
<template #suffix>
|
|
@@ -160,12 +161,14 @@
|
|
// 播放按钮状态
|
|
// 播放按钮状态
|
|
let playActiveIndex = ref(0)
|
|
let playActiveIndex = ref(0)
|
|
let playButtonFlag = ref(false)
|
|
let playButtonFlag = ref(false)
|
|
- // 推荐问题
|
|
|
|
|
|
+ // 左侧推荐问题
|
|
let questionBankList = ref([])
|
|
let questionBankList = ref([])
|
|
|
|
+ // 关键词提示问题
|
|
|
|
+ let questionBankByKeywordList = ref([])
|
|
|
|
|
|
// 显示提示
|
|
// 显示提示
|
|
- let showQuestionTipBoxFlag = ref(true)
|
|
|
|
- //
|
|
|
|
|
|
+ let showQuestionTipBoxFlag = ref(false)
|
|
|
|
+ // 提示信息
|
|
const HELLO_MSG = '你是谁?'
|
|
const HELLO_MSG = '你是谁?'
|
|
// 查看所有聊天记录
|
|
// 查看所有聊天记录
|
|
function list() {
|
|
function list() {
|
|
@@ -210,8 +213,10 @@
|
|
inputMessage.value = '';
|
|
inputMessage.value = '';
|
|
}
|
|
}
|
|
|
|
|
|
- function quickSendMsg(item){
|
|
|
|
- sendRequest(item.question);
|
|
|
|
|
|
+ // 在关键词搜索页点击发送问题
|
|
|
|
+ function tipSendRequest(content){
|
|
|
|
+ sendRequest(content);
|
|
|
|
+ showQuestionTipBoxFlag.value = false
|
|
}
|
|
}
|
|
|
|
|
|
const sendMessage = () => {
|
|
const sendMessage = () => {
|
|
@@ -770,7 +775,7 @@
|
|
router.go(-1)
|
|
router.go(-1)
|
|
}
|
|
}
|
|
|
|
|
|
- function getQuestionBank(){
|
|
|
|
|
|
+ function getRecommendQuestionBank(){
|
|
let form = {
|
|
let form = {
|
|
type: 1,
|
|
type: 1,
|
|
isRecommend: 1,
|
|
isRecommend: 1,
|
|
@@ -782,12 +787,30 @@
|
|
})
|
|
})
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ function getQuestionBankByKeyword(){
|
|
|
|
+ let form = {
|
|
|
|
+ type: 1,
|
|
|
|
+ pageNum: 1,
|
|
|
|
+ pageSize: 10000,
|
|
|
|
+ keyword: inputMessage.value
|
|
|
|
+ }
|
|
|
|
+ getQuestionBankList(form).then(resp => {
|
|
|
|
+ if(resp.rows && resp.rows.length >0){
|
|
|
|
+ showQuestionTipBoxFlag.value = true
|
|
|
|
+ questionBankByKeywordList.value = resp.rows
|
|
|
|
+ }else{
|
|
|
|
+ showQuestionTipBoxFlag.value = false
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+
|
|
onMounted(()=>{
|
|
onMounted(()=>{
|
|
nextTick(()=>{
|
|
nextTick(()=>{
|
|
initSpeechRecognition();
|
|
initSpeechRecognition();
|
|
initSpeechSynthesis();
|
|
initSpeechSynthesis();
|
|
list();
|
|
list();
|
|
- getQuestionBank();
|
|
|
|
|
|
+ getRecommendQuestionBank();
|
|
})
|
|
})
|
|
|
|
|
|
})
|
|
})
|
|
@@ -1047,6 +1070,7 @@
|
|
.question-tip-box{
|
|
.question-tip-box{
|
|
width: 1346px;
|
|
width: 1346px;
|
|
height: 100px;
|
|
height: 100px;
|
|
|
|
+ overflow: auto;
|
|
z-index: 10;
|
|
z-index: 10;
|
|
position: absolute;
|
|
position: absolute;
|
|
right: 68px;
|
|
right: 68px;
|