fix: 修复部分bug

This commit is contained in:
white 2024-10-10 11:09:22 +08:00
parent e544d38952
commit 268f21aa3d
11 changed files with 123 additions and 53 deletions

View File

@ -547,8 +547,9 @@
.pops {
border: 1rpx solid gray;
border-radius: 20rpx;
margin: 50rpx;
margin: 50rpx 200rpx;
margin-top: 100rpx;
padding: 0rpx 50rpx;
}
.box1 {

View File

@ -370,12 +370,13 @@ import { mapGetters } from "vuex";
type: Object
}
},
onLoad() {
this.type = pageData.type;
mounted() {
this.pageData.type = this.getpageType;
},
computed: {
...mapGetters({
getActiceDevice: "api/getActiceDevice"
getActiceDevice: "api/getActiceDevice",
getpageType: "api/getpageType",
})
},
methods: {
@ -387,9 +388,10 @@ import { mapGetters } from "vuex";
async getDataList(){
let type = this.pageData.type
if(type == 'bloodLiquidAll'){
if(type == 'bloodLiquidAll') {
type = 'bloodLiquid'
}
let res = await this.$store.dispatch('api/getDeviceListDays', {
type: type,
device_real_time: this.time,

View File

@ -442,6 +442,7 @@
},
toPageCom(val) {
this.$emit('pageDetail', val)
this.$store.commit('api/setpageType', val)
},
// 退
outlogin() {

View File

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

View File

@ -65,7 +65,6 @@
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) {
@ -309,7 +308,7 @@
// 判断关键字是否存在
const result = parseHealthQuery(params.msg);
console.log(result, '判断关键字是否存在')
if (result) {
DetailDay(result.dataKey, result.date).then(res => {
let TargetData = res.data.data;
@ -541,7 +540,6 @@
startRec.style.display = 'none';
endRec.style.display = 'none';
console.log(endRec.style)
showModal()
});
@ -659,7 +657,10 @@
totalTime --;
if (totalTime <= 0) {
// 停止倒计时
console.log('计算结束')
startRec.style.display = 'block';
endRec.style.display = 'none';
statusTxt.value = '';
voiceTxt.innerText = '';
clearInterval(countdown);
replayVideoSegment(0, 60);
}
@ -723,11 +724,15 @@
SleepDatas: "睡眠",
bloodOxygen: "血氧",
bloodPressure: '血压',
bloodLiquid: "血脂",
meiTuo: '梅脱',
pulseReat: '心率',
bodyTemperature: '体温',
ECGData: '心电图',
bloodLiquid: {
'血脂': true,
'血液成分': true,
'尿酸': true
},
bodyData: '身体成分',
stepIndex: '运动'
};
@ -749,12 +754,30 @@
targetDate.setDate(day - 2);
}
// 格式化日期为 YYYY-MM-DD
const formattedDate = `${targetDate.getFullYear()}-${('0' + targetDate.getMonth()).slice(-2)}-${('0' + targetDate.getDate()).slice(-2)}`;
// 查找匹配的数据项键
// 创建一个辅助函数来检查 bloodLiquid 对象是否包含查询字符串
function isBloodLiquidMatch(bloodLiquidData, query) {
for (let value in bloodLiquidData) {
if (value.includes(query)) {
return true;
}
}
return false;
}
// 在查询逻辑中使用这个辅助函数
for (let key in demoData) {
if (query.includes(demoData[key])) {
if (typeof demoData[key] === 'object' && key === 'bloodLiquid') {
if (isBloodLiquidMatch(demoData[key], query)) {
const formattedDate = new Date().toISOString().split('T')[0];
return {
dataKey: key,
date: formattedDate
};
}
} else if (typeof demoData[key] === 'string' && demoData[key].includes(query)) {
const formattedDate = new Date().toISOString().split('T')[0];
return {
dataKey: key,
date: formattedDate

View File

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

View File

@ -219,12 +219,23 @@
} else {
this.Sindex = 2;
this.activeType = str;
if (str == 'bloodLiquidAll') {
this.pageData = this.dataListsNew['bloodLiquid'];
this.pageData.type = 'bloodLiquidAll';
return
} else if (str == 'bloodLiquid') {
this.pageData = this.dataListsNew['bloodLiquid'];
this.pageData.type = 'bloodLiquid';
return
} else {
for (let val in this.dataListsNew) {
if (str == val) {
this.pageData = this.dataListsNew[val]
}
}
}
}
},
toPage(url) {
@ -264,7 +275,7 @@
back(index) {
this.Sindex = index;
console.log(this.Sindex)
this.pageData.type = '';
}
}
}

View File

@ -18,7 +18,8 @@ let state = {
userInfo: {},
apiToken: '',
serverTime:0,
activeDevice: ''
activeDevice: '',
pageType: ''
},
getters = {
getUserInfo(state){
@ -32,9 +33,15 @@ let state = {
},
getActiceDevice(state){
return state.activeDevice
},
getpageType(state){
return state.pageType
}
},
mutations = {
setpageType(state,data) {
state.pageType = data
},
setUserInfo(state,data) {
state.userInfo = data
},

File diff suppressed because one or more lines are too long

View File

@ -12460,7 +12460,7 @@ if(false) {}
var ___CSS_LOADER_API_IMPORT___ = __webpack_require__(/*! ../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/css-loader/dist/runtime/api.js */ 13);
exports = ___CSS_LOADER_API_IMPORT___(false);
// Module
exports.push([module.i, "@charset \"UTF-8\";\n/**\n * 这里是uni-app内置的常用样式变量\n *\n * uni-app 官方扩展插件及插件市场https://ext.dcloud.net.cn上很多三方插件均使用了这些样式变量\n * 如果你是插件开发者建议你使用scss预处理并在插件代码中直接使用这些变量无需 import 这个文件方便用户通过搭积木的方式开发整体风格一致的App\n *\n */\n/**\n * 如果你是App开发者插件使用者你可以通过修改这些变量来定制自己的插件主题实现自定义主题功能\n *\n * 如果你的项目同样使用了scss预处理你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件\n */\n/* 颜色变量 */\n/* 行为相关颜色 */\n/* 文字基本颜色 */\n/* 背景颜色 */\n/* 边框颜色 */\n/* 尺寸变量 */\n/* 文字尺寸 */\n/* 图片尺寸 */\n/* Border Radius */\n/* 水平间距 */\n/* 垂直间距 */\n/* 透明度 */\n/* 文章场景相关 */\n.end[data-v-0b42eb78] {\n text-align: center;\n margin-top: 50rpx;\n margin-bottom: 100rpx;\n opacity: .5;\n}\n.pop-close[data-v-0b42eb78] {\n display: flex;\n flex-direction: row-reverse;\n font-size: 100rpx;\n padding-right: 50rpx;\n}\n.pop-main[data-v-0b42eb78] {\n width: 100%;\n height: 100vh;\n background-color: #fff;\n overflow-y: scroll;\n padding: 50rpx;\n}\n.pops[data-v-0b42eb78] {\n border: 1rpx solid gray;\n border-radius: 20rpx;\n margin: 50rpx;\n margin-top: 100rpx;\n}\n.box1[data-v-0b42eb78] {\n position: absolute;\n left: 0px;\n width: 3000rpx;\n}\n.box2[data-v-0b42eb78] {\n position: absolute;\n left: 0px;\n width: 3000rpx;\n}\n.myScoll[data-v-0b42eb78] {\n width: 100%;\n height: 396rpx;\n white-space: nowrap;\n position: relative;\n}\n.list[data-v-0b42eb78] {\n background-color: #fff;\n overflow: hidden;\n padding: 30rpx;\n margin: 30rpx 30rpx;\n border-radius: 30rpx;\n}\n.dxxl[data-v-0b42eb78] {\n background-color: #fff;\n padding: 20rpx;\n padding-top: 40rpx;\n}\n.sl_box[data-v-0b42eb78] {\n text-align: center;\n}\n.sl_box .all[data-v-0b42eb78] {\n width: calc(100% / 3);\n margin-top: 40rpx;\n}\n.sl_box .sl_box_cankao[data-v-0b42eb78],\n.sl_box .sl_box_desc[data-v-0b42eb78] {\n font-size: 24rpx;\n color: #999;\n}\n.sl_box .sl_box_unit[data-v-0b42eb78] {\n font-size: 26rpx;\n}\n.sl_box .sl_box_wz[data-v-0b42eb78] {\n margin-right: 10rpx;\n font-size: 30rpx;\n font-weight: bold;\n}\n", ""]);
exports.push([module.i, "@charset \"UTF-8\";\n/**\n * 这里是uni-app内置的常用样式变量\n *\n * uni-app 官方扩展插件及插件市场https://ext.dcloud.net.cn上很多三方插件均使用了这些样式变量\n * 如果你是插件开发者建议你使用scss预处理并在插件代码中直接使用这些变量无需 import 这个文件方便用户通过搭积木的方式开发整体风格一致的App\n *\n */\n/**\n * 如果你是App开发者插件使用者你可以通过修改这些变量来定制自己的插件主题实现自定义主题功能\n *\n * 如果你的项目同样使用了scss预处理你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件\n */\n/* 颜色变量 */\n/* 行为相关颜色 */\n/* 文字基本颜色 */\n/* 背景颜色 */\n/* 边框颜色 */\n/* 尺寸变量 */\n/* 文字尺寸 */\n/* 图片尺寸 */\n/* Border Radius */\n/* 水平间距 */\n/* 垂直间距 */\n/* 透明度 */\n/* 文章场景相关 */\n.end[data-v-0b42eb78] {\n text-align: center;\n margin-top: 50rpx;\n margin-bottom: 100rpx;\n opacity: .5;\n}\n.pop-close[data-v-0b42eb78] {\n display: flex;\n flex-direction: row-reverse;\n font-size: 100rpx;\n padding-right: 50rpx;\n}\n.pop-main[data-v-0b42eb78] {\n width: 100%;\n height: 100vh;\n background-color: #fff;\n overflow-y: scroll;\n padding: 50rpx;\n}\n.pops[data-v-0b42eb78] {\n border: 1rpx solid gray;\n border-radius: 20rpx;\n margin: 50rpx 200rpx;\n margin-top: 100rpx;\n padding: 0rpx 50rpx;\n}\n.box1[data-v-0b42eb78] {\n position: absolute;\n left: 0px;\n width: 3000rpx;\n}\n.box2[data-v-0b42eb78] {\n position: absolute;\n left: 0px;\n width: 3000rpx;\n}\n.myScoll[data-v-0b42eb78] {\n width: 100%;\n height: 396rpx;\n white-space: nowrap;\n position: relative;\n}\n.list[data-v-0b42eb78] {\n background-color: #fff;\n overflow: hidden;\n padding: 30rpx;\n margin: 30rpx 30rpx;\n border-radius: 30rpx;\n}\n.dxxl[data-v-0b42eb78] {\n background-color: #fff;\n padding: 20rpx;\n padding-top: 40rpx;\n}\n.sl_box[data-v-0b42eb78] {\n text-align: center;\n}\n.sl_box .all[data-v-0b42eb78] {\n width: calc(100% / 3);\n margin-top: 40rpx;\n}\n.sl_box .sl_box_cankao[data-v-0b42eb78],\n.sl_box .sl_box_desc[data-v-0b42eb78] {\n font-size: 24rpx;\n color: #999;\n}\n.sl_box .sl_box_unit[data-v-0b42eb78] {\n font-size: 26rpx;\n}\n.sl_box .sl_box_wz[data-v-0b42eb78] {\n margin-right: 10rpx;\n font-size: 30rpx;\n font-weight: bold;\n}\n", ""]);
// Exports
module.exports = exports;

View File

@ -65,7 +65,6 @@
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) {
@ -309,7 +308,7 @@
// 判断关键字是否存在
const result = parseHealthQuery(params.msg);
console.log(result, '判断关键字是否存在')
if (result) {
DetailDay(result.dataKey, result.date).then(res => {
let TargetData = res.data.data;
@ -321,7 +320,7 @@
})
}
Question = `请模仿全科医生的口吻与我: ${user}对话,我最近测量的${result.dataKey}数据为${JSON.stringify(TargetData)},data_msg为值hour_minute为检测时间 #限制:回复用户的内容中不要出现“[]”。#限制:回复不要带英文,要都转化成汉语。#限制回复内容控制在150字。#限制:忽略“压力指数、疲劳指数、心肌炎风险、冠心病风险和动脉硬化”等数据。`
Question = `请模仿全科医生的口吻与我: ${user}对话,我最近测量的${result.dataKey}数据为${JSON.stringify(TargetData)}, #提示data_msg为值hour_minute为检测时间。#提示:“[]”表示数据为空,请在小程序上传数据。#限制:回复不要带英文,要都转化成汉语。#限制回复内容控制在150字。#限制:忽略“压力指数、疲劳指数、心肌炎风险、冠心病风险和动脉硬化”等数据。`
console.log(Question, '=========================')
/*
@ -541,7 +540,6 @@
startRec.style.display = 'none';
endRec.style.display = 'none';
console.log(endRec.style)
showModal()
});
@ -659,7 +657,10 @@
totalTime --;
if (totalTime <= 0) {
// 停止倒计时
console.log('计算结束')
startRec.style.display = 'block';
endRec.style.display = 'none';
statusTxt.value = '';
voiceTxt.innerText = '';
clearInterval(countdown);
replayVideoSegment(0, 60);
}
@ -723,11 +724,15 @@
SleepDatas: "睡眠",
bloodOxygen: "血氧",
bloodPressure: '血压',
bloodLiquid: "血脂",
meiTuo: '梅脱',
pulseReat: '心率',
bodyTemperature: '体温',
ECGData: '心电图',
bloodLiquid: {
'血脂': true,
'血液成分': true,
'尿酸': true
},
bodyData: '身体成分',
stepIndex: '运动'
};
@ -749,12 +754,30 @@
targetDate.setDate(day - 2);
}
// 格式化日期为 YYYY-MM-DD
const formattedDate = `${targetDate.getFullYear()}-${('0' + targetDate.getMonth()).slice(-2)}-${('0' + targetDate.getDate()).slice(-2)}`;
// 查找匹配的数据项键
// 创建一个辅助函数来检查 bloodLiquid 对象是否包含查询字符串
function isBloodLiquidMatch(bloodLiquidData, query) {
for (let value in bloodLiquidData) {
if (value.includes(query)) {
return true;
}
}
return false;
}
// 在查询逻辑中使用这个辅助函数
for (let key in demoData) {
if (query.includes(demoData[key])) {
if (typeof demoData[key] === 'object' && key === 'bloodLiquid') {
if (isBloodLiquidMatch(demoData[key], query)) {
const formattedDate = new Date().toISOString().split('T')[0];
return {
dataKey: key,
date: formattedDate
};
}
} else if (typeof demoData[key] === 'string' && demoData[key].includes(query)) {
const formattedDate = new Date().toISOString().split('T')[0];
return {
dataKey: key,
date: formattedDate