Merge branch 'dev' into lzwdev

master
blak-kong 2 years ago
commit d467abfc6d

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

@ -660,32 +660,38 @@ class IotCarePlanFR200 extends Component<any, any> {
}); });
// return; // return;
let { currentDevice, ActiveModeItem } = this.state; let { currentDevice, ActiveModeItem } = this.state;
let params = {}; let params:any = {};
let nursingData = {
nursingData: JSON.stringify({
GearData: [...waterStepList],
}),
};
params = { params = {
instrumentId: currentDevice.id, instrumentId: currentDevice.id,
instrumentName: currentDevice.name, instrumentName: currentDevice.name,
modeId: ActiveModeItem.id, modeId: ActiveModeItem.id,
modeName: ActiveModeItem.modeName, modeName: ActiveModeItem.modeName,
nursingTime: s_to_hms(this.elapsedTime), nursingTime: s_to_hms(this.elapsedTime),
nursingData: JSON.stringify({
GearData: [...waterStepList],
})
}; };
params = { ...params, ...nursingData };
// params = { ...params, ...nursingData };
let res: any = await InstrumentInfo.apiNursingLog.addLog( let res: any = await InstrumentInfo.apiNursingLog.addLog(
JSON.stringify(params) JSON.stringify(
params
)
); );
setTimeout(() => { setTimeout(async() => {
this.setState({ this.setState({
isShowNursingSuccess: false, isShowNursingSuccess: false,
}); });
go( let date = new Date();
`/recoding/pages/moisture_test_report/moisture_test_report?data=${nursingData}&date=${s_to_hms(
this.elapsedTime let year = date.getFullYear();
)}&modeId=${ActiveModeItem.id}` 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); }, 2000);
}; };
@ -872,6 +878,7 @@ class IotCarePlanFR200 extends Component<any, any> {
let num = waterStepIndex; let num = waterStepIndex;
if (waterStepIndex < 2) { if (waterStepIndex < 2) {
num = waterStepIndex + 1; num = waterStepIndex + 1;
this.waterTestNext(num)
} }
this.setState({ this.setState({
timerIdSuccess: null, timerIdSuccess: null,
@ -1305,21 +1312,14 @@ class IotCarePlanFR200 extends Component<any, any> {
* @name * @name
* @description +1 * @description +1
*/ */
waterTestNext() { waterTestNext(index) {
let { TestModeStepIndex, ActiveModeItem } = this.state; let ActiveModeItem =this.state.ActiveModeItem
if (TestModeStepIndex < 3) { if (index === 0 && ActiveModeItem.stepOneVideo) {
let index = TestModeStepIndex + 1; // 提前步骤+1 this.VideoSrcLoad(ActiveModeItem.stepOneVideo);
this.setState({ } else if (index === 1 && ActiveModeItem.stepTwoVideo) {
TestModeStepIndex: index, this.VideoSrcLoad(ActiveModeItem.stepTwoVideo);
}); } else if (index === 2 && ActiveModeItem.stepThreeVideo) {
this.VideoSrcLoad(ActiveModeItem.stepThreeVideo);
if (index === 1 && ActiveModeItem.stepOneVideo) {
this.VideoSrcLoad(ActiveModeItem.stepOneVideo);
} else if (index === 2 && ActiveModeItem.stepTwoVideo) {
this.VideoSrcLoad(ActiveModeItem.stepTwoVideo);
} else if (index === 3 && ActiveModeItem.stepThreeVideo) {
this.VideoSrcLoad(ActiveModeItem.stepThreeVideo);
}
} }
} }
@ -1563,6 +1563,7 @@ class IotCarePlanFR200 extends Component<any, any> {
// 水分测试需要特殊处理 // 水分测试需要特殊处理
// 水分测试准备 水分测试工作 水分测试启动 // 水分测试准备 水分测试工作 水分测试启动
if (ActiveModeItem.modeType === "moistureTest") { if (ActiveModeItem.modeType === "moistureTest") {
let that =this
sendParams.testStatus = "standby"; // 切换为准备 sendParams.testStatus = "standby"; // 切换为准备
let waterStepList = this.state.waterStepList; let waterStepList = this.state.waterStepList;
let waterStepIndex = this.state.waterStepIndex; let waterStepIndex = this.state.waterStepIndex;
@ -1574,16 +1575,16 @@ class IotCarePlanFR200 extends Component<any, any> {
timerIdSuccess = setTimeout(function () { timerIdSuccess = setTimeout(function () {
waterStepList[waterStepIndex].finish = true; waterStepList[waterStepIndex].finish = true;
this.setState({ that.setState({
waterStepList, waterStepList,
}); });
}, 2000); }, 2000);
this.setState({ that.setState({
waterStepList, waterStepList,
timerIdSuccess, timerIdSuccess,
}); });
}, 3000); }, 3000);
this.setState({ that.setState({
isRuningTest: 2, isRuningTest: 2,
timerIdSchedule, timerIdSchedule,
}); });
@ -1969,8 +1970,10 @@ class IotCarePlanFR200 extends Component<any, any> {
// 脸部one // 脸部one
todoPromise = async () => { todoPromise = async () => {
const nowFR200NursingHistory = Taro.getStorageSync("FR200NursingHistory"); const nowFR200NursingHistory = Taro.getStorageSync("FR200NursingHistory");
console.log(nowFR200NursingHistory,'nowFR200NursingHistory');
// 护理脸部 // 护理脸部
if (nowFR200NursingHistory.workMode === "face") { if (nowFR200NursingHistory.jsonStatus.workMode === "face") {
// 把working=工作中的状态数据筛选出来 // 把working=工作中的状态数据筛选出来
let filtered = nowFR200NursingHistory.dataArray.filter( let filtered = nowFR200NursingHistory.dataArray.filter(
(item) => item.workStatus === "working" (item) => item.workStatus === "working"
@ -2033,23 +2036,7 @@ class IotCarePlanFR200 extends Component<any, any> {
}; };
return nursingData; 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", "headLiftingPro",
].includes(nursingData.workMode) ].includes(nursingData.workMode)
) { ) {
let obj = { // let obj = {
modeName: nursingData.modeName, // modeName: nursingData.modeName,
data: nursingData, // data: nursingData,
}; // };
let report = true; let report = true;
go( go(
"/recoding/pages/face_report_one/face_report_one?id=" + "/recoding/pages/face_report_one/face_report_one?id=" +
id + id +
"&report=" + "&report=" +
report + report
"&obj=" +
JSON.stringify(obj)
); );
} else if ("moistureTest" === nursingData.workMode) { } else if ("moistureTest" === nursingData.workMode) {
console.log("水分测试"); console.log("水分测试");
} else { } else {
let report = true;
go( go(
"/recording/pages/face_report/face_report?id=" + "/recoding/pages/face_report/face_report?id=" +
this.state.currentDevice.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; padding: 35rpx 25rpx 25rpx 35rpx;
box-sizing: border-box; box-sizing: border-box;
position: relative; 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 { .fullscreen {

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

@ -4,7 +4,10 @@ import { Block, View, Image, Text, Input } from "@tarojs/components";
import { Popup, Progress, Slider } from "@antmjs/vantui"; import { Popup, Progress, Slider } from "@antmjs/vantui";
import { useRef } from "react"; import { useRef } from "react";
import Echarts, { EChartOption, EchartsHandle } from "taro-react-echarts"; 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"; import "./index.less";
@ -15,7 +18,11 @@ interface Props {
function Index({ function Index({
EchartsData EchartsData
}:Props) { }:Props) {
let type =0 let type =0
// console.log(EchartsData,'EchartsDataEchartsData');
switch(EchartsData.modeName) { switch(EchartsData.modeName) {
case '基础班脸部': case '基础班脸部':
type=37 type=37
@ -35,7 +42,9 @@ function Index({
default: default:
} }
const echartsRef = useRef<EchartsHandle>(null); const echartsRef = useRef<EchartsHandle>(null);
function generateColorArray(startColor, endColor, steps) { function generateColorArray(startColor, endColor, steps) {
var startRGB = hexToRgb(startColor); var startRGB = hexToRgb(startColor);
var endRGB = hexToRgb(endColor); var endRGB = hexToRgb(endColor);
@ -73,18 +82,16 @@ function Index({
const colors = generateColorArray(startColor, endColor, steps); 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 =[] let seriesData:any =[]
seriesData = EchartsData?.data?.groupedAa 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 = [ // const seriesData = [
// ...xList.map((item) => { // ...xList.map((item) => {
// return Math.random() * 80; // return Math.random() * 80;
// }), // }),
// ]; // ];
const option: EChartOption = {
const option: EChartOption ={
grid: { grid: {
// 让图表占满容器 // 让图表占满容器
top: "10rpx", top: "10rpx",
@ -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 ( return (
<Block> <Block>
<Echarts <Echarts

@ -76,29 +76,32 @@ export default class Index extends Component<any, any> {
} }
} }
async getRecord(id, recordId) { async getRecord(id, instrumentId) {
console.log("id, recordId", id, recordId); console.log("id, nursingLogId", id, instrumentId);
let data = {}; let data = {};
if (id != null) { 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 (res.data.code === 200) {
if (recordId) { if (instrumentId) {
res.data.rows.map((item) => { res.data.rows.map((item) => {
item.nursingTime = this.getTime(item.nursingTime); item.nursingTime = this.getTime(item.nursingTime);
item.createTime = getdates(item.createTime).replace(/-/g, "."); 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({ 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> </View>
{/* </block> */} {/* </block> */}
</View> </View>
<View className='main m-x-30'> <View className="main m-x-30">
<View className='products_item' style='border: none'> <View className="products_item" style="border: none">
<View className='products_top flex aitems'> <View className="products_top flex aitems">
<View className='add_time'>{recordData.createTime}</View> <View className="add_time">{recordData?.createTime}</View>
<View <View
className={classnames("tag", { className={classnames("tag", {
tag_active: recordData.online === 2, tag_active: recordData.online === 2,

@ -75,12 +75,23 @@ export default class Index extends Component<any, any> {
} }
// 查询用户护理记录的当月统计信息 // 查询用户护理记录的当月统计信息
async getStatistics(id) { async getStatistics(id) {
let ids = Number(id)
let data = {}; let data = {};
if (id != null) { if (ids != null) {
data["instrumentId"] = id; data["nursingId"] = ids;
} }
let res = await InstrumentInfo.apiNursingLog.getStatistics(data); 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) { if (res.data.code === 200) {
this.setState({ statistics: res.data.data }); this.setState({ statistics: res.data.data });
} }
@ -280,7 +291,10 @@ export default class Index extends Component<any, any> {
// this.getClockStatistics() // this.getClockStatistics()
} }
init(options){ init(options){
let obj =JSON.parse(options.obj) let obj =JSON.parse(options.obj)
console.log(obj,'obj111111111111111');
let recordData =this.state.recordData let recordData =this.state.recordData
let modeImage =this.state.modeImage let modeImage =this.state.modeImage
@ -308,10 +322,6 @@ export default class Index extends Component<any, any> {
...obj.data ...obj.data
} }
this.setState({recordData,modeImage,EchartsData:{...obj}}) this.setState({recordData,modeImage,EchartsData:{...obj}})
console.log(obj,'查看');
} }
componentDidShow() { } componentDidShow() { }

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

@ -299,7 +299,8 @@ export default class Recording extends Component<any, any> {
setStorageSync("instrument_detail", instrument); setStorageSync("instrument_detail", instrument);
} }
}) })
console.log(item,'查看');
if ([1, 2, 3, 4, 5].includes(item.jumpType)) { if ([1, 2, 3, 4, 5].includes(item.jumpType)) {
this.One(item); this.One(item);
} else if (item.jumpType === 0) { } else if (item.jumpType === 0) {
@ -315,28 +316,42 @@ export default class Recording extends Component<any, any> {
} }
// 打开第一种类型 // 打开第一种类型
One = async (item) => { 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)
nursingData.groupedAa.push(50)
let obj ={
modeName:res2.data.data.modeName,
data:nursingData
}
let report = false; let report = false;
let nursingData = JSON.parse(item.nursingData)
let obj = {
modeName: item.modeName,
data: nursingData
}
console.log("打开第一种类型", item, obj);
go( go(
"/recoding/pages/face_report_one/face_report_one?id=" + "/recoding/pages/face_report_one/face_report_one?id=" +
item.id + item.id +
"&report=" + "&report=" +
report + "&obj=" + report+ "&obj=" +
JSON.stringify(obj) JSON.stringify(obj)
); );
}; };
// 打开第二种类型 // 打开第二种类型
two = async (item) => { two = async (item) => {
console.log("打开第二种类型", 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) => { three = async (item) => {
go(`/recoding/pages/moisture_test_report/moisture_test_report?data=${item.nursingData}&date=${item.createTime}&modeId=${item.modeId}&id=${item.instrumentId}`); 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), url: "/nursingLog/record" + paramsToUrlQueryString(data),
method: "get", 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) => { getStatistics: (data) => {
@ -414,6 +428,21 @@ export const InstrumentInfo = {
method: "get", 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:{
// 查询用户FR200水分报告护理记录 // 查询用户FR200水分报告护理记录

Loading…
Cancel
Save