diff --git a/config/request.js b/config/request.js
index 3dba0a4..f8cd4cf 100644
--- a/config/request.js
+++ b/config/request.js
@@ -5,21 +5,23 @@ import { baseUrl } from "./api.js";
const HOST = location && location.origin
export default () => {
- let envRead = process.env
+ let readBaseUrl = process.env.bcUrl
+ console.log(readBaseUrl)
// 初始化请求配置
uni.$u.http.setConfig((config) => {
- // if(envRead.NODE_ENV == 'product'){
- config.baseURL = baseUrl; // 测试地址
- // }
- console.log(config,'11111111')
+ if(readBaseUrl ){
+ config.baseURL = readBaseUrl; // 测试地址
+ }
return config
});
// 请求拦截
uni.$u.http.interceptors.request.use((config) => { // 可使用async await 做异步操作
+ if(!config.baseURL){
+ config.url = '/'+config.url
+ }
config.data = config.data || {};
- console.log(config,'22222222')
// config.baseURL = 'http://test.sc2.agrimedia.cn'; // 不使用请求代理 上线记得注释掉 ***********************************************************
let apiToken = store.getters['api/getApiToken']
diff --git a/package.json b/package.json
index 1fc10c4..d7d55ff 100644
--- a/package.json
+++ b/package.json
@@ -2,5 +2,27 @@
"dependencies": {
"uview-ui": "^2.0.36",
"vuex-persistedstate": "^4.1.0"
- }
+ },
+ "uni-app": {
+ "scripts": {
+ "build:test": {
+ "title": "build:test",
+ "env": {
+ "UNI_PLATFORM": "h5",
+ "H_NODE_ENV": "development",
+ "bcUrl": ""
+ }
+ },
+ "build:pro": {
+ "title": "build:pro",
+ "env": {
+ "UNI_PLATFORM": "h5",
+ "H_NODE_ENV": "production",
+ "bcUrl": "https://ai.agirmedia.cn"
+
+ }
+ }
+ }
+ }
+
}
diff --git a/pages/index/echarts.vue b/pages/index/echarts.vue
index b31bbc9..c8c3fe4 100644
--- a/pages/index/echarts.vue
+++ b/pages/index/echarts.vue
@@ -273,6 +273,29 @@ import { mapGetters } from "vuex";
}
},
option:{
+ // tooltip: {
+ // trigger: 'item',
+ // formatter: function (params) {
+ // // params 是数据的相关信息,可以根据需要进行处理
+ // console.log(params)
+ // if(params.componentType == 'series'){
+ // return `
+ //
${params.seriesName}
+ //
${params.name}: ${params.value[1]}
+ //
`
+ // }
+ // return '';
+ // },
+ // // renderMode:'html'
+ // // axisPointer: {
+ // // type: 'line',
+ // // label: {
+ // // backgroundColor: '#6a7985'
+ // // }
+ // // },
+
+
+ // },
xAxis: {
splitLine:{
show:false
@@ -533,34 +556,34 @@ import { mapGetters } from "vuex";
case 'bloodOxygen':
data.map((v,i) => {
let timeArr = v.hour_minute.split(':');
- let dataMsg = this.getAverage(v.data_msg);
+ let dataMsg = v.data_msg.filter(item => item > 0);
if(timeArr[1] % 10 == 0){
let key = v.hour_minute
if(dataArr[key] == undefined){
dataArr[key] = {
- val:v.data_msg.filter(item => item > 0),
+ val:dataMsg,
from:0
}
}else{
- dataArr[key].val = [...dataArr[key].val,...v.data_msg.filter(item => item > 0)];
+ dataArr[key].val = [...dataArr[key].val,...dataMsg];
}
}else{
let key = timeArr[0]+':'+((timeArr[1] - 5) == 0?'00':(timeArr[1] - 5))
if(dataArr[key] == undefined){
dataArr[key] = {
- val:v.data_msg.filter(item => item > 0),
+ val:dataMsg,
from:1
}
}else{
- dataArr[key].val = [...dataArr[key].val,...v.data_msg.filter(item => item > 0)];
+ dataArr[key].val = [...dataArr[key].val,...dataMsg];
}
}
- sum += dataMsg
- v.data_msg.map((v2,i2) => {
+
+ dataMsg.map((v2,i2) => {
if(v2 > 0){
arr.push(v2)
}
@@ -581,21 +604,25 @@ import { mapGetters } from "vuex";
max = Math.max(...arr)
}
- avg = sum / data.length
- avg = parseFloat(avg.toFixed(0))
+
this.option.series[0].data = echartsData
- this.option.series[0].markLine.data[0].yAxis = avg
- this.option.series[0].markLine.data[0].value = avg
+ this.option.yAxis.axisLabel.formatter = '{value}%';
+ this.option.series[0].markLine.data[0].yAxis = this.getAverage(arr)
+ this.option.series[0].markLine.data[0].value = this.getAverage(arr)
this.option.series[0].markLine.symbol = 'none'
// this.option.series[0].markLine.data[0].type = 'average'
// this.option.series[0].markLine.data[0].name = '平均值'
this.option.series[0].markLine.lineStyle.color = this.dataConfig[this.type].color
this.option.series[0].markLine.label.color = this.dataConfig[this.type].color
this.option.series[0].markLine.label.position ='insideEndTop'
+ this.option.series[0].markLine.label.formatter = function(data){
+ return data.value + '%'
+ // console.log(data,123)
+ };
// this.option.series[0].markLine.label.distance =[10,5]
this.option.title = {
text :min + '-' + max,
- subtext: '毫摩尔/升',
+ subtext: '%',
left: 'center'
};
this.option.yAxis.splitNumber = 2;
@@ -717,11 +744,12 @@ import { mapGetters } from "vuex";
}
}else{
dataArr[key].val = [...dataArr[key].val,v.data_msg.bloodPressureHigh];
- dataArr[key].val = [...dataArr[key].val,v.data_msg.bloodPressureLow];
+ dataArr[key].val2 = [...dataArr[key].val2,v.data_msg.bloodPressureLow];
}
// let floatData = this.makeFloatHoursMinutes(timeArr[0],timeArr[1])
// echartsData.push({value:[floatData,v.data_msg],itemStyle: {color: this.dataConfig[this.type].color}})
sum += v.data_msg.bloodPressureHigh
+ console.log(v.data_msg.bloodPressureHigh)
sum2 += v.data_msg.bloodPressureLow
if(max == 0 || max < v.data_msg.bloodPressureHigh){
@@ -737,11 +765,14 @@ import { mapGetters } from "vuex";
min2 = v.data_msg.bloodPressureLow
}
})
-
avg = sum / data.length
let avg2 = sum2 / data.length
- avg = parseFloat(avg.toFixed(2))
- avg2 = parseFloat(avg2.toFixed(2))
+ avg = parseInt(avg)
+ avg2 = parseInt(avg2)
+ // console.log(avg,'ag')
+ // console.log(avg2,'ag2')
+ console.log(dataArr)
+
for (let key in dataArr) {
if (dataArr.hasOwnProperty(key)) { // 确保key是对象自身的属性
let timeArr2 = key.split(':');
@@ -770,6 +801,8 @@ import { mapGetters } from "vuex";
left: 'center'
};
this.dataConfig.bloodGlucose.title = min + '-' + max
+ // this.option.yAxis.min = parseInt(min2) - 5;
+ // this.option.yAxis.max = parseInt(max) + 5;
break;
case 'pulseReat':
@@ -826,7 +859,7 @@ import { mapGetters } from "vuex";
})
avg = sum / len
- avg = parseFloat(avg.toFixed(2))
+ avg = parseInt(avg)
for (let key in dataArr) {
if (dataArr.hasOwnProperty(key)) { // 确保key是对象自身的属性
let timeArr2 = key.split(':');
@@ -852,7 +885,7 @@ import { mapGetters } from "vuex";
this.option.yAxis.min = 30;
this.option.yAxis.max = 90;
break;
- case 'bloodLiquid':
+ case 'bloodLiquid':
data.map((v,i) => {
let dataMsg = v.data_msg;
@@ -899,12 +932,15 @@ import { mapGetters } from "vuex";
}
this.option.series[0].data = echartsData
+ //top / left / right / bottom / inside / insideLeft / insideRight / insideTop / insideBottom / insideTopLeft / insideBottomLeft / insideTopRight / insideBottomRight
+ this.option.series[0].markLine.label.position ='insideEndTop'
this.option.series[0].markLine.data[0].yAxis = avg
this.option.series[0].markLine.lineStyle.color = this.dataConfig[this.type].color
this.option.series[0].markLine.label.color = this.dataConfig[this.type].color
this.option.series[0].type = 'line'
this.option.series[0].symbol = 'none',
- this.option.series[0].smooth = true
+ this.option.series[0].smooth = true
+
this.option.series[0].itemStyle= {
color: 'rgb(255, 70, 131)'
}
@@ -932,6 +968,7 @@ import { mapGetters } from "vuex";
}
};
this.dataConfig.bloodGlucose.title = min + '-' + max
+
this.option.yAxis.axisLabel.formatter = function(v,i){
return v;
}
diff --git a/unpackage/dist/build/web/index.html b/unpackage/dist/build/web/index.html
index d3b7577..a9d5210 100644
--- a/unpackage/dist/build/web/index.html
+++ b/unpackage/dist/build/web/index.html
@@ -1,2 +1,2 @@
智能终端
\ No newline at end of file
+ document.write('')