rongweikang 2 years ago
commit 1b4607ab01

@ -71,13 +71,15 @@ export default defineAppConfig({
navigationBarBackgroundColor: "#fff",
navigationBarTitleText: "WeChat",
navigationBarTextStyle: "black",
// pageOrientation: "auto",
// enablePullDownRefresh: true
},
requiredPrivateInfos: ["getLocation"],
subPackages: [
{
root: "moduleIOT",
pages: ["pages/iotCarePlan/WL200", "pages/iotCarePlan/FR200"],
pages: ["pages/iotCarePlan/WL200", "pages/iotCarePlan/FR200", "pages/iotCarePlan/WE200",],
},
{
root: "recoding",

@ -124,7 +124,7 @@ class ConnectionBluetoot extends Component<any, any> {
// "FR200", // FR200
],
currentDeviceType: "", // 现在的设备类型: WE200 WL200
currentDeviceType: "", // 现在的设备类型: WE200 WL200 FR200当设备为WL200时它还可能是WE200
};
}

@ -0,0 +1,100 @@
/**蓝牙命令合集*/
export const we200BleCommand = {
/**发送配对码*/
match: {
commandType: "BleMatch",
bleCommandType: "SendMatchCode",
},
InfoQuery: {
/**查询版本指令*/
versionInfo: {
commandType: "InfoQuery",
infoQueryType: "versionInfo",
otaDeviceType: "FR200",
},
/**时间同步*/
timeSync: {
commandType: "InfoQuery",
infoQueryType: "timeSync",
date: new Date(),
},
/**查询离线记录概要*/
clockSummary: {
commandType: "InfoQuery",
infoQueryType: "offlineClockInInfo",
dataType: "summary",
},
/**查询离线明细第一条*/
clockDetail: {
commandType: "InfoQuery",
infoQueryType: "offlineClockInInfo",
dataType: "detail",
dataIndex: 0,
},
},
};
/**控制设备命令合集*/
export const we200DeviceControlCommand = {
/**查询设备状态指令*/
queryDeviceStatus: {
commandType: "DeviceStatusSync",
deviceSyncCommandType: "onlySyncStatusToDevice",
},
/**控制设备暂停 pause暂停 working启动 end关闭*/
pause: {
commandType: "DeviceControl",
workStatus: "pause",
},
standby: {
commandType: "DeviceControl",
workStatus: "standby",
},
end: {
commandType: "DeviceControl",
workStatus: "end",
},
/**
* '进入水分测试模式' = 'switchTestMode',
* '启动水分测试模式' = 'startTestMode',
*
* face: "01", 面部
* eyes: "02", 眼部
*
* nasolabialFold: "03", 法令纹Pro
* mandibularLine: "04", 下颌线Pro
* led: "05", led
* headLiftingPro: "09", 抬头纹Pro
*
* moistureTest: "06", 水分测试
* maskPenetration: "07",面膜促渗
* essence: "08", 精华模式
*
* neck: "0A", 颈纹
* partition: "11", 分区模式 废弃VM1001
* ignore: "255", 不改变/无模式
*/
// 普通工作模式
work: {
commandType: "DeviceControl",
workStatus: "working",
workMode: "ignore", // face
},
// 切换/进入水分测试
switchTestMode: {
commandType: "DeviceControl",
workStatus: "working",
workMode: "moistureTest",
testStatus: "standby",
},
// 启动水分测试
startTestMode: {
commandType: "DeviceControl",
workStatus: "working",
workMode: "moistureTest",
testStatus: "start",
},
};

@ -110,26 +110,69 @@ export default class DeviceConnectPopup extends Component<any, any> {
<View
className={classnames("common-popup-title", "margin-samll")}
>
{data.bluetoothConnectingTitle}
{data.model === "WL200" && (
<Block>
{currentDeviceType !== "WE200"
? data.bluetoothConnectingTitle
: data.we200BluetoothConnectingTitle}
</Block>
)}
{data.model !== "WL200" && (
<Block>{data.bluetoothConnectingTitle}</Block>
)}
</View>
<View className="device-popup-content-box">
{!this.isImage(data.bluetoothConnecting) ? (
<Video
className="videos"
autoplay
loop
objectFit="cover"
enablePlayGesture
showFullscreenBtn={false}
playBtnPosition="center"
src={encodeURIComponent(data.bluetoothConnecting)}
/>
) : (
<Image
className="images"
src={data.bluetoothConnecting}
mode="aspectFill"
/>
{data.model === "WL200" && (
<Block>
{!this.isImage(data.bluetoothConnecting) ? (
<Video
className="videos"
autoplay
loop
objectFit="cover"
enablePlayGesture
showFullscreenBtn={false}
playBtnPosition="center"
src={
currentDeviceType !== "WE200"
? data.bluetoothConnecting
: data.we200BluetoothConnecting
}
/>
) : (
<Image
className="images"
src={
currentDeviceType !== "WE200"
? data.bluetoothConnecting
: data.we200BluetoothConnecting
}
mode="aspectFill"
/>
)}
</Block>
)}
{data.model !== "WL200" && (
<Block>
{!this.isImage(data.bluetoothConnecting) ? (
<Video
className="videos"
autoplay
loop
objectFit="cover"
enablePlayGesture
showFullscreenBtn={false}
playBtnPosition="center"
src={data.bluetoothConnecting}
/>
) : (
<Image
className="images"
src={data.bluetoothConnecting}
mode="aspectFill"
/>
)}
</Block>
)}
<View className="blue-device-tips">

@ -191,10 +191,15 @@ export default class InstrumentClickInUpload extends Component<any, any> {
let { punchInInfo, instrumentDetail } = this.state;
let obj = punchInInfo;
if (obj.clockImageList.length === 0) {
msg("至少上传一张图片");
msg("至少上传一张图片!");
return;
}
if (!obj.clockContent) {
msg("请输入打卡心得!");
return;
}
// 批量上传图片
let promiseTasks: any = [];
let imgList: any[] = [];
obj.clockImageList.map((imgUrl: string) => {
@ -226,6 +231,11 @@ export default class InstrumentClickInUpload extends Component<any, any> {
}
}
Taro.showLoading({
title: "请求中...",
mask: true,
});
let clockParmas = {
clockImageList: imgList,
clockContent: obj.clockContent,
@ -238,8 +248,13 @@ export default class InstrumentClickInUpload extends Component<any, any> {
params
);
console.log(instrumentRes, "添加仪器成功");
// 上传护理记录
await this.PostNursingLogClock();
// 上传打卡记录
let res = await InstrumentInfo.apiClock.postInsertClockLog(clockParmas);
Taro.hideLoading();
// 打卡完成
if (res.data.code === 200) {
msg("打卡成功");
setTimeout(() => {
@ -250,6 +265,32 @@ export default class InstrumentClickInUpload extends Component<any, any> {
}
};
/** 提交护理记录 */
PostNursingLogClock = async (data: any = null) => {
let { instrumentDetail, currentInfo } = this.state;
let params = {
instrumentId: instrumentDetail.id,
instrumentName: instrumentDetail.name,
modeId: currentInfo.id,
modeName: currentInfo.modeName,
nursingTime: "00:01:00",
};
let res: any = await InstrumentInfo.apiNursingLog.addLog(params);
console.log("PostNursingLogClock", res);
if (res.data.code === 200) {
let params = {
instrumentId: instrumentDetail.id,
};
// 上传护理完成的仪器ID
let res = await InstrumentInfo.apiClock.addClockInstrument(params);
console.log(res, "护理完成");
}
};
/*** 护理记录 END ***/
onPlayTap = async () => {
let { videoContext } = this.state;
videoContext.play();

@ -204,7 +204,7 @@ export default class InstrumentManage extends Component<any, any> {
<Block>
<View className="title"></View>
<View className="scroll">
<ScrollView scroll-x="true" className="un_bind_list">
<ScrollView scrollX={true} className="un_bind_list">
{unBindList.map((item, index) => {
if (item.status === 0) {
return (

File diff suppressed because it is too large Load Diff

@ -0,0 +1,5 @@
export default definePageConfig({
navigationBarTitleText: '首页',
enablePullDownRefresh: false,
enablePageMeta: true
})

@ -0,0 +1 @@
@import url(./WL200.less);

File diff suppressed because it is too large Load Diff

@ -0,0 +1,357 @@
import Taro from "@tarojs/taro";
import { debounce } from "lodash";
import {
notifyBLECharacteristicValueChange,
sendCommand,
} from "@/utils/bluetoothWXAPI";
import {
deviceCommandSamples,
bleCommandSamples,
} from "@/components/bluetoot/connection/wl200";
/** 基础版:脸部/眼部/PRO 设备使用时,会自动开启暂停 */
const BaseModeType: string[] = [
"face",
"eyes",
"nasolabialFold",
"mandibularLine",
"headLiftingPro",
];
/**
* @name
* @description
*/
export default class BluetoothContainer {
bluetoothInfo: any;
deviceToolKitInstance: any;
that: any;
counter: number = 0; // 初始化后,同步执行次数
constructor(bluetoothInfo: any, deviceToolKitInstance: any, that: any) {
this.bluetoothInfo = bluetoothInfo;
this.deviceToolKitInstance = deviceToolKitInstance;
this.that = that;
}
/** @name 设备响应:待机 */
private syncStandby(jsonStatus) {
if (BaseModeType.includes(jsonStatus.workMode)) {
this.that.openTips("检测到您的设备没有紧贴肌肤,请紧贴肌肤");
}
}
/** @name 设备响应:工作 */
private syncWorking(jsonStatus) {
// 脸部模式
if (BaseModeType.includes(jsonStatus.workMode)) {
this.that.closeTips();
}
}
/** @name 设备响应:暂停 */
private syncPause(jsonStatus) {
if (BaseModeType.includes(jsonStatus.workMode)) {
this.that.openTips(
"检测到您的设备没有紧贴肌肤,请紧贴肌肤后重新尝试"
);
}
}
/** @name 查询信息响应 */
private InfoQuery = {
/** @name 设备响应:离线记录 */
syncOfflineClockInInfo: function (jsonStatus) {
console.log("离线记录", jsonStatus);
},
/** @name 设备响应:版本信息 */
syncVersionInfo: function (jsonStatus) {
console.log("版本信息", jsonStatus);
},
/** @name 设备响应:时间同步 */
syncTimeSync: function (jsonStatus) {
console.log("时间同步", jsonStatus);
}
}
/** @name 设备响应:通用状态响应 */
private syncCommonStatus(jsonStatus) {
// 1.判断是否水分测试
if (jsonStatus.workMode === "moistureTest") {
if (jsonStatus.testStatus === "success") {
let waterStepList = this.that.state.waterStepList;
// 到达第几个step
let waterStepIndex = this.that.state.waterStepIndex;
// 代表5秒以后最后拿到的结果
if (waterStepList[waterStepIndex].finish) {
// 获取等级
waterStepList[waterStepIndex].forehead =
jsonStatus.waterLevel;
// 检测完成
if (waterStepIndex === 2) {
this.that.setState({
isRuningTest: 4,
});
} else {
// 启动检测
this.that.setState({
isRuningTest: 1,
});
}
// 一共有3条数据
let num = waterStepIndex;
if (waterStepIndex < 2) {
num = waterStepIndex + 1;
this.that.waterTestNext(num);
}
this.that.setState({
waterStepIndex: num,
waterStepList,
});
}
} else {
let waterStepList = this.that.state.waterStepList;
let waterStepIndex = this.that.state.waterStepIndex;
// 5秒后获取的结果
if (waterStepList[waterStepIndex].finish) {
// 获取失败后把进度条清理0
waterStepList[waterStepIndex].schedule = 0;
waterStepList[waterStepIndex].finish = false;
this.that.setState({
waterStepList,
isRuningTest: 3,
});
}
}
}
// 2.判断工作状态是否与选中仪器一致
if (jsonStatus?.workMode === this.that.state.ActiveModeItem.modeType) {
if (this.that.state.workMode !== jsonStatus?.workMode) {
this.that.setState({
workMode: jsonStatus?.workMode, // 仅当设备上报模式与小程序一致时,才允许改变小程序变量缓存
});
}
// 判断设备是否在运行中(护理中)
// 仅当设备模式与小程序是否一致,才允许更改设备运行时间
if (this.that.isRuning) {
if (
this.that.state.DeviceConnectStatus === 1 &&
jsonStatus.workStatus !== 'end'
) {
// 水分测试手动检测时间,不自动计算倒计时
if (jsonStatus?.workMode !== "moistureTest")
this.that.updateDeviceSyncData(
{
totalWorkingMinutes: jsonStatus.totalWorkingMinutes,
totalWorkingSeconds: jsonStatus.totalWorkingSeconds,
},
jsonStatus
);
}
}
}
}
/** @name 设备响应:控制指令响应 */
private syncDeviceControl(jsonStatus) {
console.log("设备控制响应", jsonStatus);
if (jsonStatus.responseStatus == "OK") {
console.log("发送控制指令成功");
this.that.workJsonStatus = jsonStatus;
this.that.workStatus = jsonStatus.workStatus;
setTimeout(() => console.log("this.workStatus", this.that.workStatus));
if (jsonStatus.battery) {
this.that.setState({
Electricity: jsonStatus.battery,
});
}
// 判断设备主动上报的关机事件
if (jsonStatus.workStatus === 'end') {
// 判断id是否一致, 一致的话则生成护理报表, 并提示
if (jsonStatus.id == this.that.FR200NursingHistory.id) {
debounce(
this.that.checkInstrumentRecord.bind(this, jsonStatus),
500
);
}
return;
}
if (jsonStatus?.workMode === this.that.state.ActiveModeItem.modeType) {
this.that.setState({
workMode: jsonStatus?.workMode, // 仅当设备上报模式与小程序一致时,才允许改变小程序变量缓存
});
// 判断是否在isRuning(护理中)
// 仅当设备模式与小程序是否一致,才允许更改设备运行时间
if (
this.that.state.DeviceConnectStatus === 1 &&
this.that.isRuning &&
jsonStatus.workStatus !== 'end'
) {
this.that.updateDeviceSyncData(
{
totalWorkingMinutes: jsonStatus.totalWorkingMinutes,
totalWorkingSeconds: jsonStatus.totalWorkingSeconds,
},
jsonStatus
);
}
}
if (
jsonStatus.workMode === 'working' &&
this.that.isRuning
) {
const { ActiveModeItem } = this.that.state;
const item = ActiveModeItem;
if (jsonStatus.workMode !== item.modeType) {
// clearTimeout(loadingTipsTimer);
this.that.setState({
isShowCountdown: false,
});
}
}
}
}
notifyBLECharacteristicValueChange() {
notifyBLECharacteristicValueChange({
deviceId: this.bluetoothInfo.deviceId,
servicesuuid: this.bluetoothInfo.servicesuuid,
characteristicsuuid1: this.bluetoothInfo.characteristicsuuid1,
characteristicsuuid0: this.bluetoothInfo.characteristicsuuid0,
}).then((res) => {
Taro.onBLECharacteristicValueChange((value) => {
const jsonStatus: any = this.deviceToolKitInstance.toJsonStatus(value.value);
console.log("onBLECharacteristicValueChange 订阅改变:", jsonStatus);
if (!jsonStatus || jsonStatus == null) {
return;
}
this.that.workStatus = jsonStatus.workStatus; // 记录工作状态
// end 和 endWork 都是护理结束, endWork不关机, end 关机, 对小程序而言处理流程都一样
if (jsonStatus.workStatus && jsonStatus.workStatus == "endWork") {
jsonStatus.workStatus = "end";
console.log(jsonStatus.workStatus, "护理结束");
}
switch (jsonStatus?.commandType) {
//设备配对和连接的返回
case "BleMatch":
// 蓝牙相关指令
this.that.switchBLEMatch(jsonStatus);
break;
//设备状态同步
case "DeviceStatusSync":
if (jsonStatus.battery) {
// 防止抖动
this.that.setState({
Electricity: jsonStatus.battery,
});
}
switch (jsonStatus.workStatus) {
case "standby":
//设备的待机状态 可能workMode字段为空
this.syncStandby(jsonStatus)
break;
case "pause":
this.syncPause(jsonStatus)
break;
case "working":
this.syncWorking(jsonStatus)
break;
default:
break;
}
this.syncCommonStatus(jsonStatus);
break;
//设备对控制指令的响应
case "DeviceControl":
this.syncDeviceControl(jsonStatus);
break;
// 设备对信息查询指令的响应
case "InfoQuery":
console.log("设备对信息查询指令的响应 InfoQuery", jsonStatus);
switch (jsonStatus.infoQueryType) {
// 离线记录
case "offlineClockInInfo":
this.InfoQuery.syncOfflineClockInInfo(jsonStatus);
break;
// 版本信息
case "versionInfo":
this.InfoQuery.syncVersionInfo(jsonStatus);
break;
// 时间同步
case "timeSync":
this.InfoQuery.syncTimeSync(jsonStatus);
break;
default:
break;
}
break;
default:
break;
}
});
if (this.counter < 3) {
/**
* 600
*/
const querySubDeviceArrayBuffer = this.deviceToolKitInstance.toBleCommand({
...bleCommandSamples.querySubDevice,
queryType: "WL200",
} as any);
setTimeout(() => {
console.log("发送查询附属设备指令 querySubDeviceArrayBuffer");
sendCommand({
value: querySubDeviceArrayBuffer,
});
}, 600);
/**
* 500
*/
const queryDeviceArrayBuffer = this.deviceToolKitInstance.toBleCommand(
bleCommandSamples.queryDeviceStatus as any
);
setTimeout(() => {
console.log("发送查询设备电量指令");
sendCommand({
value: queryDeviceArrayBuffer,
});
}, 500);
this.counter++;
} else {
/**
* 500
*/
const queryDeviceArrayBuffer = this.deviceToolKitInstance.toBleCommand(
bleCommandSamples.queryDeviceStatus as any
);
setTimeout(() => {
console.log("发送查询设备电量指令");
sendCommand({
value: queryDeviceArrayBuffer,
});
}, 20000);
}
});
}
}

@ -9,7 +9,7 @@ interface Props {
onEmitStartNurse: Function; // 每次点击item回调事件和数据给父组件
onEmitSwitchChange: Function;
onEmitEndPlan: Function;
onsuccess:Function
onsuccess: Function;
}
function Index({
currentWorkModeType,
@ -18,7 +18,7 @@ function Index({
onEmitStartNurse,
onEmitSwitchChange,
onEmitEndPlan,
onsuccess
onsuccess,
}: Props) {
const onStartNurse = () => {
onEmitStartNurse();
@ -31,24 +31,31 @@ function Index({
const onEndPlan = () => {
onEmitEndPlan();
};
const onSuccessNurse = () => {
onsuccess();
};
return (
<Block>
<View className="iot-footer">
{currentWorkModeType === 3 && (
<Block>
{isRuningTest === 1 ? (
<View className="btn" onClick={onStartNurse}>
</View>
) : isRuningTest === 2 ? (
<View className="btn">...</View>
) : isRuningTest === 3 ? (
<View className="btn" onClick={onStartNurse}></View>
) : (
<View className="btn" onClick={onsuccess}></View>
)}
</Block>
{isRuningTest === 1 ? (
<View className="btn" onClick={onStartNurse}>
</View>
) : isRuningTest === 2 ? (
<View className="btn">...</View>
) : isRuningTest === 3 ? (
<View className="btn" onClick={onStartNurse}>
</View>
) : (
<View className="btn" onClick={onSuccessNurse}>
</View>
)}
</Block>
)}
{currentWorkModeType === 2 && (

@ -31,7 +31,6 @@ function Index({
let PermeationList = ModeList.filter((item) => item.modeClass === 3); // 专研促渗
let SensitiveList = ModeList.filter((item) => item.modeClass === 4); // 敏感期护理
let IntelligenceList = ModeList.filter((item) => item.modeClass === 5); // 智能测肤
console.log(activeModeID, "查看id", BaseList, ModeList);
const onItemClick = (item) => {
if (item.lock) {
onModeLockOpen(); // 点击了锁定模式
@ -85,7 +84,9 @@ function Index({
<View className="mode-info">
<View className="mode-info-title">{item.modeName}</View>
<View className="mode-info-time">
{item.modeTimeStr}
{item.modeTimeStr === "00:00"
? "--:--"
: item.modeTimeStr}
</View>
<View
className={classnames("mode-info-select", {

@ -1,4 +1,5 @@
export default definePageConfig({
navigationBarTitleText: '首页',
enablePullDownRefresh: false,
enablePageMeta: true
})

@ -516,7 +516,44 @@ page {
border-radius: 30rpx;
background: #fff;
}
.MembraneCloth {
position: relative;
width: 670rpx;
height: 840rpx;
border-radius: 30rpx;
background: #fff;
.btn1 {
font-style: normal;
width: 270rpx;
height: 90rpx;
line-height: 90rpx;
background: #000000;
text-align: center;
border-radius: 45rpx;
font-size: 32rpx;
font-weight: bold;
margin-top: 55rpx;
color: #ffffff;
}
.center{
height: 70%;
background-color: red;
.list{
width: 100%;
height: 117rpx;
background-color: #41a9fc;
border-bottom: 2rpx solid black;
display: flex;
}
}
}
.MembraneCloth .title {
font-weight: bold;
text-align: center;
font-size: 36rpx;
color: #030000;
padding-top: 39rpx;
}
.popbox .title {
font-weight: bold;
text-align: center;

@ -11,8 +11,9 @@ import {
Swiper,
SwiperItem,
RichText,
PageMeta,
} from "@tarojs/components";
import { Popup } from "@antmjs/vantui";
import { Popup,Radio } from "@antmjs/vantui";
/*** redux ***/
import { connect } from "react-redux";
import { userRefresh, tokenRefresh } from "@/store/features/userInfo";
@ -82,8 +83,24 @@ class Index extends Component<any, any> {
userinfo: {
mobile: Taro.getStorageSync("mobile"),
},
list: [],
// 膜布列表
MembraneClothList:[ {
name:'mox名字'
},
{
name:'mox名字'
},
{
name:'mox名字'
}, {
name:'mox名字'
}, {
name:'mox名字'
},],
checkedMembraneCloth:'',
list: [
],
params: "",
messageCount: Taro.getStorageSync("messageCount") || 0,
offlineDialogType: 1, //1离线弹窗 2升级弹窗
@ -934,7 +951,12 @@ class Index extends Component<any, any> {
this.connectionClose();
};
// 开发者工具跳转函数
async goIot() {
if (this.state.connectInstrument.name.indexOf("WE200") > -1) {
go("/moduleIOT/pages/iotCarePlan/WE200");
return;
}
if (this.state.connectInstrument.model === "FR200") {
go("/moduleIOT/pages/iotCarePlan/FR200"); // 画页面直接跳转
} else {
@ -943,6 +965,10 @@ class Index extends Component<any, any> {
// return;
}
goTest() {
go("/pages/consultant/consultant");
}
//连接完成时数据的回调
offlineChange = async (e) => {
console.log("offlineChange", e);
@ -1082,6 +1108,7 @@ class Index extends Component<any, any> {
show,
isCommonError,
commonErrorText,
MembraneClothList,
calendarComplete,
calendarInComplete,
currentDate,
@ -1122,6 +1149,7 @@ class Index extends Component<any, any> {
return (
<Block>
{/* <PageMeta pageOrientation="landscape"> */}
<View catchMove>
<PopupAlert
isShow={isCommonError}
@ -1446,6 +1474,39 @@ class Index extends Component<any, any> {
<Popup show={show} className="custom-popup" overlay={false}>
<View className="popBox"></View>
</Popup>
<Popup show={false} >
<View className="MembraneCloth">
<View className="title"></View>
<View className="center">
{MembraneClothList.map((item, index) => {
return (
<View
key={index}
className="list"
>
<Radio name="1" v-model={this.state.checkedMembraneCloth}>{item.name}</Radio>
</View>
);
})}
</View>
<View className="popbtnbox flex aitems jcenter">
<View className="btn1" >
</View>
</View>
</View>
</Popup>
{/* </PageMeta> */}
{/* <View
style="position:fixed;width:100vw;height:100vh"
onClick={this.goTest}
>
</View> */}
</Block>
);
}

@ -139,6 +139,10 @@ page {
height: 100% !important;
border-radius: 20rpx;
}
.showImg:last-child{
width: 40rpx !important;
height: 40rpx !important;
}
}
.info4 {
position: relative;

@ -67,9 +67,9 @@ export default class Index extends Component<any, any> {
async getStatistics(id) {
let data = {};
if (id != null) {
data["instrumentId"] = id;
data["nursingId"] = id;
}
let res = await InstrumentInfo.apiNursingLog.getStatistics(data);
let res = await InstrumentInfo.apiNursingLog.getStatisticsFace(data);
if (res.data.code === 200) {
this.setState({ statistics: res.data.data });
@ -193,7 +193,6 @@ export default class Index extends Component<any, any> {
};
let res = await InstrumentInfo.apiClock.getList(data);
if (res.data.code === 200) {
console.log(this.state.clockStatistics, 88888);
this.state.clockStatistics.map((item) => {
if (item.id === id) {
@ -241,12 +240,20 @@ export default class Index extends Component<any, any> {
punchInInfo.clockImageList.splice(i, 1);
this.setState({ punchInInfo });
}
getRouteId() {
async getRouteId() {
let punchInInfo =this.state.punchInInfo
const searchParams = new URLSearchParams(window.location.search);
const id = searchParams.get("id");
const recordId = searchParams.get("recordId");
this.getStatistics(id);
this.getRecord(id, recordId);
let res1 = await InstrumentInfo.apiClock.getLatestClockRecord();
punchInInfo.clockContent =res1.data.data.clockContent
punchInInfo.clockImageList =res1.data.data.clockImg
this.setState({ punchInInfo });
// 获取图片和文本
console.log(recordId);
}
getTime(time) {
@ -262,7 +269,7 @@ export default class Index extends Component<any, any> {
}
async onLoad(options) {
console.log(options, "查看传过来的参数");
let Bool = JSON.parse(options?.report);
if (!Bool) {
this.setState({

@ -82,6 +82,7 @@ page {
.text-title{
font-size: 18rpx;
color: #999999;
margin: 8rpx 0rpx;
}
.main {
border-radius: 30rpx;
@ -179,6 +180,10 @@ page {
height: 100% !important;
border-radius: 20rpx;
}
.showImg:last-child{
width: 40rpx !important;
height: 40rpx !important;
}
}
.info4 {
position: relative;
@ -309,18 +314,18 @@ page {
// background-color: red;
}
.content {
display: flex;
flex-flow: column;
justify-content: space-between;
background-color: #f8f8f8;
border-radius: 30rpx;
padding: 21rpx;
border-radius: 20rpx;
width: 457rpx;
height: 195rpx;
// .content {
// display: flex;
// flex-flow: column;
// justify-content: space-between;
// background-color: #f8f8f8;
// border-radius: 30rpx;
// padding: 21rpx;
// border-radius: 20rpx;
// width: 457rpx;
// height: 195rpx;
}
// }
.content_top{
height: 140rpx;

@ -17,7 +17,6 @@ import { InstrumentInfo } from "@/utils/Interface";
// 引入ecahrts图表
// import EchartsForm from '@/moduleIOT/pages/iotCarePlan/components/Echart_face'
import EchartsForm from '../../../moduleIOT/pages/iotCarePlan/components/Echart_face'
import Echarts1 from '../../../moduleIOT/pages/iotCarePlan/components/Echart'
/** 自定义组件 **/
@ -82,16 +81,7 @@ export default class Index extends Component<any, any> {
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 });
}
@ -169,38 +159,13 @@ export default class Index extends Component<any, any> {
res.data.data.reverse();
if (res.data.data.length > 0) {
res.data.data.map((item, index) => {
item.isMore = false;
item.detail = [];
if (index === 0) {
item.isMore = true;
this.getList(item.id, item.year, item.month);
}
this.state.monthTime.map((monthItem) => {
if (monthItem.month == item.month) {
monthItem.time = item.clockNum;
}
});
});
this.setState({ monthTime: this.state.monthTime });
} else {
let monthTime = [
{ month: 1, time: 0 },
{ month: 2, time: 0 },
{ month: 3, time: 0 },
{ month: 4, time: 0 },
{ month: 5, time: 0 },
{ month: 6, time: 0 },
{ month: 7, time: 0 },
{ month: 8, time: 0 },
{ month: 9, time: 0 },
{ month: 10, time: 0 },
{ month: 11, time: 0 },
{ month: 12, time: 0 },
];
this.setState({ monthTime });
}
this.setState({ clockStatistics: res.data.data });
let clockStatistics = this.state.clockStatistics
clockStatistics=res.data.data
this.setState({ clockStatistics });
}
}
}
// 获取当月打卡记录
@ -213,6 +178,7 @@ export default class Index extends Component<any, any> {
if (res.data.code === 200) {
this.state.clockStatistics.map((item) => {
if (item.id === id) {
item.detail = res.data.data;
item.detail.map((obj) => {
@ -258,13 +224,24 @@ export default class Index extends Component<any, any> {
punchInInfo.clockImageList.splice(i, 1);
this.setState({ punchInInfo });
}
getRouteId() {
async getRouteId() {
let punchInInfo =this.state.punchInInfo
const searchParams = new URLSearchParams(window.location.search);
const id = searchParams.get("id");
const recordId = searchParams.get("recordId");
this.getStatistics(id);
// this.getRecord(id, recordId);
// console.log(recordId);
let res1 = await InstrumentInfo.apiClock.getLatestClockRecord();
punchInInfo.clockContent =res1.data.data.clockContent
punchInInfo.clockImageList =res1.data.data.clockImg
this.setState({ punchInInfo });
setTimeout(function() {
}, )
}
getTime(time) {
const hour = time.slice(0, 2);
@ -287,7 +264,7 @@ export default class Index extends Component<any, any> {
}
this.init(options)
this.getRouteId();
// this.getClockStatistics()
this.getClockStatistics()
}
init(options){
@ -348,11 +325,10 @@ export default class Index extends Component<any, any> {
<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_middle flex'>
<View className='left'>
<Image
@ -385,7 +361,7 @@ export default class Index extends Component<any, any> {
<View className='main_title'>-{recordData.modeName}</View>
<View className='eacharts'>
<EchartsForm EchartsData={EchartsData}></EchartsForm>
{/* <Echarts1></Echarts1> */}
</View>
</View>

@ -1,4 +1,12 @@
import { Block, View, Text, Image, Input, Button, PageMeta } from "@tarojs/components";
import {
Block,
View,
Text,
Image,
Input,
Button,
PageMeta,
} from "@tarojs/components";
import { Component, PropsWithChildren, useEffect, useState } from "react";
import { go } from "@/utils/traoAPI";
import { InstrumentInfo } from "@/utils/Interface";
@ -21,87 +29,110 @@ class MoistureTestReport extends Component<any, any> {
super(props);
this.state = {
name: "重新登录",
imgUrl: '',
imgUrl: "",
reportShow: true,
reportData: {
curDate: '',
curDate: "",
shuifenLevel: {
head: 2,
leftFace: 3,
rightFace: 7
rightFace: 7,
},
shuifenList: [],
shuifenGear: {
head: 0,
leftFace: 0,
rightFace: 0
}
rightFace: 0,
},
},
isClock: false,
xinde: '',
xinde: "",
imglist: [],
id: 0,
show: false,
modeId: 0,
echartsData: {},
showEcharts: false
showEcharts: false,
};
}
componentDidMount() {}
componentDidMount() { }
componentWillUnmount() { }
componentWillUnmount() {}
componentDidShow() { }
componentDidShow() {}
componentDidHide() { }
componentDidHide() {}
onLoad(option) {
console.log(option);
let data = JSON.parse(option.data)
let { reportData } = this.state
reportData.curDate = option.date
data.GearData.map(item => {
if (item.name == '额头') {
reportData.shuifenLevel.head = item.forehead
let gear = Math.ceil((11 - reportData.shuifenLevel.head) / 2)
reportData.shuifenGear.head = gear
} else if (item.name == '左脸颊') {
reportData.shuifenLevel.leftFace = item.forehead
let gear = Math.ceil((11 - reportData.shuifenLevel.leftFace) / 2)
reportData.shuifenGear.leftFace = gear
} else if (item.name == '右脸颊') {
reportData.shuifenLevel.rightFace = item.forehead
let gear = Math.ceil((11 - reportData.shuifenLevel.rightFace) / 2)
reportData.shuifenGear.rightFace = gear
let Bool = JSON.parse(option?.report);
if (!Bool) {
this.setState({
reportShow: Bool,
});
}
let data = JSON.parse(option.data);
let { reportData } = this.state;
reportData.curDate = option.date;
reportData.curDate = option.report;
data.GearData.map((item) => {
if (item.name == "额头") {
reportData.shuifenLevel.head = item.forehead;
let gear = Math.ceil((11 - reportData.shuifenLevel.head) / 2);
reportData.shuifenGear.head = gear;
} else if (item.name == "左脸颊") {
reportData.shuifenLevel.leftFace = item.forehead;
let gear = Math.ceil((11 - reportData.shuifenLevel.leftFace) / 2);
reportData.shuifenGear.leftFace = gear;
} else if (item.name == "右脸颊") {
reportData.shuifenLevel.rightFace = item.forehead;
let gear = Math.ceil((11 - reportData.shuifenLevel.rightFace) / 2);
reportData.shuifenGear.rightFace = gear;
}
})
});
this.setState({ reportData, modeId: option.modeId, echartsData: JSON.parse(option.echartsData) });
this.setState({
reportData,
modeId: option.modeId,
echartsData: JSON.parse(option.echartsData),
});
// this.moistureTest(option.id, reportData.curDate)
}
async initData() { }
async initData() {}
toIndex() {
Taro.reLaunch({ url: "/pages/index/index" });
}
toNursing() {
go(`/moduleIOT/pages/iotCarePlan/FR200?modeId=${this.state.modeId}`)
go(`/moduleIOT/pages/iotCarePlan/FR200?modeId=${this.state.modeId}`);
}
render() {
let { name, imgUrl, reportData, reportData1, isClock, xinde, imglist, id, show, modeId, echartsData, showEcharts } = this.state
let {
name,
imgUrl,
reportData,
reportData1,
reportShow,
isClock,
xinde,
imglist,
id,
show,
modeId,
echartsData,
showEcharts,
} = this.state;
const getStatusData = (level) => {
var bgCssData = {
serious: 'background: #FFE3E3',
moderate: 'background: #FFEBDC',
slight: 'background: #F6FCFF',
normal: 'background: #F8F8F8',
sufficient: 'background: #F8F8F8'
}
serious: "background: #FFE3E3",
moderate: "background: #FFEBDC",
slight: "background: #F6FCFF",
normal: "background: #F8F8F8",
sufficient: "background: #F8F8F8",
};
// var progressBgData = {
// serious: 'background: #FF9393',
// moderate: 'background: #FFC58C',
@ -110,202 +141,312 @@ class MoistureTestReport extends Component<any, any> {
// sufficient: 'background: #9FDBF3'
// }
var progressBgData = {
serious: '#FF9393',
moderate: '#FFC58C',
slight: '#E5F3F9',
normal: '#C2E5F3',
sufficient: '#9FDBF3'
}
serious: "#FF9393",
moderate: "#FFC58C",
slight: "#E5F3F9",
normal: "#C2E5F3",
sufficient: "#9FDBF3",
};
if (level >= 1 && level <= 2) {
return {
bg: bgCssData.serious,
title: '严重缺水',
title: "严重缺水",
gear: 5,
img: 'serious',
progressBg: progressBgData.serious
}
img: "serious",
progressBg: progressBgData.serious,
};
} else if (level >= 3 && level <= 4) {
return {
bg: bgCssData.moderate,
title: '中度缺水',
title: "中度缺水",
gear: 4,
img: 'moderate',
progressBg: progressBgData.moderate
}
img: "moderate",
progressBg: progressBgData.moderate,
};
} else if (level >= 5 && level <= 6) {
return {
bg: bgCssData.slight,
title: '轻微缺水',
title: "轻微缺水",
gear: 3,
img: 'slight',
progressBg: progressBgData.slight
}
img: "slight",
progressBg: progressBgData.slight,
};
} else if (level >= 7 && level <= 8) {
return {
bg: bgCssData.normal,
title: '水分正常',
title: "水分正常",
gear: 2,
img: 'normal',
progressBg: progressBgData.normal
}
img: "normal",
progressBg: progressBgData.normal,
};
} else if (level >= 9 && level <= 10) {
return {
bg: bgCssData.sufficient,
title: '水分充足',
title: "水分充足",
gear: 1,
img: 'sufficient',
progressBg: progressBgData.sufficient
}
img: "sufficient",
progressBg: progressBgData.sufficient,
};
}
}
};
return (
// <Block>
<PageMeta
pageOrientation='portrait'
>
<Navbar isBack titleSlot='水分测试报告'></Navbar>
<View className='moisture_test_report'>
<View className='time'>{reportData.curDate}</View>
<View className='report_data'>
<View className='forehead moisture_block flex' style={getStatusData(reportData.shuifenLevel.head)!.bg}>
<Image className='moisture_img' src={require(`@/img/fr200/${getStatusData(reportData.shuifenLevel.head)!.img}.png`)} mode='aspectFill'></Image>
<View className='pos_info'>
<View className='top'></View>
<View className='bottom'>{getStatusData(reportData.shuifenLevel.head)!.title}</View>
<View className='bottom'></View>
<Block>
<Navbar isBack titleSlot='水分测试报告'></Navbar>
<View className='moisture_test_report'>
<View className='time'>{reportData.curDate}</View>
<View className='report_data'>
<View
className='forehead moisture_block flex'
style={getStatusData(reportData.shuifenLevel.head)!.bg}
>
<Image
className='moisture_img'
src={require(`@/img/fr200/${
getStatusData(reportData.shuifenLevel.head)!.img
}.png`)}
mode='aspectFill'
></Image>
<View className='pos_info'>
<View className='top'></View>
<View className='bottom'>
{getStatusData(reportData.shuifenLevel.head)!.title}
</View>
<View className='bottom'></View>
</View>
<View className='left_face moisture_block flex' style={getStatusData(reportData.shuifenLevel.leftFace)!.bg}>
<Image className='moisture_img' src={require(`@/img/fr200/${getStatusData(reportData.shuifenLevel.leftFace)!.img}.png`)} mode='aspectFill'></Image>
<View className='pos_info'>
<View className='top'></View>
<View className='bottom'>{getStatusData(reportData.shuifenLevel.leftFace)!.title}</View>
<View className='bottom'></View>
</View>
<View
className='left_face moisture_block flex'
style={getStatusData(reportData.shuifenLevel.leftFace)!.bg}
>
<Image
className='moisture_img'
src={require(`@/img/fr200/${
getStatusData(reportData.shuifenLevel.leftFace)!.img
}.png`)}
mode='aspectFill'
></Image>
<View className='pos_info'>
<View className='top'></View>
<View className='bottom'>
{getStatusData(reportData.shuifenLevel.leftFace)!.title}
</View>
<View className='bottom'></View>
</View>
<View className='right_face moisture_block flex' style={getStatusData(reportData.shuifenLevel.rightFace)!.bg}>
<Image className='moisture_img' src={require(`@/img/fr200/${getStatusData(reportData.shuifenLevel.rightFace)!.img}.png`)} mode='aspectFill'></Image>
<View className='pos_info'>
<View className='top'></View>
<View className='bottom'>{getStatusData(reportData.shuifenLevel.rightFace)!.title}</View>
<View className='bottom'></View>
</View>
<View
className='right_face moisture_block flex'
style={getStatusData(reportData.shuifenLevel.rightFace)!.bg}
>
<Image
className='moisture_img'
src={require(`@/img/fr200/${
getStatusData(reportData.shuifenLevel.rightFace)!.img
}.png`)}
mode='aspectFill'
></Image>
<View className='pos_info'>
<View className='top'></View>
<View className='bottom'>
{getStatusData(reportData.shuifenLevel.rightFace)!.title}
</View>
<View className='bottom'></View>
</View>
<View className='example_box'>
<Image className='banner_img' src='@/img/fr200/shuifen.png' mode='aspectFill'></Image>
<View className='line1'></View>
<View className='line2'></View>
<View className='line3'></View>
</View>
<View className='example_box'>
<Image
className='banner_img'
src='@/img/fr200/shuifen.png'
mode='aspectFill'
></Image>
<View className='line1'></View>
<View className='line2'></View>
<View className='line3'></View>
</View>
<View className='moisture_level_info'>
<View className='level_info'>
<View className='items flex aitems'>
<View className='pos_name'></View>
<View className='progress'>
<View
className='progress_width'
style={{
width: `${reportData.shuifenLevel.head * 10}%`,
backgroundColor: getStatusData(
reportData.shuifenLevel.head
)!.progressBg,
}}
></View>
{/* style='{width: {reportData.shuifenLevel.head * 10}%;{util.getStatusData(reportData.shuifenLevel.head).progressBg}}' */}
</View>
<View className='level'>
{reportData.shuifenLevel.head}
</View>
</View>
<View className='items flex aitems'>
<View className='pos_name'></View>
<View className='progress'>
<View
className='progress_width left_face_progress'
style={{
width: `${reportData.shuifenLevel.leftFace * 10}%`,
backgroundColor: getStatusData(
reportData.shuifenLevel.leftFace
)!.progressBg,
}}
></View>
</View>
<View className='level'>
{reportData.shuifenLevel.leftFace}
</View>
</View>
<View className='items flex aitems'>
<View className='pos_name'></View>
<View className='progress'>
<View
className='progress_width right_face_progress'
style={{
width: `${reportData.shuifenLevel.rightFace * 10}%`,
backgroundColor: getStatusData(
reportData.shuifenLevel.rightFace
)!.progressBg,
}}
></View>
</View>
<View className='level'>
{reportData.shuifenLevel.rightFace}
</View>
</View>
</View>
<View className='moisture_level_info'>
<View className='level_info'>
<View className='moisture_level'>
<View className='level_txt flex aitems jcenter'>
<View className='circle normal'></View>
<View className='txt'></View>
</View>
<View className='level_list flex'>
<View className='items flex aitems'>
<View className='pos_name'></View>
<View className='progress'>
<View className='progress_width' style={{ width: `${reportData.shuifenLevel.head * 10}%`, backgroundColor: getStatusData(reportData.shuifenLevel.head)!.progressBg }}></View>
{/* style='{width: {reportData.shuifenLevel.head * 10}%;{util.getStatusData(reportData.shuifenLevel.head).progressBg}}' */}
</View>
<View className='level'>{reportData.shuifenLevel.head}</View>
<View className='circle serious'></View>
<View className='txt'>1-2</View>
</View>
<View className='items flex aitems'>
<View className='pos_name'></View>
<View className='progress'>
<View className='progress_width left_face_progress' style={{ width: `${reportData.shuifenLevel.leftFace * 10}%`, backgroundColor: getStatusData(reportData.shuifenLevel.leftFace)!.progressBg }}></View>
</View>
<View className='level'>{reportData.shuifenLevel.leftFace}</View>
<View className='circle moderate'></View>
<View className='txt'>3-4</View>
</View>
<View className='items flex aitems'>
<View className='pos_name'></View>
<View className='progress'>
<View className='progress_width right_face_progress' style={{ width: `${reportData.shuifenLevel.rightFace * 10}%`, backgroundColor: getStatusData(reportData.shuifenLevel.rightFace)!.progressBg }}></View>
</View>
<View className='level'>{reportData.shuifenLevel.rightFace}</View>
<View className='circle slight'></View>
<View className='txt'>5-6</View>
</View>
</View>
<View className='moisture_level'>
<View className='level_txt flex aitems jcenter'>
<View className='items flex aitems'>
<View className='circle normal'></View>
<View className='txt'></View>
<View className='txt'>7-8</View>
</View>
<View className='level_list flex'>
<View className='items flex aitems'>
<View className='circle serious'></View>
<View className='txt'>1-2</View>
</View>
<View className='items flex aitems'>
<View className='circle moderate'></View>
<View className='txt'>3-4</View>
</View>
<View className='items flex aitems'>
<View className='circle slight'></View>
<View className='txt'>5-6</View>
</View>
<View className='items flex aitems'>
<View className='circle normal'></View>
<View className='txt'>7-8</View>
</View>
<View className='items flex aitems'>
<View className='circle sufficient'></View>
<View className='txt'>9-10</View>
</View>
<View className='items flex aitems'>
<View className='circle sufficient'></View>
<View className='txt'>9-10</View>
</View>
<View className='pour'></View>
</View>
<View className='pour'>
</View>
</View>
</View>
</View>
</View>
<View className='report_chart'>
<View className='chart_title common_title'></View>
<View className='container'>
<Echarts echartsData={echartsData}></Echarts>
</View>
</View>
<View className='report_chart'>
<View className='chart_title common_title'></View>
<View className='container'>
<Echarts echartsData={echartsData}></Echarts>
</View>
<View className='gear_recommend'>
<View className='gear_header flex aitems sb'>
<View className='gear_title common_title'></View>
{reportShow ? <View className='gear_btn'></View> : null}
</View>
<View className='gear_content flex aitems sb'>
<View className='left_content'>
<Image
className='banner_img'
src='@/img/fr200/mian-mo.png'
mode='aspectFill'
></Image>
<View className='type'></View>
</View>
</View>
<View className='gear_recommend'>
<View className='gear_header flex aitems sb'>
<View className='gear_title common_title'></View>
<View className='gear_btn'></View>
<View className='gear_recommend'>
<View className='gear_header flex aitems sb'>
<View className='gear_title common_title'></View>
<View className='gear_btn'></View>
</View>
<View className='gear_content flex aitems sb'>
<View className='left_content'>
<Image
className='banner_img'
src='@/img/fr200/mian-mo.png'
mode='aspectFill'
></Image>
<View className='type'></View>
</View>
<View className='gear_content flex aitems sb'>
<View className='left_content'>
<Image className='banner_img' src='@/img/fr200/mian-mo.png' mode='aspectFill'></Image>
<View className='type'></View>
</View>
<View className='right_content flex aitems'>
<View className='gear_list flex aitems sa'>
<View className='items flex aitems jcenter'>
<Image className='gear_img' src={require(`@/img/fr200/${getStatusData(reportData.shuifenLevel.head)!.gear}.png`)} mode='aspectFill'></Image>
<View className='name'></View>
<View className='level'>{reportData.shuifenGear.head}</View>
<View className='right_content flex aitems'>
<View className='gear_list flex aitems sa'>
<View className='items flex aitems jcenter'>
<Image
className='gear_img'
src={require(`@/img/fr200/${
getStatusData(reportData.shuifenLevel.head)!.gear
}.png`)}
mode='aspectFill'
></Image>
<View className='name'></View>
<View className='level'>
{reportData.shuifenGear.head}
</View>
<View className='items flex aitems jcenter'>
<Image className='gear_img' src={require(`@/img/fr200/${getStatusData(reportData.shuifenLevel.leftFace)!.gear}.png`)} mode='aspectFill'></Image>
<View className='name'></View>
<View className='level'>{reportData.shuifenGear.leftFace}</View>
</View>
<View className='items flex aitems jcenter'>
<Image
className='gear_img'
src={require(`@/img/fr200/${
getStatusData(reportData.shuifenLevel.leftFace)!.gear
}.png`)}
mode='aspectFill'
></Image>
<View className='name'></View>
<View className='level'>
{reportData.shuifenGear.leftFace}
</View>
<View className='items flex aitems jcenter'>
<Image className='gear_img' src={require(`@/img/fr200/${getStatusData(reportData.shuifenLevel.rightFace)!.gear}.png`)} mode='aspectFill'></Image>
<View className='name'></View>
<View className='level'>{reportData.shuifenGear.rightFace}</View>
</View>
<View className='items flex aitems jcenter'>
<Image
className='gear_img'
src={require(`@/img/fr200/${
getStatusData(reportData.shuifenLevel.rightFace)!.gear
}.png`)}
mode='aspectFill'
></Image>
<View className='name'></View>
<View className='level'>
{reportData.shuifenGear.rightFace}
</View>
</View>
</View>
</View>
</View>
</View>
</View>
<View className='go_clock_in flex sb aitems' >
<View className='go_clock_btn' onClick={this.toNursing.bind(this)}></View>
{reportShow ? (
<View className='go_clock_in flex sb aitems'>
<View className='go_clock_btn' onClick={this.toNursing.bind(this)}>
</View>
<View className='jump_box flex aitems' onClick={this.toIndex}>
<View className='txt'></View>
<Image src='@/img/fr200/right.png' mode='aspectFill'></Image>
</View>
</View>
</PageMeta>
// </Block >
) : null}
</Block>
);
}
}

@ -1,5 +1,6 @@
import Taro, { setStorageSync } from "@tarojs/taro";
import classnames from "classnames";
import dayjs from "dayjs";
import { Component, PropsWithChildren, useEffect, useState } from "react";
import {
@ -40,8 +41,11 @@ export default class Recording extends Component<any, any> {
curIndex: null,
clockStatistics: [],
statistics: [],
yearValue: dayjs().format("YYYY-MM-DD"),
year: new Date().getFullYear(),
today: new Date(),
startYear: "2000-01-01",
endYear: dayjs().format("YYYY-MM-DD"),
monthTime: [
{ month: 1, time: 0 },
{ month: 2, time: 0 },
@ -61,8 +65,8 @@ export default class Recording extends Component<any, any> {
clockImageList: [],
clockContent: "",
},
navigationBarHeight: '',
statusBarHeight: ''
navigationBarHeight: "",
statusBarHeight: "",
};
}
@ -264,23 +268,31 @@ export default class Recording extends Component<any, any> {
ViewAddInstrument: ViewAddInstrument,
});
this.getRecord(null);
this.getBindingInstrumentList();
this.getLatestClockRecord();
this.getClockStatistics();
this.DayTime();
this.setStatusBar();
this.initData();
}
componentDidShow() { }
componentDidHide() { }
async initData() {
}
initData = async () => {
this.getRecord(null);
Taro.showLoading({
title: "请求中...",
mask: true,
});
await Promise.all([
this.getBindingInstrumentList(),
this.getLatestClockRecord(),
this.getClockStatistics(),
this.DayTime(),
this.setStatusBar(),
]);
Taro.hideLoading();
};
// 选择年份
onChangeYear(event) {
console.log("event", event);
this.setState({ year: event.detail.value });
this.getClockStatistics(event.detail.value);
}
@ -294,12 +306,12 @@ export default class Recording extends Component<any, any> {
};
// 跳转到护理报告
toReport(id, recordId, item) {
this.state.bindingInstrumentList.map(instrument => {
this.state.bindingInstrumentList.map((instrument) => {
if (instrument.id == id) {
setStorageSync("instrument_detail", instrument);
}
})
console.log(item, '查看');
});
console.log(item, "查看");
if ([1, 2, 3, 4, 5].includes(item.jumpType)) {
this.One(item);
@ -316,21 +328,22 @@ export default class Recording extends Component<any, any> {
}
// 打开第一种类型
One = async (item) => {
let ids = Number(item.id)
let ids = Number(item.id);
// 获取echarts数据 这个是获取接口更新echarts页面
let res2 = await InstrumentInfo.apiNursingLog.getStatiCDE(ids);
let nursingData = JSON.parse(res2.data.data.nursingData)
let nursingData = JSON.parse(res2.data.data.nursingData);
let obj = {
modeName: res2.data.data.modeName,
data: nursingData
}
data: nursingData,
};
let report = false;
go(
"/recoding/pages/face_report_one/face_report_one?id=" +
item.id +
"&report=" +
report + "&obj=" +
report +
"&obj=" +
JSON.stringify(obj)
);
};
@ -341,57 +354,67 @@ export default class Recording extends Component<any, any> {
go(
"/recoding/pages/face_report/face_report?id=" +
item.id +
"&recordId=" + item.instrumentId +
"&recordId=" +
item.instrumentId +
"&report=" +
report
);
};
// 打开第三种类型
three = async (item) => {
this.moistureTest(item)
this.moistureTest(item);
};
async moistureTest(allData) {
let data = {
queryDate: allData.createTime,
instrumentId: allData.instrumentId
}
instrumentId: allData.instrumentId,
};
let res = await InstrumentInfo.fr200.moistureTest(data);
let echartsData = res.data.rows
let echartsData = res.data.rows;
for (let i = 0; i < echartsData.length; i++) {
for (let j = i + 1; j < echartsData.length; j++) {
if (echartsData[i].createTime.split(' ')[0] == echartsData[j].createTime.split(' ')[0]) {
let result = Date.parse(echartsData[i].createTime) - Date.parse(echartsData[j].createTime)
if (
echartsData[i].createTime.split(" ")[0] ==
echartsData[j].createTime.split(" ")[0]
) {
let result =
Date.parse(echartsData[i].createTime) -
Date.parse(echartsData[j].createTime);
if (result < 0) {
echartsData.splice(i, 1)
echartsData.splice(i, 1);
} else {
echartsData.splice(j, 1)
echartsData.splice(j, 1);
}
}
}
}
let gears: any = []
let eDate: any = []
echartsData.map(item => {
const result = item.createTime.split(' ')[0].substring(5);
eDate.push(result)
item.nursingData = JSON.parse(item.nursingData)
let level: any = 0
item.nursingData?.GearData?.map(gear => {
level = level + gear.forehead
})
level = Math.floor(level / 3)
gears.push(level)
})
let gears: any = [];
let eDate: any = [];
echartsData.map((item) => {
const result = item.createTime.split(" ")[0].substring(5);
eDate.push(result);
item.nursingData = JSON.parse(item.nursingData);
let level: any = 0;
item.nursingData?.GearData?.map((gear) => {
level = level + gear.forehead;
});
level = Math.floor(level / 3);
gears.push(level);
});
echartsData = {
gears, eDate
}
go(`/recoding/pages/moisture_test_report/moisture_test_report?data=${allData.nursingData}&date=${allData.createTime}&modeId=${allData.modeId}&id=${allData.instrumentId}&echartsData=${JSON.stringify(echartsData)}`);
gears,
eDate,
};
setStorageSync("moistureEachtsData", JSON.stringify(echartsData));
let report = false;
go(
`/recoding/pages/moisture_test_report/moisture_test_report?data=${allData.nursingData
}&date=${allData.createTime}&modeId=${allData.modeId}&id=${allData.instrumentId
}&echartsData=${JSON.stringify(echartsData)}&report=${report}`
);
}
// 打开其他类型
AllDevice = async (item) => {
console.log("打开其他类型", item);
@ -470,7 +493,6 @@ export default class Recording extends Component<any, any> {
}
setStatusBar() {
Taro.getSystemInfoAsync({
success: (res) => {
const statusBarHeight = res.statusBarHeight || 0;
@ -500,22 +522,26 @@ export default class Recording extends Component<any, any> {
clockStatistics,
statistics,
year,
today,
monthTime,
show,
punchInInfo,
navigationBarHeight,
statusBarHeight
statusBarHeight,
startYear,
endYear,
} = this.state;
const statusBarHeightRpx = statusBarHeight * 2;
const navigationBarHeightRpx = navigationBarHeight * 2;
const height = statusBarHeightRpx + navigationBarHeightRpx
const height = statusBarHeightRpx + navigationBarHeightRpx;
return (
<Block>
<Navbar isBack titleSlot='护理记录'></Navbar>
<View className='tabs' style={{
top: height + "rpx", position: 'sticky'
}}
<Navbar isBack titleSlot="护理记录"></Navbar>
<View
className="tabs"
style={{
top: height + "rpx",
position: "sticky",
}}
>
<View
className={classnames("tab", {
@ -536,132 +562,130 @@ export default class Recording extends Component<any, any> {
</View>
</View>
{current === 0 && (
<ScrollView className='products_list' scroll-x='true' style={{
top: height + 110 + 'rpx', position: 'sticky'
}}
>
<View
className={classnames("all", {
products_item_active: !curIndex,
})}
onClick={this.onChangeProduct.bind(this, null)}
>
</View>
{bindingInstrumentList.map((item: any, index: any) => (
<View
key={item.id}
className={classnames("products_item", {
products_item_active: curIndex === item.id,
})}
onClick={this.onChangeProduct.bind(this, item.id)}
<View>
{current === 0 && (
<Block>
<ScrollView
className="products_list"
scrollX={true}
enhanced={true}
bounces={false}
// scrollIntoView={"products_item_" + curIndex}
style={{
top: height + 110 + "rpx",
position: "sticky",
}}
>
<Image
className='products_cover'
src={item.logo}
mode='aspectFill'
></Image>
<View className='products_title'>{item.name}</View>
</View>
))}
</ScrollView>
)}
{current === 0 && recordList.length === 0 && (
<View>
<View className='nodata'>
<Image
className='nodata_img'
src={require("@/img/nodata.png")}
></Image>
<View className='nodata_text'></View>
</View>
</View>
)}
{current === 0 && (
<View style='padding-bottom:200px'>
{/* <View className='instrument_item' >
<View className='instrument_top flex sb aitems'>
<View className='time_box flex aitems'>
<View className='time'>2024.1.23</View>
<View className={classnames("tag", {
tag_active: current === 1,
})}
> 线</View>
</View>
<View className='report_btn flex'>
<View></View>
<Image className='arrow_icon' src={require("../../img/index/right.png")} mode='aspectFill'></Image>
</View>
</View>
<View className='instrument_middle flex'>
<Image className='instrument_cover' src={require("../../img/test/1706667011027.jpg")}></Image>
<View className='instrument_content'>
<View className='instrument_title'></View>
<View className='instrument_desc_box flex fc sb'>
<View className='instrument_desc'></View>
<View className='instrument_desc'>1500</View>
<View>
<View
id={"products_item_0"}
className={classnames("all", {
products_item_active: !curIndex,
})}
onClick={this.onChangeProduct.bind(this, null)}
>
</View>
</View>
</View>
</View> */}
<View className='instrument_list '>
{recordList.map((item: any, index: any) => (
<View className='recording-box' key={item.id}>
<View className='box-top'>
<View className='top-left'>
<View className='date'>{item.createTime}</View>
{bindingInstrumentList.map((item: any, index: any) => {
return (
<View
className={classnames("tip", {
tag_active: item.online === 2,
key={item.id}
id={"products_item_" + item.id}
className={classnames("products_item", {
products_item_active: curIndex === item.id,
})}
onClick={this.onChangeProduct.bind(this, item.id)}
>
{item.online === 1 ? "在线" : "离线"}
</View>
</View>
{item.instrumentType === 2 && (
<View
className='top-right'
onClick={this.toReport.bind(
this,
item.instrumentId,
item.id,
item
)}
>
<Image
className='arrow_icon'
src={require("@/img/index/right.png")}
mode='aspectFill'
className="products_cover"
src={item.logo}
mode="aspectFill"
></Image>
<View className="products_title">{item.name}</View>
</View>
)}
);
})}
</View>
</ScrollView>
<View>
{recordList.length === 0 && (
<View>
<View className="nodata">
<Image
className="nodata_img"
src={require("@/img/nodata.png")}
></Image>
<View className="nodata_text"></View>
</View>
</View>
<View className='box-bottom'>
<Image
className='recording_img'
src={item.modeImage}
></Image>
<View className='bottom-right'>
<View className='title'>{item.instrumentName}</View>
<View className='subtitle-box'>
<View className='subtitle'>{item.modeName}</View>
<View className='subtitle'>
{item.nursingTime}
)}
{recordList.length > 0 && (
<View style="padding-bottom:200px">
<View className="instrument_list ">
{recordList.map((item: any, index: any) => (
<View className="recording-box" key={item.id}>
<View className="box-top">
<View className="top-left">
<View className="date">{item.createTime}</View>
<View
className={classnames("tip", {
tag_active: item.online === 2,
})}
>
{item.online === 1 ? "在线" : "离线"}
</View>
</View>
{item.instrumentType === 2 && (
<View
className="top-right"
onClick={this.toReport.bind(
this,
item.instrumentId,
item.id,
item
)}
>
<Image
className="arrow_icon"
src={require("@/img/index/right.png")}
mode="aspectFill"
></Image>
</View>
)}
</View>
<View className="box-bottom">
<Image
className="recording_img"
src={item.modeImage}
></Image>
<View className="bottom-right">
<View className="title">
{item.instrumentName}
</View>
<View className="subtitle-box">
<View className="subtitle">
{item.modeName}
</View>
<View className="subtitle">
{item.instrumentType === 2 && (
<Text>{item.nursingTime}</Text>
)}
</View>
</View>
</View>
</View>
</View>
</View>
))}
</View>
</View>
</View>
))}
</View>
</View>
)}
)}
</View>
</Block>
)}
</View>
{current === 1 && (
<View style='padding-bottom:200px'>
<View style="padding-bottom:200px">
{/* <View className='nodata'>
<Image
className='nodata_img'
@ -669,52 +693,54 @@ export default class Recording extends Component<any, any> {
></Image>
<View className='nodata_text'></View>
</View> */}
<View style='height: 30rpx; background: #F8F8F8'></View>
<View className='clock_in_statistics m-x-30 flex sb'>
<View className='flex sb ab'>
<View className='clock_in_statistics_title'></View>
<View style="height: 30rpx; background: #F8F8F8"></View>
<View className="clock_in_statistics m-x-30 flex sb">
<View className="flex sb ab">
<View className="clock_in_statistics_title"></View>
<Picker
mode='date'
fields='year'
style="color:#000"
mode="date"
fields="year"
onChange={this.onChangeYear.bind(this)}
value='{{year}}'
end='{{today}}'
value={this.state.yearValue}
start={startYear}
end={endYear}
>
<View className='clock_in_statistics_date flex aitems'>
<View className="clock_in_statistics_date flex aitems">
<View>{year}</View>
<Image
className='more_icon'
className="more_icon"
src={require("@/img/arrow-down.png")}
mode='widthFix'
mode="widthFix"
></Image>
</View>
</Picker>
</View>
<View className='chart flex sb'>
<View className="chart flex sb">
{monthTime.map((item) => (
<View className='flex fc aitems' key={item.month}>
<View className="flex fc aitems" key={item.month}>
{item.time > 0 && (
<View className='buoy'>{item.time}</View>
<View className="buoy">{item.time}</View>
)}
<View
className='column'
className="column"
style={{ height: `calc(186/31*${item.time}rpx)` }}
></View>
<View className='month'>{item.month}</View>
<View className="month">{item.month}</View>
</View>
))}
</View>
</View>
<View style='padding-bottom: env(safe-area-inset-bottom)'>
<View className='month_box m-x-30'>
<View style="padding-bottom: env(safe-area-inset-bottom)">
<View className="month_box m-x-30">
{clockStatistics.map((item) => (
<View className='month_statistics' key={item.id}>
<View className='flex aitems sb'>
<View className='time'>
<View className="month_statistics" key={item.id}>
<View className="flex aitems sb">
<View className="month_item_date">
{item.year}{item.month}
</View>
<View
className='more_box flex aitems'
className="more_box flex aitems"
onClick={this.onChangeMore.bind(
this,
item.id,
@ -722,7 +748,7 @@ export default class Recording extends Component<any, any> {
item.month
)}
>
<View className='more_text'>
<View className="more_text">
{" "}
{!item.isMore ? "展开更多" : "收起更多"}
</View>
@ -732,51 +758,51 @@ export default class Recording extends Component<any, any> {
? "rotate(180deg)"
: "rotate(0deg)",
}}
className='more_icon'
className="more_icon"
src={require("@/img/arrow-down.png")}
mode='widthFix'
mode="widthFix"
></Image>
</View>
</View>
<View style='height: 59rpx'></View>
<View className='statistic'>
<View className='statistic_item'>
<View className='statistic_num'>{item.clockNum}</View>
<View className='statistic_desc'></View>
<View style="height: 59rpx"></View>
<View className="statistic">
<View className="statistic_item">
<View className="statistic_num">{item.clockNum}</View>
<View className="statistic_desc"></View>
</View>
<View className='statistic_item'>
<View className='statistic_num'>
<View className="statistic_item">
<View className="statistic_num">
{(item.percentage * 100).toFixed(2)}%
</View>
<View className='statistic_desc'></View>
<View className="statistic_desc"></View>
</View>
<View className='border'></View>
<View className="border"></View>
</View>
{item.isMore && item.detail && (
<View>
{item.detail.map((obj) => (
<View key={obj.id}>
<View style='height: 57rpx'></View>
<View className='month_item'>
<View className='month_item_date'>
<View style="height: 57rpx"></View>
<View className="month_item">
<View className="month_item_date">
{obj.updateTime}
</View>
<View className='month_image_box flex sb'>
<View className="month_image_box flex sb">
{obj.clockImg.map((img) => (
<Image
key={img}
className='month_item_cover'
className="month_item_cover"
src={img}
></Image>
))}
</View>
<View className='month_item_date'>
<View className="month_item_date">
{/* 小紫弹智能射频仪、花至抗老射频仪PRO{" "} */}
{obj.instrumentName === null
? ""
: obj.instrumentName}
</View>
<View className='month_item_note'>
<View className="month_item_note">
{obj.clockContent}
</View>
</View>
@ -791,8 +817,8 @@ export default class Recording extends Component<any, any> {
</View>
)}
{!clockShow && ViewAddInstrument === "true" && (
<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" onClick={this.back}>
@ -802,64 +828,64 @@ export default class Recording extends Component<any, any> {
)}
<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>

Loading…
Cancel
Save