diff --git a/src/api/dialog.js b/src/api/dialog.js new file mode 100644 index 00000000..38de539e --- /dev/null +++ b/src/api/dialog.js @@ -0,0 +1,12 @@ +import request from '@/api/request' + + + +// 获取问题list +export const queryHotQuestionApi = (data) => { + return request({ + url: '/traask/traAskchat/queryHotQuestion', + method: 'post', + data + }); +}; \ No newline at end of file diff --git a/src/pages/course/components/touchBtn.vue b/src/pages/course/components/touchBtn.vue index 8598c44f..940336de 100644 --- a/src/pages/course/components/touchBtn.vue +++ b/src/pages/course/components/touchBtn.vue @@ -75,6 +75,10 @@ const props = defineProps({ }) const { isDisabled, onlyVoice } = toRefs(props) const isLoadingState = computed(() => props.isLoading) + +const showTalkingModel = ref(false) +const keyboardIsShow = ref(false) + watch(()=>props.isLoading,()=>{},{ deep:true,immediate:true }) @@ -84,8 +88,13 @@ watch(()=>props.canAnswer,()=>{},{ watch(()=>props.onlyVoice,()=>{},{ deep:true,immediate:true }) -const showTalkingModel = ref(false) -const keyboardIsShow = ref(false) +watch(()=>props.isDisabled,(val)=>{ + if(val){ + keyboardIsShow.value = false + } +},{ + deep:true,immediate:true +}) const answerValue = ref('') @@ -315,6 +324,7 @@ const showKeyboard = () => { } } const changeBtn = () => { + if(props.isDisabled) return keyboardIsShow.value = !keyboardIsShow.value answerValue.value = '' } diff --git a/src/pages/index/dialog.vue b/src/pages/index/dialog.vue index 9fd514d2..9fbae236 100644 --- a/src/pages/index/dialog.vue +++ b/src/pages/index/dialog.vue @@ -27,13 +27,13 @@ {{questionList[item-1]}} + @click="sendText(questionList[item-1].hotContent)">{{questionList[item-1].hotContent}} - {{questionList[item + Math.ceil(questionList.length/2)-1]}} + @click="sendText(questionList[item + Math.ceil(questionList.length/2)-1].hotContent)"> + {{questionList[item + Math.ceil(questionList.length/2)-1].hotContent}} @@ -123,6 +123,9 @@ import { commonUploadVoiceFile } from "@/api/common.js" + import { + queryHotQuestionApi + } from "@/api/dialog.js" const socketStore = useSocketStore() const { @@ -131,16 +134,16 @@ const userInfo = computed(() => getUserInfo()) console.log('userInfoxxx', getUserInfo()); const questionList = ref([ - '对公小程序开户流程?', - '厅堂服务经理2025年管理办法?', - '厅堂服务经理2025年考核表单?', - '吉林银行重要空白凭证调微业务操作规程?', - '协助有权机关查询冻结扣划业务操作规程?', - '柜面个人账户操作规程?', - '久悬未取款账户如何办理销户?', - '境外来华人员个人账户业务开户如何办理?', - '营业机构日间管理风险防控要点有哪些?', - '现金管理平台柜面业务操作?' + // '对公小程序开户流程?', + // '厅堂服务经理2025年管理办法?', + // '厅堂服务经理2025年考核表单?', + // '吉林银行重要空白凭证调微业务操作规程?', + // '协助有权机关查询冻结扣划业务操作规程?', + // '柜面个人账户操作规程?', + // '久悬未取款账户如何办理销户?', + // '境外来华人员个人账户业务开户如何办理?', + // '营业机构日间管理风险防控要点有哪些?', + // '现金管理平台柜面业务操作?' ]) const scrollBoxRef = ref() const scrollTop = ref(99999) @@ -166,6 +169,7 @@ const talkingList = ref([]) const showModelComfirm = ref(false) + const reconcatNum = ref(1) const initsocketTask = () => { socketStore.creatSocket('/traask/asksocket/open?summary=') // unref(SocketObj).on('open', (res)=>{ @@ -182,8 +186,13 @@ // }) unref(SocketObj).on('error', () => { if ((watchFlag.value === 1) || showModelComfirm.value) return + if (reconcatNum.value === 5) { + common.msg('系统网络异常,请稍后再试!') + return + } showModelComfirm.value = true common.show('提示信息', '网络环境不稳定,请重试!', false, '', '确认').then((res) => { + reconcatNum.value += 1 common.redirectTo(`/pages/index/dialog`) }).finally(() => { showModelComfirm.value = false @@ -472,8 +481,15 @@ } return false }); - + + const getQuestionList = () => { + queryHotQuestionApi().then(res=> { + console.log(res) + questionList.value = res.body + }) + } onMounted(() => { + getQuestionList() initsocketTask() }) onHide(() => {