合并冲突

master
blak-kong 2 years ago
commit 88bc691525

@ -83,9 +83,9 @@ export default defineAppConfig({
root: "recoding",
pages: [
"pages/recording/recording",
"pages/face_report/face_report",
"pages/face_report_one/face_report_one",
"pages/moisture_test_report/moisture_test_report",
"pages/face_report/face_report",
],
},
{

@ -45,3 +45,6 @@
}
}
}
.show {
display: none;
}

@ -3,16 +3,15 @@ import dayjs from "dayjs";
import classnames from "classnames";
import { debounce } from "lodash";
// eslint-disable-next-line import/no-named-as-default
import React, {
Component,
PropsWithChildren,
useEffect,
useState,
} from "react";
import Echarts from "./components/Echart/index";
import Gears from "./components/Gears/index";
/*** redux ***/
import { connect } from "react-redux";
/*** redux end ***/
import {
Block,
View,
@ -23,9 +22,27 @@ import {
Button,
} from "@tarojs/components";
/*** redux ***/
import { connect } from "react-redux";
/*** redux end ***/
import {
notifyBLECharacteristicValueChange,
sendCommand,
} from "@/utils/bluetoothWXAPI";
import {
deviceCommandSamples,
bleCommandSamples,
} from "@/components/bluetoot/connection/wl200";
import { minSecToS, s_to_ms, s_to_hms, sleep, s_to_s } from "@/utils/util";
// import { DeviceToolKit as DeviceToolKitWE100 } from "@flossom-npm/iot-translater-we100";
import {
DeviceToolKit as DeviceToolKitWM,
TResponseFromDevice as TResponseFromDeviceWM,
} from "@flossom-npm/iot-translater";
import commandMap from "@/utils/commandMap";
import { Popup } from "@antmjs/vantui";
import { fr200BleCommand } from "@/components/bluetoot/connection/fr200";
import { go, getStorageSync, setStorageSync, msg } from "@/utils/traoAPI";
import { InstrumentInfo } from "@/utils/Interface";
/* 公共组件 */
import Navbar from "@/components/navbar/navbar";
@ -45,28 +62,10 @@ import Footer from "./components/Footer/FR200";
import WaterTest from "./components/WaterTest/index";
/* 本页组件 END */
import { go, getStorageSync, setStorageSync, msg } from "@/utils/traoAPI";
import { InstrumentInfo } from "@/utils/Interface";
import "./FR200.less";
import {
notifyBLECharacteristicValueChange,
sendCommand,
} from "@/utils/bluetoothWXAPI";
import {
deviceCommandSamples,
bleCommandSamples,
} from "@/components/bluetoot/connection/wl200";
import Echarts from "./components/Echart";
import Gears from "./components/Gears";
import { minSecToS, s_to_ms, s_to_hms, sleep, s_to_s } from "@/utils/util";
// import { DeviceToolKit as DeviceToolKitWE100 } from "@flossom-npm/iot-translater-we100";
import {
DeviceToolKit as DeviceToolKitWM,
TResponseFromDevice as TResponseFromDeviceWM,
} from "@flossom-npm/iot-translater";
import commandMap from "@/utils/commandMap";
import { Popup } from "@antmjs/vantui";
import { fr200BleCommand } from "@/components/bluetoot/connection/fr200";
import "./FR200.less";
const deviceToolKitInstanceFR200 = new DeviceToolKitWM("FR200");
let deviceToolKitInstance = deviceToolKitInstanceFR200;
@ -230,6 +229,8 @@ class IotCarePlanFR200 extends Component<any, any> {
// isFirstEntryMode: false, // 模式首次打开
isShowHistoryMsg: false, // 是否显示正在同步历史
showEcharts: false,
echartsData: "", //传给echarts图表的数据
};
}
@ -439,6 +440,10 @@ class IotCarePlanFR200 extends Component<any, any> {
this.modeCurrentFun(res.data.data[0]);
}, 100);
}
let res1 = res.data.data.find((e) => e.id == this.state.activeModeID);
setTimeout(() => {
this.modeCurrentFun(res1);
}, 100);
} else {
this.setState({ ModeList: [] });
}
@ -696,6 +701,20 @@ class IotCarePlanFR200 extends Component<any, any> {
this.showTips("检测到您的设备没有紧贴肌肤,请紧贴肌肤后重新尝试");
});
};
look() {
let that = this;
// this.setState({ showEcharts: !this.state.showEcharts });
let stop = 0;
let time = setInterval(function () {
stop++;
let random = Math.random();
that.setState({ echartsData: random });
if (stop >= 20) {
clearInterval(time);
}
}, 1000);
}
updata() {}
// 绘制能量图
drawProwerPicture() {}
@ -2215,7 +2234,7 @@ class IotCarePlanFR200 extends Component<any, any> {
console.log("水分测试");
} else {
go(
"/recoding/pages/face_report/face_report?id=" +
"/recording/pages/face_report/face_report?id=" +
this.state.currentDevice.id
);
}
@ -2380,6 +2399,10 @@ class IotCarePlanFR200 extends Component<any, any> {
TestModeStepIndex,
currentVideoSrc,
currentGear,
showEcharts,
echartsData,
isShowReReadRecordConnect,
currentServiceData,
} = this.state;
return (
@ -2599,16 +2622,14 @@ class IotCarePlanFR200 extends Component<any, any> {
onModeLockOpen={this.onModeLockOpen}
/>
)}
<button onClick={this.look.bind(this)}>echarts </button>
<button onClick={this.updata.bind(this)}> </button>
<View className={classnames({ show: showEcharts })}>
<Echarts data={echartsData}></Echarts>
</View>
{/* {(ActiveModeItem.modeType === "face" ||
ActiveModeItem.modeType === "eyes") && (
<Block>
<Echarts></Echarts>
</Block>
)} */}
{/* <View style="display:none;">
<Echarts></Echarts>
</View> */}
ActiveModeItem.modeType === "eyes") && <Echarts></Echarts>} */}
{(ActiveModeItem.modeType === "maskPenetration" ||
ActiveModeItem.modeType === "essence") && (

@ -1928,10 +1928,7 @@ class IotCarePlanWL200 extends Component<any, any> {
goFaceReport = () => {
// 跳转前置空定时器,防止重复提交
if (currentTimeTimer) clearInterval(currentTimeTimer);
go(
"/recoding/pages/face_report/face_report?id=" +
this.state.currentDevice.id
);
go("/recording/pages/face_report/face_report?id=" + this.state.currentDevice.id);
};
// 完成配对

@ -1,13 +1,41 @@
.box {
width: 690rpx;
height: 320rpx;
margin: 28rpx auto;
margin: 28rpx auto 150rpx;
background-color: #fff;
border-radius: 30rpx;
padding: 35rpx 25rpx 25rpx 35rpx;
box-sizing: border-box;
position: relative;
}
.fullscreen {
position: fixed;
top: 450rpx;
left: -450rpx;
right: 0;
bottom: 0;
width: 100vh;
height: 100vw;
z-index: 9999;
background-color: rgba(0, 0, 0, 0.5); /* 背景色 */
transform: rotate(90deg);
// animation: rotate 0s linear;
}
@keyframes rotate {
from {
width: 690rpx;
height: 320rpx;
transform: rotate(0deg);
}
to {
width: 100vh;
height: 100vw;
transform: rotate(0deg);
}
}
.box_background {
position: absolute;
top: 0;
@ -29,6 +57,7 @@
position: absolute;
top: 32rpx;
right: 26rpx;
z-index: 2;
}
.line {
margin: 0 0 6rpx 35rpx;

@ -2,25 +2,23 @@ import Taro from "@tarojs/taro";
import classnames from "classnames";
import { Block, View, Image, Text, Input } from "@tarojs/components";
import { Popup, Progress, Slider } from "@antmjs/vantui";
import { useRef } from "react";
import { useEffect, useRef, useState, useCallback } from "react";
import Echarts, { EChartOption, EchartsHandle } from "taro-react-echarts";
import echarts from "@/utils/echarts.min.js";
import "./index.less";
interface Props {
Electricity: any;
matrixElectricity: any;
facialMaskConnectStatus: any;
data: any
}
function Index() {
function Index({ data }: Props) {
const buttonRef = useRef(null);
const echartsRef = useRef<EchartsHandle>(null);
const option: EChartOption = {
const [options, setOptions] = useState({
animation: false,
grid: {
// 让图表占满容器
top: "28rpx",
@ -258,14 +256,82 @@ function Index() {
},
},
],
};
})
const level = [8, 7, 6, 5, 4, 3, 2];
const full = () => {
let box = document.getElementById("box");
box?.classList.add('fullscreen')
}
const [newOptions, setNewOptions] = useState(options)
const [newData, setNewData] = useState(0)
const full = useCallback(() => {
// let box = document.getElementById("box");
// box?.classList.add('fullscreen')
let stop = 0
// let time = setInterval(function () {
// stop++
let option = JSON.parse(JSON.stringify(options))
let num = Math.floor(Math.random() * 9)
let count = 0
options.series.map(item => {
if (item.type === 'line') {
item.data.splice(0, 1)
item.data.push(num)
}
if (item.type === 'bar') {
count++
item.data.splice(0, 1)
if (count <= num) {
item.data.push(1)
} else {
item.data.push(0)
}
}
})
console.log(option);
// 更新图表数据
setNewOptions(option)
// if (stop > 20) {
// clearInterval(time)
// }
// }, 1000)
}, [data])
useEffect(() => {
setOptions(newOptions)
}, [newOptions]);
useEffect(() => {
setNewData(data)
}, [data]);
useEffect(() => {
let option = JSON.parse(JSON.stringify(options))
let num = Math.floor(newData * 9)
let count = 0
options.series.map(item => {
if (item.type === 'line') {
item.data.splice(0, 1)
item.data.push(num)
}
if (item.type === 'bar') {
count++
item.data.splice(0, 1)
if (count <= num) {
item.data.push(1)
} else {
item.data.push(0)
}
}
})
console.log(option, data);
// 更新图表数据
setNewOptions(option)
}, [newData])
// 当 someProp 变化时执行
// const quanping = () => {
// T.setPageOrientation({
// orientation: "portrait",
@ -278,20 +344,21 @@ function Index() {
// },
return (
<Block>
<View id='box' className='box'>
<Echarts
force-use-old-canvas='false'
echarts={echarts}
option={option}
option={options}
ref={echartsRef}
// isPage={false}
// style自定义设置echarts宽高
style={{ width: "630rpx", height: "260rpx", zIndex: 1 }}
/>
<View className='box_background'>
<Image className='full' src={require("@/img/full-scran.png")} onClick={full}></Image>
<Image className='full' ref={buttonRef} src={require("@/img/full-scran.png")} onClick={full}></Image>
<View className='power'></View>
{level.map((item) => (
<View className='line' key={item}>

@ -1,9 +1,9 @@
import Taro from "@tarojs/taro";
import classnames from "classnames";
import { Component, PropsWithChildren, useEffect, useState } from "react";
import { Progress } from "@antmjs/vantui";
import { Progress , Tab, Tabs, Dialog, Popup } from "@antmjs/vantui";
import { showModal } from "@/utils/traoAPI";
import { Tab, Tabs, Dialog, Popup } from "@antmjs/vantui";
import {
Block,
View,
@ -13,11 +13,11 @@ import {
Button,
Textarea,
} from "@tarojs/components";
import { date, getdates, previewImage } from "@/utils/util";
import { date, getdates, previewImage } from "../../../utils/util";
/** 自定义组件 **/
import Navbar from "@/components/navbar/navbar";
import { InstrumentInfo } from "@/utils/Interface";
import Navbar from "../../../components/navbar/navbar";
import { InstrumentInfo } from "../../../utils/Interface";
/** 自定义组件 **/
import "./face_report.less";
@ -295,25 +295,25 @@ export default class Index extends Component<any, any> {
} = this.state;
return (
<Block>
<Navbar isBack titleSlot="护理报告"></Navbar>
<View className="statistic m-x-30 flex aitems">
<View className="statistic_item">
<View className="statistic_title">
<Navbar isBack titleSlot='护理报告'></Navbar>
<View className='statistic m-x-30 flex aitems'>
<View className='statistic_item'>
<View className='statistic_title'>
<text>{statistics.nursingNum}</text>
<text className="num"></text>
<text className='num'></text>
</View>
<View className="statistic_desc"></View>
<View className='statistic_desc'></View>
</View>
<View className="statistic_item">
<View className="statistic_title">{statistics.nursingTime}</View>
<View className="statistic_desc"></View>
<View className='statistic_item'>
<View className='statistic_title'>{statistics.nursingTime}</View>
<View className='statistic_desc'></View>
</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,
@ -322,23 +322,23 @@ export default class Index extends Component<any, any> {
{recordData.online == 1 ? "在线" : "离线"}
</View>
</View>
<View className="products_middle flex">
<View className='products_middle flex'>
<Image
className="cover"
className='cover'
src={recordData.modeImage}
mode="aspectFill"
mode='aspectFill'
></Image>
<View className="content">
<View className="content_top">
<View className="title">{recordData.instrumentName}</View>
<View className="desc_box">
<View className="desc">{recordData.modeName}</View>
<View className="desc">
<View className='content'>
<View className='content_top'>
<View className='title'>{recordData.instrumentName}</View>
<View className='desc_box'>
<View className='desc'>{recordData.modeName}</View>
<View className='desc'>
{recordData.nursingTime}
</View>
</View>
</View>
<View className="progress">
<View className='progress'>
<Progress
percentage={
@ -346,10 +346,10 @@ export default class Index extends Component<any, any> {
? 100
: recordData.completionPercentage * 100
}
strokeWidth="12"
color="linearGradient(to right, #eecda1, #ffe9c7) !important"
strokeWidth='12'
color='linearGradient(to right, #eecda1, #ffe9c7) !important'
/>
<View className="percent">
<View className='percent'>
{" "}
{recordData.completionPercentage * 100 > 100
? 100
@ -360,11 +360,11 @@ export default class Index extends Component<any, any> {
</View>
</View>
</View>
<View className="main_title"></View>
<View className='main_title'></View>
{recordList.map((item) => (
<View className="products_item" style="border: none" key={item.id}>
<View className="products_top flex aitems">
<View className="add_time">{item.createTime}</View>
<View className='products_item' style='border: none' key={item.id}>
<View className='products_top flex aitems'>
<View className='add_time'>{item.createTime}</View>
<View
className={classnames("tag", {
tag_active: item.online === 2,
@ -373,21 +373,21 @@ export default class Index extends Component<any, any> {
{item.online == 1 ? "在线" : "离线"}
</View>
</View>
<View className="products_middle flex">
<View className='products_middle flex'>
<Image
className="cover"
className='cover'
src={item.modeImage}
mode="aspectFill"
mode='aspectFill'
></Image>
<View className="content">
<View className="content_top">
<View className="title">{item.instrumentName}</View>
<View className="desc_box">
<View className="desc">{item.modeName}</View>
<View className="desc">{item.nursingTime}</View>
<View className='content'>
<View className='content_top'>
<View className='title'>{item.instrumentName}</View>
<View className='desc_box'>
<View className='desc'>{item.modeName}</View>
<View className='desc'>{item.nursingTime}</View>
</View>
</View>
<View className="progress">
<View className='progress'>
<Progress
percentage={
@ -395,10 +395,10 @@ export default class Index extends Component<any, any> {
? 100
: item.completionPercentage * 100
}
strokeWidth="12"
color="linearGradient(to right, #eecda1, #ffe9c7) !important"
strokeWidth='12'
color='linearGradient(to right, #eecda1, #ffe9c7) !important'
/>
<View className="percent">
<View className='percent'>
{" "}
{item.completionPercentage * 100 > 100
? 100
@ -412,75 +412,75 @@ export default class Index extends Component<any, any> {
))}
</View>
{reportShow ? (
<View className="footer flex aitems">
<View className="btn" onClick={this.setShow.bind(this, true)}>
<View className='footer flex aitems'>
<View className='btn' onClick={this.setShow.bind(this, true)}>
</View>
<View className="text flex aitems">
<View className='text flex aitems'>
<View onClick={this.GoIndex}></View>
<Image src={require("@/img/right.png")} mode="aspectFill"></Image>
<Image src={require("@/img/right.png")} mode='aspectFill'></Image>
</View>
</View>
) : null}
<Popup show={show} onClose={() => this.setState({ show: false })}>
<View className="popBox">
<View className='popBox'>
<Image
className="close_icon"
className='close_icon'
src={require("@/img/close.png")}
mode="widthFix"
mode='widthFix'
onClick={this.setShow.bind(this, false)}
></Image>
<View className="popTitle"></View>
<View className="popSubtitle">
<View className='popTitle'></View>
<View className='popSubtitle'>
<View className="bold">{clockStatistics[0]?.clockNum}</View>{" "}
<View className='bold'>{clockStatistics[0]?.clockNum}</View>{" "}
<View className="bold">
<View className='bold'>
{(clockStatistics[0]?.percentage * 100).toFixed(1)}%
</View>
</View>
<View className="img_box">
<View className='img_box'>
{punchInInfo.clockImageList.map((item, index) => (
<View key={item} className="img">
<Image className="showImg" src={item} mode="widthFix"></Image>
<View key={item} className='img'>
<Image className='showImg' src={item} mode='widthFix'></Image>
<Image
className="closeImg"
className='closeImg'
src={require("@/img/close1.png")}
mode="widthFix"
mode='widthFix'
onClick={this.delImg.bind(this, index)}
></Image>
</View>
))}
{punchInInfo.clockImageList.length < 3 && (
<View
className="addBox"
className='addBox'
onClick={this.handleChooseImage.bind(this)}
>
<Image
className="showImg"
className='showImg'
src={require("@/img/clock_in_upload/add-image.png")}
mode="widthFix"
mode='widthFix'
></Image>
</View>
)}
</View>
<View className="info4">
<View className="content">
<View className='info4'>
<View className='content'>
<Textarea
placeholderStyle="color: #ccc; font-size: 26rpx;font-weight: 400;font-family: PingFang SC;"
placeholder="请记录一下今天的护理心得吧"
placeholderStyle='color: #ccc; font-size: 26rpx;font-weight: 400;font-family: PingFang SC;'
placeholder='请记录一下今天的护理心得吧'
maxlength={120}
onInput={this.handleTextareaInput.bind(this)}
value={punchInInfo.clockContent}
></Textarea>
</View>
<View className="tip">
<View className='tip'>
{"" + (punchInInfo.clockContent.length || 0) + "/120"}
</View>
</View>
<View className="popbtnbox flex aitems jcenter">
<View className="btn1" onClick={this.submit.bind(this)}>
<View className='popbtnbox flex aitems jcenter'>
<View className='btn1' onClick={this.submit.bind(this)}>
</View>
</View>

@ -1,5 +1,7 @@
import { Block, View, Text, Image, Input, Button } from "@tarojs/components";
import { Component, PropsWithChildren, useEffect, useState } from "react";
import { go } from "@/utils/traoAPI";
import { InstrumentInfo } from "@/utils/Interface";
import "taro-ui/dist/style/components/button.scss"; // 按需引入
import Taro from "@tarojs/taro";
@ -12,7 +14,6 @@ import { setMobile } from "@/store/features/userInfo";
import Navbar from "@/components/navbar/navbar";
import Echarts from "./Echarts/index";
import "./moisture_test_report.less";
import { go } from "@/utils/traoAPI";
class MoistureTestReport extends Component<any, any> {
constructor(props) {
@ -53,7 +54,11 @@ class MoistureTestReport extends Component<any, any> {
componentDidHide() { }
onLoad(option) {
console.log(option.data);
let data = JSON.parse(option.data)
console.log(data);
let { reportData } = this.state
reportData.curDate = option.date
data.GearData.map(item => {
@ -72,9 +77,20 @@ class MoistureTestReport extends Component<any, any> {
reportData.shuifenGear.rightFace = gear
}
})
this.setState({ reportData, modeId: option.modeId });
this.moistureTest(option.id, reportData.curDate)
}
async initData() { }
async moistureTest(id, curDate) {
let data = {
queryDate: curDate,
instrumentId: id
}
let res = await InstrumentInfo.fr200.moistureTest(data);
}
toIndex() {
Taro.reLaunch({ url: "/pages/index/index" });
}

@ -299,8 +299,8 @@ export default class Recording extends Component<any, any> {
setStorageSync("instrument_detail", instrument);
}
})
if ([1,2,3,4,5].includes(item.jumpType)) {
if ([1, 2, 3, 4, 5].includes(item.jumpType)) {
this.One(item);
} else if (item.jumpType === 0) {
this.two(item);
@ -309,26 +309,26 @@ export default class Recording extends Component<any, any> {
} else {
this.AllDevice(item);
}
// let report =false
// go("/pages/face_report/face_report?id=" + id + "&recordId=" + recordId+ "&report=" + report );
// go("/recording/pages/face_report/face_report?id=" + id + "&recordId=" + recordId+ "&report=" + report );
}
// 打开第一种类型
One = async (item) => {
let report = false;
let nursingData=JSON.parse(item.nursingData)
let obj ={
modeName:item.modeName,
data:nursingData
let nursingData = JSON.parse(item.nursingData)
let obj = {
modeName: item.modeName,
data: nursingData
}
console.log("打开第一种类型", item,obj);
console.log("打开第一种类型", item, obj);
go(
"/recoding/pages/face_report_one/face_report_one?id=" +
item.id +
"&report=" +
report+ "&obj=" +
JSON.stringify(obj)
item.id +
"&report=" +
report + "&obj=" +
JSON.stringify(obj)
);
};
// 打开第二种类型
@ -337,7 +337,7 @@ export default class Recording extends Component<any, any> {
};
// 打开第三种类型
three = async (item) => {
go(`/recoding/pages/moisture_test_report/moisture_test_report?data=${item.nursingData}&date=${item.createTime}&modeId=${item.modeId}`);
go(`/recoding/pages/moisture_test_report/moisture_test_report?data=${item.nursingData}&date=${item.createTime}&modeId=${item.modeId}&id=${item.instrumentId}`);
};
// 打开其他类型
AllDevice = async (item) => {

@ -415,6 +415,15 @@ export const InstrumentInfo = {
});
},
},
fr200:{
// 查询用户FR200水分报告护理记录
moistureTest: (data) => {
return Ajax({
url: "/nursingLog/record/fr200/moistureTest" + paramsToUrlQueryString(data),
method: "get",
});
},
}
};
//localhost:9204/instrument/getInstrumentInfoBySerial

Loading…
Cancel
Save