Merge branch 'dev' into lzwdev

master
blak-kong 2 years ago
commit d467abfc6d

@ -85,7 +85,7 @@ export default defineAppConfig({
"pages/recording/recording",
"pages/face_report_one/face_report_one",
"pages/moisture_test_report/moisture_test_report",
"pages/face_report/face_report",
],
},
{

@ -660,32 +660,38 @@ class IotCarePlanFR200 extends Component<any, any> {
});
// return;
let { currentDevice, ActiveModeItem } = this.state;
let params = {};
let nursingData = {
nursingData: JSON.stringify({
GearData: [...waterStepList],
}),
};
let params:any = {};
params = {
instrumentId: currentDevice.id,
instrumentName: currentDevice.name,
modeId: ActiveModeItem.id,
modeName: ActiveModeItem.modeName,
nursingTime: s_to_hms(this.elapsedTime),
nursingData: JSON.stringify({
GearData: [...waterStepList],
})
};
params = { ...params, ...nursingData };
// params = { ...params, ...nursingData };
let res: any = await InstrumentInfo.apiNursingLog.addLog(
JSON.stringify(params)
JSON.stringify(
params
)
);
setTimeout(() => {
setTimeout(async() => {
this.setState({
isShowNursingSuccess: false,
});
go(
`/recoding/pages/moisture_test_report/moisture_test_report?data=${nursingData}&date=${s_to_hms(
this.elapsedTime
)}&modeId=${ActiveModeItem.id}`
);
let date = new Date();
let year = date.getFullYear();
let month = (date.getMonth() + 1).toString().padStart(2, '0');
let day = date.getDate().toString().padStart(2, '0');
let formattedDate = `${year}.${month}.${day}`;
go(`/recoding/pages/moisture_test_report/moisture_test_report?data=${params.nursingData}&date=${formattedDate}&modeId=${ActiveModeItem.id}&id=${currentDevice.id}`);
}, 2000);
};
@ -872,6 +878,7 @@ class IotCarePlanFR200 extends Component<any, any> {
let num = waterStepIndex;
if (waterStepIndex < 2) {
num = waterStepIndex + 1;
this.waterTestNext(num)
}
this.setState({
timerIdSuccess: null,
@ -1305,23 +1312,16 @@ class IotCarePlanFR200 extends Component<any, any> {
* @name
* @description +1
*/
waterTestNext() {
let { TestModeStepIndex, ActiveModeItem } = this.state;
if (TestModeStepIndex < 3) {
let index = TestModeStepIndex + 1; // 提前步骤+1
this.setState({
TestModeStepIndex: index,
});
if (index === 1 && ActiveModeItem.stepOneVideo) {
waterTestNext(index) {
let ActiveModeItem =this.state.ActiveModeItem
if (index === 0 && ActiveModeItem.stepOneVideo) {
this.VideoSrcLoad(ActiveModeItem.stepOneVideo);
} else if (index === 2 && ActiveModeItem.stepTwoVideo) {
} else if (index === 1 && ActiveModeItem.stepTwoVideo) {
this.VideoSrcLoad(ActiveModeItem.stepTwoVideo);
} else if (index === 3 && ActiveModeItem.stepThreeVideo) {
} else if (index === 2 && ActiveModeItem.stepThreeVideo) {
this.VideoSrcLoad(ActiveModeItem.stepThreeVideo);
}
}
}
/**
* @name ,
@ -1563,6 +1563,7 @@ class IotCarePlanFR200 extends Component<any, any> {
// 水分测试需要特殊处理
// 水分测试准备 水分测试工作 水分测试启动
if (ActiveModeItem.modeType === "moistureTest") {
let that =this
sendParams.testStatus = "standby"; // 切换为准备
let waterStepList = this.state.waterStepList;
let waterStepIndex = this.state.waterStepIndex;
@ -1574,16 +1575,16 @@ class IotCarePlanFR200 extends Component<any, any> {
timerIdSuccess = setTimeout(function () {
waterStepList[waterStepIndex].finish = true;
this.setState({
that.setState({
waterStepList,
});
}, 2000);
this.setState({
that.setState({
waterStepList,
timerIdSuccess,
});
}, 3000);
this.setState({
that.setState({
isRuningTest: 2,
timerIdSchedule,
});
@ -1969,8 +1970,10 @@ class IotCarePlanFR200 extends Component<any, any> {
// 脸部one
todoPromise = async () => {
const nowFR200NursingHistory = Taro.getStorageSync("FR200NursingHistory");
console.log(nowFR200NursingHistory,'nowFR200NursingHistory');
// 护理脸部
if (nowFR200NursingHistory.workMode === "face") {
if (nowFR200NursingHistory.jsonStatus.workMode === "face") {
// 把working=工作中的状态数据筛选出来
let filtered = nowFR200NursingHistory.dataArray.filter(
(item) => item.workStatus === "working"
@ -2032,22 +2035,6 @@ class IotCarePlanFR200 extends Component<any, any> {
}),
};
return nursingData;
} else {
let GearData = this.state.GearData;
// 肌肤报告
let Allnum = 0;
GearData.forEach((e) => {
Allnum = +e.forehead;
});
// 向下取整
Allnum = Math.floor(Allnum / 3);
let nursingData = {
nursingData: JSON.stringify({
Allnum,
GearData,
}),
};
return nursingData;
}
};
@ -2217,26 +2204,31 @@ class IotCarePlanFR200 extends Component<any, any> {
"headLiftingPro",
].includes(nursingData.workMode)
) {
let obj = {
modeName: nursingData.modeName,
data: nursingData,
};
// let obj = {
// modeName: nursingData.modeName,
// data: nursingData,
// };
let report = true;
go(
"/recoding/pages/face_report_one/face_report_one?id=" +
id +
"&report=" +
report +
"&obj=" +
JSON.stringify(obj)
report
);
} else if ("moistureTest" === nursingData.workMode) {
console.log("水分测试");
} else {
let report = true;
go(
"/recording/pages/face_report/face_report?id=" +
this.state.currentDevice.id
"/recoding/pages/face_report/face_report?id=" +
this.state.currentDevice.id+
"&report=" +
report
);
// go(
// "/recoding/pages/face_report/face_report?id=" +
// this.state.currentDevice.id
// );
}
};

@ -7,6 +7,16 @@
padding: 35rpx 25rpx 25rpx 35rpx;
box-sizing: border-box;
position: relative;
// writing-mode: vertical-lr;
// text-orientation: upright;
// white-space: nowrap;
// font-size: 18px;
// font-weight: bold;
// background-color: #c2e5f3;
// color: #fff;
// width: 100%;
}
.fullscreen {

@ -21,6 +21,7 @@ function Index({ data }: Props) {
animation: false,
grid: {
// 让图表占满容器
// containLabel: true,
top: "28rpx",
left: "18rpx",
right: "28rpx",

@ -4,7 +4,10 @@ import { Block, View, Image, Text, Input } from "@tarojs/components";
import { Popup, Progress, Slider } from "@antmjs/vantui";
import { useRef } from "react";
import Echarts, { EChartOption, EchartsHandle } from "taro-react-echarts";
import echarts from "@/utils/echarts.min.js";
// import echarts from "@/utils/echarts.min.js";
import * as echarts from "echarts";
import React, { useState, useEffect,useMemo } from 'react';
import "./index.less";
@ -15,7 +18,11 @@ interface Props {
function Index({
EchartsData
}:Props) {
let type =0
// console.log(EchartsData,'EchartsDataEchartsData');
switch(EchartsData.modeName) {
case '基础班脸部':
type=37
@ -35,7 +42,9 @@ function Index({
default:
}
const echartsRef = useRef<EchartsHandle>(null);
function generateColorArray(startColor, endColor, steps) {
var startRGB = hexToRgb(startColor);
var endRGB = hexToRgb(endColor);
@ -73,17 +82,15 @@ function Index({
const colors = generateColorArray(startColor, endColor, steps);
const xList = [...new Array(type).fill(0).map((item, key) => key)];
// const xList = [...new Array(type).fill(0).map((item, key) => key)];
let seriesData:any =[]
seriesData = EchartsData?.data?.groupedAa
// const xList = [...new Array(37).fill(0).map((item, key) => key)];
const xList = [...new Array(type).fill(0).map((item, key) => key)];
// const seriesData = [
// ...xList.map((item) => {
// return Math.random() * 80;
// }),
// ];
const option: EChartOption = {
grid: {
// 让图表占满容器
@ -165,8 +172,93 @@ seriesData = EchartsData?.data?.groupedAa
},
},
],
};
let arr = [2, 3, 4, 5, 6, 7]
}
// 基于 EchartsData 生成 ECharts 配置
// const option: EChartOption ={
// grid: {
// // 让图表占满容器
// top: "10rpx",
// left: "45rpx",
// right: "28rpx",
// bottom: "17rpx",
// },
// xAxis: {
// type: "category",
// data: [...xList],
// axisLabel: {
// interval: 5,
// formatter: function (value, index) {
// return value * 10 + 's';
// },
// textStyle: {
// color: '#999999', // 文字颜色
// fontSize: 8 // 文字大小
// },
// },
// axisTick: {
// // alignWithLabel: true,
// show: false,
// interval: 9,
// },
// // axisLine: {
// // show: false,
// // },
// },
// yAxis: [
// {
// min: 0,
// max: 80,
// splitNumber: 10,
// axisLabel: {
// formatter: function (value, index) {
// const num = value / 10 + 1
// return num === 9 ? '' : num + '级';
// },
// textStyle: {
// color: '#999999', // 文字颜色
// fontSize: 8 // 文字大小
// },
// },
// type: "value",
// splitLine: {
// lineStyle: {
// color: ["#ccc", "#ccc", "#ccc", "#ccc", "#ccc", "#ccc", "#ccc", "#ccc", "#fff"],
// type: 'dashed'
// },
// }
// },
// ],
// series: [
// {
// barCategoryGap: '0%',
// data: seriesData,
// type: "bar",
// // barWidth: 15,
// gapWidth: "0%",
// itemStyle: {
// normal: {
// color: function (params) {
// var value = params.data;
// return new echarts.graphic.LinearGradient(0, 0, 0, 1, [
// {
// offset: 0,
// color: colors[parseInt(value)], // 红色
// },
// {
// offset: 1,
// color: colors[0], // 黄色
// },
// ]);;
// },
// },
// },
// },
// ],
// };
return (
<Block>
<Echarts

@ -76,29 +76,32 @@ export default class Index extends Component<any, any> {
}
}
async getRecord(id, recordId) {
console.log("id, recordId", id, recordId);
async getRecord(id, instrumentId) {
console.log("id, nursingLogId", id, instrumentId);
let data = {};
if (id != null) {
data["instrumentId"] = id;
data["nursingLogId"] = id;
}
let res = await InstrumentInfo.apiNursingLog.getRecord(data);
// 获取当前
let res1 = await InstrumentInfo.apiNursingLog.getRecordNow(id);
// 获取历史记录列表
let res = await InstrumentInfo.apiNursingLog.getRecordNew(data);
res1.data.data.nursingTime = this.getTime(res1.data.data.nursingTime);
res1.data.data.createTime = getdates(res1.data.data.createTime).replace(/-/g, ".");
this.setState({ recordData: res1.data.data });
if (res.data.code === 200) {
if (recordId) {
if (instrumentId) {
res.data.rows.map((item) => {
item.nursingTime = this.getTime(item.nursingTime);
item.createTime = getdates(item.createTime).replace(/-/g, ".");
if (item.id == recordId) {
this.setState({ recordData: item });
}
});
} else {
this.setState({ recordData: res.data.rows[0] });
}
this.setState({
recordList: res.data.rows.filter((item) => item.id != recordId),
recordList: res.data.rows.filter((item) => item.id != instrumentId),
});
}
}
@ -310,10 +313,10 @@ export default class Index extends Component<any, any> {
</View>
{/* </block> */}
</View>
<View className='main m-x-30'>
<View className='products_item' style='border: none'>
<View className='products_top flex aitems'>
<View className='add_time'>{recordData.createTime}</View>
<View className="main m-x-30">
<View className="products_item" style="border: none">
<View className="products_top flex aitems">
<View className="add_time">{recordData?.createTime}</View>
<View
className={classnames("tag", {
tag_active: recordData.online === 2,

@ -75,12 +75,23 @@ export default class Index extends Component<any, any> {
}
// 查询用户护理记录的当月统计信息
async getStatistics(id) {
let data = {};
if (id != null) {
data["instrumentId"] = id;
}
let res = await InstrumentInfo.apiNursingLog.getStatistics(data);
let ids = Number(id)
let data = {};
if (ids != null) {
data["nursingId"] = ids;
}
let res = await InstrumentInfo.apiNursingLog.getStatisticsFace(data);
// // 获取echarts数据 这个是获取接口更新echarts页面
// let res2 = await InstrumentInfo.apiNursingLog.getStatiCDE(ids);
// let nursingData=JSON.parse(res2.data.data.nursingData)
// let obj ={
// modeName:res2.data.data.modeName,
// data:nursingData
// }
// this.init({
// obj:JSON.stringify(obj)
// })
if (res.data.code === 200) {
this.setState({ statistics: res.data.data });
}
@ -280,7 +291,10 @@ export default class Index extends Component<any, any> {
// this.getClockStatistics()
}
init(options){
let obj =JSON.parse(options.obj)
console.log(obj,'obj111111111111111');
let recordData =this.state.recordData
let modeImage =this.state.modeImage
@ -308,10 +322,6 @@ export default class Index extends Component<any, any> {
...obj.data
}
this.setState({recordData,modeImage,EchartsData:{...obj}})
console.log(obj,'查看');
}
componentDidShow() { }

@ -4,7 +4,7 @@ import { Block, View, Image, Text, Input } from "@tarojs/components";
import { Popup, Progress, Slider } from "@antmjs/vantui";
import { useRef } from "react";
import Echarts, { EChartOption, EchartsHandle } from "taro-react-echarts";
import echarts from "@/utils/echarts.min.js";
import * as echarts from "echarts";
import "./index.less";
interface Props {

@ -299,6 +299,7 @@ export default class Recording extends Component<any, any> {
setStorageSync("instrument_detail", instrument);
}
})
console.log(item,'查看');
if ([1, 2, 3, 4, 5].includes(item.jumpType)) {
this.One(item);
@ -315,14 +316,19 @@ export default class Recording extends Component<any, any> {
}
// 打开第一种类型
One = async (item) => {
let ids =Number(item.id)
// 获取echarts数据 这个是获取接口更新echarts页面
let res2 = await InstrumentInfo.apiNursingLog.getStatiCDE(ids);
let nursingData=JSON.parse(res2.data.data.nursingData)
let report = false;
let nursingData = JSON.parse(item.nursingData)
nursingData.groupedAa.push(50)
let obj ={
modeName: item.modeName,
modeName:res2.data.data.modeName,
data:nursingData
}
console.log("打开第一种类型", item, obj);
let report = false;
go(
"/recoding/pages/face_report_one/face_report_one?id=" +
item.id +
@ -334,9 +340,18 @@ export default class Recording extends Component<any, any> {
// 打开第二种类型
two = async (item) => {
console.log("打开第二种类型", item);
let report = false;
go(
"/recoding/pages/face_report/face_report?id=" +
item.id +
"&recordId=" + item.instrumentId+
"&report=" +
report
);
};
// 打开第三种类型
three = async (item) => {
go(`/recoding/pages/moisture_test_report/moisture_test_report?data=${item.nursingData}&date=${item.createTime}&modeId=${item.modeId}&id=${item.instrumentId}`);
};
// 打开其他类型

@ -406,6 +406,20 @@ export const InstrumentInfo = {
url: "/nursingLog/record" + paramsToUrlQueryString(data),
method: "get",
});
},
/**查询用户护理记录(新接口,查看历史记录)*/
getRecordNew: (data) => {
return Ajax({
url: "/nursingLog/record/fr200/other" + paramsToUrlQueryString(data),
method: "get",
});
},
/**查询用户护理记录(当前)*/
getRecordNow: (data) => {
return Ajax({
url: `/nursingLog/${data}` ,
method: "get",
});
},
/**查询用户护理记录的当月统计信息*/
getStatistics: (data) => {
@ -414,6 +428,21 @@ export const InstrumentInfo = {
method: "get",
});
},
/*脸部能量时间*/
getStatisticsFace: (data) => {
return Ajax({
url: "/nursingLog/fr200/statistics" + paramsToUrlQueryString(data),
method: "get",
});
},
/**获取脸部能量图数据*/
getStatiCDE: (data) => {
return Ajax({
url: `/nursingLog/${data}`,
method: "get",
});
},
},
fr200:{
// 查询用户FR200水分报告护理记录

Loading…
Cancel
Save