diff --git a/components/home-data/home-data.vue b/components/home-data/home-data.vue index fb2209b..1f4dc3b 100644 --- a/components/home-data/home-data.vue +++ b/components/home-data/home-data.vue @@ -333,6 +333,7 @@ meiTuo: '梅脱', pulseReat: '心率', updataDate: '更新时间', + bodyData: '身体成分', bodyTemperature: '体温', bloodLiquidAll: '血脂' }, @@ -410,8 +411,7 @@ this.dataListsNew[res[i].type] = res[i] this.dataListsNew[res[i].name] = this.getNameByKey(res[i].type) } - - + this.urlLink = `/hybrid/html/ai.html?data=${JSON.stringify(res)}`; this.$refs.paging.complete(); } diff --git a/hybrid/html/ai.html b/hybrid/html/ai.html index 7769ccd..a76f59b 100755 --- a/hybrid/html/ai.html +++ b/hybrid/html/ai.html @@ -126,7 +126,7 @@ try { if (dataJson) { const eventData = JSON.parse(dataJson); - if (eventData.output.finish_reason === "stop") { + if (eventData.output?.finish_reason === "stop") { stopEvent = eventData; } } @@ -279,6 +279,7 @@ ...value })); + /* * 实例化迅飞语音听写(流式版)WebAPI */ @@ -302,25 +303,24 @@ if (!isCallbackExecuted) { times = setTimeout(() => { this.stop(); - // voice.stop(); statusTxt.value = '正在说话'; const params = { msg: text }; // 判断关键字是否存在 const result = parseHealthQuery(params.msg); + if (result) { DetailDay(result.dataKey, result.date).then(res => { - // if (res?.data?.data) { - // speed(params.msg) - // return - // }; - let TargetData = res.data.data; var QSindex = containsKeywordRegex(params.msg); + if (result.dataKey == 'ECGData') { + delete TargetData[0].data_msg.wavefrom; + delete TargetData[0].data_msg.list; + } + Question = `请模仿全科医生的口吻与我: ${user}对话,我最近测量的${result.dataKey}数据为${JSON.stringify(TargetData)},(data_msg为值,hour_minute为检测时间) #限制:回复用户的内容中不要出现Null。#限制:回复不要带英文,要都转化成汉语。#限制:监测结果为Null的数据不做分析回复。` - console.log('指定问题', Question) /* * 调用接口 传递关键信息 文字转语音 @@ -337,7 +337,7 @@ {"role": "user", "content": `请问我${Items[QSindex]}正常吗`} ] }) - + xhr.onreadystatechange = function() { if (xhr.readyState === 4) { const chunk = xhr.responseText; @@ -724,7 +724,7 @@ pulseReat: '心率', bodyTemperature: '体温', ECGData: '心电图', - bodyData: '身体成份', + bodyData: '身体成分', stepIndex: '运动' }; } diff --git a/hybrid/html/js/voice.js b/hybrid/html/js/voice.js index 90e4e91..eae2b15 100755 --- a/hybrid/html/js/voice.js +++ b/hybrid/html/js/voice.js @@ -279,7 +279,6 @@ // 识别结束 webSocket返回数据 webSocketRes(resultData) { let jsonData = JSON.parse(resultData); - console.log(JSON.stringify(jsonData), 'websocket') if (jsonData.data && jsonData.data.result) { let data = jsonData.data.result; let str = ''; diff --git a/pages/index/index.vue b/pages/index/index.vue index 1740f07..609913e 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -181,8 +181,14 @@ } // 身体成分 - this.dataListsNew.bloodLiquidAll = JSON.parse(JSON.stringify(this.dataListsNew.bloodLiquid)); - this.dataListsNew.bloodLiquidAll.type = 'bloodLiquidAll'; + // this.dataListsNew.bodyData = JSON.parse(JSON.stringify(this.dataListsNew.bloodLiquid)); + // this.dataListsNew.bodyData.type = 'bodyData'; + console.log(this.dataListsNew) + if (this.dataListsNew.ECGData.data_msg) { + // 删除心电图点位 + delete this.dataListsNew.ECGData.data_msg.wavefrom; + delete this.dataListsNew.ECGData.data_msg.list; + } this.urlLink = `/hybrid/html/ai.html?data=${JSON.stringify(this.dataListsNew)}&user=${JSON.stringify(this.getUserInfo)}&token=${store.getters['api/getApiToken']}&deviceId=${this.getActiceDevice.device_id}`; this.loading = false; diff --git a/pages/login/forget.vue b/pages/login/forget.vue index 1e6f693..304b18c 100644 --- a/pages/login/forget.vue +++ b/pages/login/forget.vue @@ -1,6 +1,6 @@