fix: 修复部分bug

This commit is contained in:
white 2024-10-09 11:04:32 +08:00
parent a8129bb967
commit 387e2ef30b
9 changed files with 1826 additions and 1588 deletions

View File

@ -237,7 +237,7 @@
<style lang="scss" scoped>
.bloodl_box{
margin-top: 30rpx;
margin-top: 50rpx;
padding: 0 40rpx;
.name{
font-size: 24rpx;
@ -265,7 +265,6 @@
}
.time {
width: 100%;
margin-bottom: 100rpx;
}
.list {
background-color: #fff;

View File

@ -1,203 +1,205 @@
<template>
<view class="content" style="width: 60%;">
<uni-popup ref="popup" type="bottom" border-radius="10px 10px 0 0">
<view class="pop-main" v-if="typeIndex == 1">
<view>
<view class="pop-close" @click="close()">
×
<view class="main">
<view class="pop-main" v-if="typeIndex == 1">
<view class="pops">
<view class="pop-close" @click="close()">
×
</view>
<view class="dxxl">
<scroll-view class="myScoll" scroll-x :show-scrollbar="true">
<view class="box1">
<canvas canvas-id="ecg" style="width: 3000px; height: 300px;"></canvas>
</view>
<view class="box2" :style="{'left': pLeft + 'px'}">
<canvas canvas-id="myCanvas" style="width: 3000px; height: 300px;"></canvas>
</view>
</scroll-view>
</view>
<view class="list">
<view class="flx flx_ac ">
<view class="" style="margin-top: 10rpx;margin-right: 10rpx;">
<image src="../../static/icon/xinlv-small.png" style="width: 40rpx;" mode="widthFix">
</image>
</view>
<view class="" style="color: red;">
心率
</view>
</view>
<view class="flx flx_sb sl_box flx_wp">
<view class="all" v-for="(item,index) in xinlv.jisuan">
<view class="">
<span class="sl_box_wz">{{item.times?item.times:0}}</span>
<span class="sl_box_unit">{{item.unit}}</span>
</view>
<view class="sl_box_desc">
{{item.desc}}
</view>
<view class="sl_box_cankao" v-if="item.cankao">
{{item.cankao}}
</view>
</view>
<view class="all" v-for="(item,index) in xinlv.cankao">
<view class="">
<span class="sl_box_wz">{{item.times.toFixed(2)}}</span>
<span class="sl_box_unit">{{item.unit}}</span>
</view>
<view class="sl_box_desc">
{{item.desc}}
</view>
<view class="sl_box_cankao" v-if="item.cankao">
{{item.cankao}}
</view>
</view>
</view>
</view>
<view class="list">
<view class="flx flx_ac ">
<view class="" style="margin-top: 10rpx;margin-right: 10rpx;">
<image src="../../static/icon/xinlv-small.png" style="width: 40rpx;" mode="widthFix">
</image>
</view>
<view class="" style="color: red;">
心率变异性
</view>
</view>
<view class="">
<xdt :datas="ybx.hrv"></xdt>
<xdt :datas="ybx.sdnn"></xdt>
<xdt :datas="ybx.rmssd"></xdt>
</view>
</view>
<view class="list">
<view class="flx flx_ac ">
<view class="" style="margin-top: 10rpx;margin-right: 10rpx;">
<image src="../../static/icon/xinlv-small.png" style="width: 40rpx;" mode="widthFix">
</image>
</view>
<view class="" style="color: red;">
心电图
</view>
</view>
<view class="">
<xdt :datas="xdt.pwv"></xdt>
<xdt :datas="xdt.qtc"></xdt>
<xdt :datas="xdt.qsrf"></xdt>
<xdt :datas="xdt.qsrx"></xdt>
<xdt :datas="xdt.qsrfx"></xdt>
<xdt :datas="xdt.st"></xdt>
</view>
</view>
<view class="" style="height: 20rpx;"></view>
</view>
<view class="dxxl">
<scroll-view class="myScoll" scroll-x :show-scrollbar="true">
<view class="box1">
<canvas canvas-id="ecg" style="width: 3000px; height: 300px;"></canvas>
</view>
<view class="box2" :style="{'left': pLeft + 'px'}">
<canvas canvas-id="myCanvas" style="width: 3000px; height: 300px;"></canvas>
</view>
</scroll-view>
</view>
<view class="list">
<view class="flx flx_ac ">
<view class="" style="margin-top: 10rpx;margin-right: 10rpx;">
<image src="../../static/icon/xinlv-small.png" style="width: 40rpx;" mode="widthFix">
</image>
</view>
<view class="" style="color: red;">
心率
</view>
</view>
<view class="flx flx_sb sl_box flx_wp">
<view class="all" v-for="(item,index) in xinlv.jisuan">
<view class="">
<span class="sl_box_wz">{{item.times?item.times:0}}</span>
<span class="sl_box_unit">{{item.unit}}</span>
</view>
<view class="sl_box_desc">
{{item.desc}}
</view>
<view class="sl_box_cankao" v-if="item.cankao">
{{item.cankao}}
</view>
</view>
<view class="all" v-for="(item,index) in xinlv.cankao">
<view class="">
<span class="sl_box_wz">{{item.times.toFixed(2)}}</span>
<span class="sl_box_unit">{{item.unit}}</span>
</view>
<view class="sl_box_desc">
{{item.desc}}
</view>
<view class="sl_box_cankao" v-if="item.cankao">
{{item.cankao}}
</view>
</view>
</view>
</view>
<view class="list">
<view class="flx flx_ac ">
<view class="" style="margin-top: 10rpx;margin-right: 10rpx;">
<image src="../../static/icon/xinlv-small.png" style="width: 40rpx;" mode="widthFix">
</image>
</view>
<view class="" style="color: red;">
心率变异性
</view>
</view>
<view class="">
<xdt :datas="ybx.hrv"></xdt>
<xdt :datas="ybx.sdnn"></xdt>
<xdt :datas="ybx.rmssd"></xdt>
</view>
</view>
<view class="list">
<view class="flx flx_ac ">
<view class="" style="margin-top: 10rpx;margin-right: 10rpx;">
<image src="../../static/icon/xinlv-small.png" style="width: 40rpx;" mode="widthFix">
</image>
</view>
<view class="" style="color: red;">
心电图
</view>
</view>
<view class="">
<xdt :datas="xdt.pwv"></xdt>
<xdt :datas="xdt.qtc"></xdt>
<xdt :datas="xdt.qsrf"></xdt>
<xdt :datas="xdt.qsrx"></xdt>
<xdt :datas="xdt.qsrfx"></xdt>
<xdt :datas="xdt.st"></xdt>
</view>
</view>
<view class="" style="height: 20rpx;"></view>
</view>
</view>
<view class="pop-main" v-if="typeIndex == 2">
<view>
<view class="pop-close" @click="close()">
×
<view class="pop-main" v-if="typeIndex == 2">
<view class="pops">
<view class="pop-close" @click="close()">
×
</view>
<view>
<view class="flx flx_ac" style="background-color: #fff;padding: 30rpx 0 0 30rpx;">
<view class="">
<text class="iconfont icon-wode"
:style="'font-size: 50rpx;margin-right:10rpx;color:' + bodyDesc.color "></text>
</view>
<view class="">
<text>{{bodyDesc.name}}</text>
</view>
</view>
<view class="" style="position: relative;">
<image src="../../static/image/body.png" style="width: 100%;" mode="widthFix"></image>
<view class="left_position postion ">
<view class="desc_box">
<view class="flx flx_ac">
<view class="tt">
{{ dataInfo.data_msg.basalMetabolicRate }}
</view>
<view class="unit">
千卡
</view>
</view>
<view class="name">
基础代谢
</view>
</view>
<view class="desc_box">
<view class="flx flx_ac">
<view class="tt">
{{ dataInfo.data_msg.boneMass }}
</view>
<view class="unit">
千克
</view>
</view>
<view class="name">
骨重
</view>
</view>
<view class="desc_box">
<view class="flx flx_ac">
<view class="tt">
{{ dataInfo.data_msg.waterContent }}
</view>
<view class="unit">
千克
</view>
</view>
<view class="name">
水分
</view>
</view>
</view>
<view class="right_position postion">
<view class="desc_box">
<view class="flx flx_ac">
<view class="tt">
{{ dataInfo.data_msg.fatMass }}
</view>
<view class="unit">
千克
</view>
</view>
<view class="name">
脂肪
</view>
</view>
<view class="desc_box" style="margin-bottom: 0;margin-top: 174rpx;">
<view class="flx flx_ac">
<view class="tt">
{{ dataInfo.data_msg.proteinAmount }}
</view>
<view class="unit">
千克
</view>
</view>
<view class="name">
蛋白质
</view>
</view>
</view>
<view class="postion center_posion">
{{ dataInfo.data_msg.userInfo.gender == '2'?'女':'男' }}{{ dataInfo.data_msg.userInfo.weight }}千克
</view>
<view class="postion right_center">
{{ dataInfo.data_msg.userInfo.height }}厘米
</view>
</view>
<view class="radius_box" style="padding: 0;margin: 30rpx;">
<view class="" v-for="(v,i) in arr" :key="i">
<body_info_components :key_name="v" :value="parseFloat(dataInfo.data_msg[v])">
</body_info_components>
</view>
</view>
<view class="" style="height: 40rpx;">
</view>
</view>
<view class="" style="height: 20rpx;"></view>
</view>
<view>
<view class="flx flx_ac" style="background-color: #fff;padding: 30rpx 0 0 30rpx;">
<view class="">
<text class="iconfont icon-wode"
:style="'font-size: 50rpx;margin-right:10rpx;color:' + bodyDesc.color "></text>
</view>
<view class="">
<text>{{bodyDesc.name}}</text>
</view>
</view>
<view class="" style="position: relative;">
<image src="../../static/image/body.png" style="width: 100%;" mode="widthFix"></image>
<view class="left_position postion ">
<view class="desc_box">
<view class="flx flx_ac">
<view class="tt">
{{ dataInfo.data_msg.basalMetabolicRate }}
</view>
<view class="unit">
千卡
</view>
</view>
<view class="name">
基础代谢
</view>
</view>
<view class="desc_box">
<view class="flx flx_ac">
<view class="tt">
{{ dataInfo.data_msg.boneMass }}
</view>
<view class="unit">
千克
</view>
</view>
<view class="name">
骨重
</view>
</view>
<view class="desc_box">
<view class="flx flx_ac">
<view class="tt">
{{ dataInfo.data_msg.waterContent }}
</view>
<view class="unit">
千克
</view>
</view>
<view class="name">
水分
</view>
</view>
</view>
<view class="right_position postion">
<view class="desc_box">
<view class="flx flx_ac">
<view class="tt">
{{ dataInfo.data_msg.fatMass }}
</view>
<view class="unit">
千克
</view>
</view>
<view class="name">
脂肪
</view>
</view>
<view class="desc_box" style="margin-bottom: 0;margin-top: 174rpx;">
<view class="flx flx_ac">
<view class="tt">
{{ dataInfo.data_msg.proteinAmount }}
</view>
<view class="unit">
千克
</view>
</view>
<view class="name">
蛋白质
</view>
</view>
</view>
<view class="postion center_posion">
{{ dataInfo.data_msg.userInfo.gender == '2'?'女':'男' }}{{ dataInfo.data_msg.userInfo.weight }}千克
</view>
<view class="postion right_center">
{{ dataInfo.data_msg.userInfo.height }}厘米
</view>
</view>
<view class="radius_box" style="padding: 0;margin: 30rpx;">
<view class="" v-for="(v,i) in arr" :key="i">
<body_info_components :key_name="v" :value="parseFloat(dataInfo.data_msg[v])">
</body_info_components>
</view>
</view>
<view class="" style="height: 40rpx;">
</view>
</view>
<view class="" style="height: 20rpx;"></view>
</view>
</view>
</uni-popup>
@ -539,6 +541,14 @@
height: 100vh;
background-color: #fff;
overflow-y: scroll;
padding: 50rpx;
}
.pops {
border: 1rpx solid gray;
border-radius: 20rpx;
margin: 50rpx;
margin-top: 100rpx;
}
.box1 {
@ -607,6 +617,7 @@
flex-direction: row-reverse;
font-size: 100rpx;
padding-right: 50rpx;
margin-top: 50rpx;
}
.pop-main {

View File

@ -1,6 +1,6 @@
<template>
<view>
<tm-nav-bar left-icon="arrow-left" title="睡眠" @clickLeft="back" />
<tm-nav-bar left-icon="arrow-left" title="睡眠" @clickLeft="back" :rbgs="false"/>
<view class="flx jcsb ac" style="height: 40rpx;background-color: #fff;padding: 20rpx;">
<view class="" style="font-size: 40rpx;font-weight: bold;">

View File

@ -28,7 +28,7 @@ export default () => {
}
config.data = config.data || {};
// config.baseURL = 'http://test.sc2.agrimedia.cn'; // 不使用请求代理 上线记得注释掉 ***********************************************************
config.baseURL = 'https://ai.agrimedia.cn/'; // 不使用请求代理 上线记得注释掉 ***********************************************************
let apiToken = store.getters['api/getApiToken']
let serverTime = (parseInt(Date.now() /1000) - store.getters['api/getServerTime'])

View File

@ -46,22 +46,37 @@
<!-- 录制 -->
<div class="buttons startRec">点击说话</div>
<!-- 录制中 -->
<!-- <div class="buttons runRec">暂停</div> -->
<!-- 停止 -->
<div class="buttons endRec">停止</div>
</div>
<!-- 讯飞测试 -->
<div class="voice">
<div class="voice-box scroll-text">
<input class="voice-input" type="search" name="voice" id="voice-txt" style="pointer-events: none" value="我是您的健康助手, 请问您有什么帮助吗?"/>
<div id="marquee">
<span id="voice-txt">我是您的健康助手, 请问您有什么帮助吗?</span>
</div>
</div>
</div>
</div>
<script type="text/javascript">
marquee("marquee", "voice-txt");
function marquee(p, s) {
var scrollWidth = document.getElementById(p).offsetWidth;
var textWidth = document.getElementById(s).offsetWidth;
var i = scrollWidth;
console.log(scrollWidth, textWidth);
function change() {
i--;
if (i < -textWidth) {
i = scrollWidth;
}
document.getElementById(s).style.left = i + "px";
window.requestAnimationFrame(change);
}
window.requestAnimationFrame(change);
}
</script>
<script>
var Items = ['血糖', '睡眠', '血氧', '血压', '尿酸', '梅拖', '心率', '体温', '心电图', '身体成份', '运动', '血脂'];
var Question = '';
@ -147,11 +162,6 @@
const speakingTimeInSeconds = speakingTime * 60;
return speakingTimeInSeconds;
}
// 映射的字段
function Reflection(str) {
}
</script>
<!-- 讯飞语音识别 -->
@ -281,7 +291,9 @@
onTextChange: function (text) {
// 监听识别结果的变化
voiceTxt.value = text;
voiceTxt.innerText = text;
marquee("marquee", "voice-txt");
statusTxt.value = '正在听…';
// 3秒钟内没有说话就自动关闭
@ -308,6 +320,8 @@
var QSindex = containsKeywordRegex(params.msg);
Question = `请模仿全科医生的口吻与我: ${user}对话,我最近测量的${result.dataKey}数据为${JSON.stringify(TargetData)},data_msg为值hour_minute为检测时间 #限制回复用户的内容中不要出现Null。#限制:回复不要带英文,要都转化成汉语。#限制监测结果为Null的数据不做分析回复。`
console.log('指定问题', Question)
/*
* 调用接口 传递关键信息 文字转语音
*/
@ -358,6 +372,10 @@
startRec.style.display = "none";
endRec.style.display = "block";
// 字幕文字
voiceTxt.innerText = filterString(str.output.text, ['*', ' ']);
marquee("marquee", "voice-txt");
// 设置音频源
audioElement.src = blobUrl;
@ -442,7 +460,8 @@
endRec.style.display = "block";
// 字幕文字
voiceTxt.value = filterString(str.output.text, ['*', ' ']);
voiceTxt.innerText = filterString(str.output.text, ['*', ' ']);
marquee("marquee", "voice-txt");
// 设置音频源
audioElement.src = blobUrl;
@ -454,7 +473,7 @@
replayVideoSegment(60, 120);
// 计算所需时间
const speakingTime = calculateSpeakingTime(voiceTxt.value);
const speakingTime = calculateSpeakingTime(voiceTxt.innerText);
// 开始倒计时
var totalTime = speakingTime;
@ -507,7 +526,7 @@
// 开始识别
startRec.addEventListener("click", function() {
/**开始识别**/
voiceTxt.value = '';
voiceTxt.innerText = '';
voice.start();
isCallbackExecuted = false;
@ -526,7 +545,7 @@
// 关闭识别
endRec.addEventListener("click", function() {
/**关闭识别**/
voiceTxt.value = '';
voiceTxt.innerText = '';
statusTxt.value = '';
voice.stop();
@ -615,7 +634,7 @@
const blobUrl = URL.createObjectURL(blob);
// 字幕文字
voiceTxt.value = str;
voiceTxt.innerText = str;
// 设置音频源
audioElement.src = blobUrl;
@ -963,20 +982,27 @@
width: 100%;
/* background-color: #000; */
}
.voice-box {
#marquee {
display: block;
width: 100%;
animation: textRoll linear 10s infinite; // 文字滚动动画
white-space: nowrap; // 文字不换行
height: 60px;
margin: 0 auto;
position: relative;
overflow: hidden;
}
@keyframes textRoll {
0% {
transform: translateX(100%);
}
100% {
transform: translateX(-100%);
}
#voice-txt {
position: absolute;
top: 0;
left: 100%;
line-height: 60px;
font-size:29px;
color: #fff;
display: block;
word-break: keep-all;
text-overflow: ellipsis;
white-space: nowrap;
}
</style>

View File

@ -126,7 +126,7 @@
"disableHostCheck" : true, //
"proxy" : {
"/watch" : {
"target" : "https://test.sc2.agrimedia.cn",
"target" : "https://ai.agrimedia.cn",
"changeOrigin" : true,
"secure" : false
}

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

View File

@ -46,22 +46,37 @@
<!-- 录制 -->
<div class="buttons startRec">点击说话</div>
<!-- 录制中 -->
<!-- <div class="buttons runRec">暂停</div> -->
<!-- 停止 -->
<div class="buttons endRec">停止</div>
</div>
<!-- 讯飞测试 -->
<div class="voice">
<div class="voice-box scroll-text">
<input class="voice-input" type="search" name="voice" id="voice-txt" style="pointer-events: none" value="我是您的健康助手, 请问您有什么帮助吗?"/>
<div id="marquee">
<span id="voice-txt">我是您的健康助手, 请问您有什么帮助吗?</span>
</div>
</div>
</div>
</div>
<script type="text/javascript">
marquee("marquee", "voice-txt");
function marquee(p, s) {
var scrollWidth = document.getElementById(p).offsetWidth;
var textWidth = document.getElementById(s).offsetWidth;
var i = scrollWidth;
console.log(scrollWidth, textWidth);
function change() {
i--;
if (i < -textWidth) {
i = scrollWidth;
}
document.getElementById(s).style.left = i + "px";
window.requestAnimationFrame(change);
}
window.requestAnimationFrame(change);
}
</script>
<script>
var Items = ['血糖', '睡眠', '血氧', '血压', '尿酸', '梅拖', '心率', '体温', '心电图', '身体成份', '运动', '血脂'];
var Question = '';
@ -147,11 +162,6 @@
const speakingTimeInSeconds = speakingTime * 60;
return speakingTimeInSeconds;
}
// 映射的字段
function Reflection(str) {
}
</script>
<!-- 讯飞语音识别 -->
@ -281,7 +291,9 @@
onTextChange: function (text) {
// 监听识别结果的变化
voiceTxt.value = text;
voiceTxt.innerText = text;
marquee("marquee", "voice-txt");
statusTxt.value = '正在听…';
// 3秒钟内没有说话就自动关闭
@ -308,6 +320,8 @@
var QSindex = containsKeywordRegex(params.msg);
Question = `请模仿全科医生的口吻与我: ${user}对话,我最近测量的${result.dataKey}数据为${JSON.stringify(TargetData)},data_msg为值hour_minute为检测时间 #限制回复用户的内容中不要出现Null。#限制:回复不要带英文,要都转化成汉语。#限制监测结果为Null的数据不做分析回复。`
console.log('指定问题', Question)
/*
* 调用接口 传递关键信息 文字转语音
*/
@ -358,6 +372,10 @@
startRec.style.display = "none";
endRec.style.display = "block";
// 字幕文字
voiceTxt.innerText = filterString(str.output.text, ['*', ' ']);
marquee("marquee", "voice-txt");
// 设置音频源
audioElement.src = blobUrl;
@ -442,7 +460,8 @@
endRec.style.display = "block";
// 字幕文字
voiceTxt.value = filterString(str.output.text, ['*', ' ']);
voiceTxt.innerText = filterString(str.output.text, ['*', ' ']);
marquee("marquee", "voice-txt");
// 设置音频源
audioElement.src = blobUrl;
@ -454,7 +473,7 @@
replayVideoSegment(60, 120);
// 计算所需时间
const speakingTime = calculateSpeakingTime(voiceTxt.value);
const speakingTime = calculateSpeakingTime(voiceTxt.innerText);
// 开始倒计时
var totalTime = speakingTime;
@ -507,7 +526,7 @@
// 开始识别
startRec.addEventListener("click", function() {
/**开始识别**/
voiceTxt.value = '';
voiceTxt.innerText = '';
voice.start();
isCallbackExecuted = false;
@ -526,7 +545,7 @@
// 关闭识别
endRec.addEventListener("click", function() {
/**关闭识别**/
voiceTxt.value = '';
voiceTxt.innerText = '';
statusTxt.value = '';
voice.stop();
@ -615,7 +634,7 @@
const blobUrl = URL.createObjectURL(blob);
// 字幕文字
voiceTxt.value = str;
voiceTxt.innerText = str;
// 设置音频源
audioElement.src = blobUrl;
@ -963,20 +982,27 @@
width: 100%;
/* background-color: #000; */
}
.voice-box {
#marquee {
display: block;
width: 100%;
animation: textRoll linear 10s infinite; // 文字滚动动画
white-space: nowrap; // 文字不换行
height: 60px;
margin: 0 auto;
position: relative;
overflow: hidden;
}
@keyframes textRoll {
0% {
transform: translateX(100%);
}
100% {
transform: translateX(-100%);
}
#voice-txt {
position: absolute;
top: 0;
left: 100%;
line-height: 60px;
font-size:29px;
color: #fff;
display: block;
word-break: keep-all;
text-overflow: ellipsis;
white-space: nowrap;
}
</style>