fix:bug修复

master
blak-kong 2 years ago
parent 0f0bca2771
commit b426251c83

@ -61,8 +61,8 @@
"react": "^18.0.0",
"react-dom": "^18.0.0",
"react-redux": "^9.0.3",
"taro-ui": "^3.2.0",
"taro-react-echarts": "^1.2.2"
"taro-react-echarts": "^1.2.2",
"taro-ui": "^3.2.0"
},
"devDependencies": {
"@babel/core": "^7.8.0",

@ -149,7 +149,7 @@ export default class DeviceConnectPopup extends Component<any, any> {
</Block>
)}
</View>
<View className="block2">
{/* <View className="block2">
{connectionSuccess ? (
<Block>
<View className="icon">
@ -175,7 +175,7 @@ export default class DeviceConnectPopup extends Component<any, any> {
</View>
</Block>
)}
</View>
</View> */}
</View>
<View className="common-popup-btns">
<Button

@ -40,7 +40,7 @@ export default class Navbar extends Component<any, any> {
if (!this.props.isCustomBack) {
back();
} else {
this.props.customBack();
this.props.customBack(); // 具体页面自定义返回逻辑
}
};

@ -62,3 +62,9 @@
font-family: PingFang SC;
}
}
.instrument-swiper-step {
width: 600rpx;
height: 720rpx;
margin: 0 auto;
}

@ -71,9 +71,7 @@ export default class PopupInstrumentUploadTips extends Component<any, any> {
}
this.setState({ current });
}
onClickSwiperItem(item) {
goJump(item);
}
onFinish(event) {
const { current } = event.detail;
const { toRight, isClick } = this.state;
@ -94,7 +92,7 @@ export default class PopupInstrumentUploadTips extends Component<any, any> {
onNext = async () => {
let { current } = this.state;
if (current === this.props.data.length) {
if (current === this.props.data.length - 1) {
this.onClose();
} else {
this.setState({ current: current + 1 });
@ -122,42 +120,29 @@ export default class PopupInstrumentUploadTips extends Component<any, any> {
></View>
<View className={classnames("common-box upload-tips-common-box")}>
<View className="site-popup-content-box">
<Swiper
className="absolutely"
style="width: 600rpx;height: 720rpx"
current={current}
onChange={this.onChange.bind(this)}
onAnimationFinish={this.onFinish.bind(this)}
duration={800}
indicatorDots={false}
indicatorColor="#999"
indicatorActiveColor="#333"
disableTouch={true} // 禁止滑动
>
<View className="absolutely instrument-swiper-step">
{data.map((item, index) => {
return (
<SwiperItem
className="absolutely"
onClick={this.onClickSwiperItem.bind(this, item)}
key={"swiper_" + index}
>
<View
style={{
width: "100%",
height: "600rpx",
}}
>
<Image
className="cover"
src={item.file}
mode="aspectFit"
></Image>
current === index && (
<View className="absolutely" key={"swiper_" + index}>
<View
style={{
width: "100%",
height: "600rpx",
}}
>
<Image
className="cover"
src={item.file}
mode="aspectFit"
></Image>
</View>
<View className="tips-message">{item.message}</View>
</View>
<View className="tips-message">{item.message}</View>
</SwiperItem>
)
);
})}
</Swiper>
</View>
</View>
<View>
@ -170,15 +155,19 @@ export default class PopupInstrumentUploadTips extends Component<any, any> {
)}
{data.length > 1 && current === 0 && (
<View className="popup-btn-one">
<Button className="popup-btn" onClick={this.onPrev}>
<Button className="popup-btn" onClick={this.onNext}>
</Button>
</View>
)}
{data.length > 1 && (
{data.length > 1 && current > 0 && (
<View className="common-popup-btns">
<Button className="common-popup-btn2" onClick={this.onPrev}>
{current > 0 && current < data.length - 1 && "上一步"}
<Button
className="common-popup-btn2"
style="color:#000"
onClick={this.onPrev}
>
</Button>
<Button className="common-popup-btn2" onClick={this.onNext}>
{current > 0 && current < data.length - 1 && "下一步"}

@ -85,7 +85,7 @@ export default class PopupStepTips extends Component<any, any> {
onNext = async () => {
let { current } = this.state;
if (current === this.props.data.length) {
if (current === this.props.data.length - 1) {
this.onClose();
} else {
this.setState({ current: current + 1 });
@ -146,57 +146,54 @@ export default class PopupStepTips extends Component<any, any> {
</View>
)} */}
<View className="step-popup-content-box">
<Swiper
className="step-absolutely"
current={current}
duration={800}
indicatorDots={false}
indicatorColor="#999"
indicatorActiveColor="#333"
disableTouch={true} // 禁止滑动
>
<View className="absolutely instrument-swiper-step">
{data.map((item, index) => {
return (
<SwiperItem className="absolutely" key={"swiper_" + index}>
<View className="step-img">
<Image
className="cover"
src={item.openSourceUrl}
mode="aspectFit"
></Image>
current === index && (
<View className="absolutely" key={"swiper_" + index}>
<View
style={{
width: "100%",
height: "600rpx",
}}
>
<Image
className="cover"
src={item.openSourceUrl}
mode="aspectFit"
></Image>
</View>
<View className="tips-message">{item.openContent}</View>
</View>
<View className="tips-message">{item.openContent}</View>
</SwiperItem>
)
);
})}
</Swiper>
</View>
</View>
<View>
{data.length === 1 && (
<View className="popup-btn-one">
{isFirstEntry ? (
<Button className="popup-btn" onClick={this.onConfirm}>
{confirmButtonText}
</Button>
) : (
<Button className="popup-btn" onClick={this.onClose}>
{confirmButtonText}
</Button>
)}
<Button className="popup-btn" onClick={this.onClose}>
</Button>
</View>
)}
{data.length > 1 && current === 0 && (
<View className="popup-btn-one">
<Button className="popup-btn" onClick={this.onPrev}>
<Button className="popup-btn" onClick={this.onNext}>
</Button>
</View>
)}
{data.length > 1 && (
{data.length > 1 && current > 0 && (
<View className="common-popup-btns">
<Button className="common-popup-btn2" onClick={this.onPrev}>
{current > 0 && current < data.length - 1 && "上一步"}
<Button
className="common-popup-btn2"
style="color:#000"
onClick={this.onPrev}
>
</Button>
<Button className="common-popup-btn2" onClick={this.onNext}>
{current > 0 && current < data.length - 1 && "下一步"}

@ -7,6 +7,7 @@ import Navbar from "../../components/navbar/navbar";
import "./consultant.less";
import { getContactWorker } from "../../utils/Interface";
import { back } from "@/utils/traoAPI";
export default class Consultant extends Component<any, any> {
constructor(props) {
@ -16,6 +17,7 @@ export default class Consultant extends Component<any, any> {
pictureUrl: "",
};
}
$instance = Taro.getCurrentInstance();
async onLoad() {
this.initData();
@ -36,11 +38,25 @@ export default class Consultant extends Component<any, any> {
}
}
customBack = () => {
let customBack = this.$instance.router?.params?.customBack;
if (customBack) {
Taro.switchTab({ url: "/pages/index/index" });
return;
}
back();
};
render() {
const { pictureUrl } = this.state;
return (
<Block>
<Navbar titleSlot="联系客服" isBack={true} />
<Navbar
titleSlot="联系客服"
isBack={true}
isCustomBack
customBack={this.customBack}
/>
<View className="img">
<Image
src={pictureUrl}

@ -55,20 +55,16 @@ import {
setStorageSync,
showModal,
} from "@/utils/traoAPI";
import commandMap from "@/utils/commandMap";
import InstrumentTypeEnum from "@/components/bluetoot/InstrumentTypeEnum";
import OtaDeviceTypeEnum from "@/components/bluetoot/OtaDeviceTypeEnum";
// const log = require("@/utils/log");
class Index extends Component<any, any> {
// pageCtx = Taro.getCurrentInstance().page;
$instance = Taro.getCurrentInstance();
constructor(props) {
super(props);
this.state = {
showEquipment: false, // 扫码绑定设备弹窗
isRegisterBoolean: false, // 是否已登录
isShowPrivacyPopup: false,
isShowSiteSwiper: false,
@ -146,8 +142,6 @@ class Index extends Component<any, any> {
}
async onLoad() {
console.log(1123131233);
// 仅非扫码进入页面时,校验跳转欢迎页
if (!this.$instance.router?.params?.q) {
const isFirst = Taro.getStorageSync("isWelcome");
@ -155,9 +149,10 @@ class Index extends Component<any, any> {
go("/pages/initiate/initiate");
}
}
if (Taro.getStorageSync("skip")) {
// 判断是否跳过了注册
if (Taro.getStorageSync("skipRegister")) {
this.setState({ showEquipment: true });
Taro.removeStorageSync("skip");
Taro.removeStorageSync("skipRegister");
}
}
@ -490,6 +485,10 @@ class Index extends Component<any, any> {
instrumentInfo.bindingStatus === 1 ||
instrumentInfo.bindingStatus === 2
) {
// 判断是否已绑定同名仪器,如果已绑定,判断序列号是否一致
// 如果自己已绑定,判断扫码序列号和已绑定序列号是否一致,如果一致:忽略
// 如果自己已绑定,判断扫码序列号和已绑定序列号是否一致,如果不一致:提示换绑
// 以上逻辑交给后端处理,直接查询是否绑定或换绑
setTimeout(() => {
this.isBindingSerial();
}, 100);
@ -539,7 +538,7 @@ class Index extends Component<any, any> {
if (data.code === 200) {
msg("绑定成功");
setTimeout(() => {
go("/pages/instrument/intro?id=" + instrumentInfo.id);
go("/pages/instrument/intro??customBack=true&id=" + instrumentInfo.id);
}, 2000);
return;
} else if (data.code === 202) {
@ -553,6 +552,7 @@ class Index extends Component<any, any> {
}
};
// 换绑仪器
exchangeBinding = async () => {
Taro.showLoading({
title: "请求中...",
@ -575,7 +575,7 @@ class Index extends Component<any, any> {
};
onBindErrorConfirm = () => {
this.onBindErrorClose();
go("/pages/consultant/consultant");
go("/pages/consultant/consultant?customBack=true");
};
onBeforeBindClose = () => {
this.setState({ isBeforeBinding: false });
@ -750,6 +750,7 @@ class Index extends Component<any, any> {
instrumentInfo,
instrumentList,
showEquipment,
bindEquipment,
// 升级弹窗
isShowUpdateVersionTip,
@ -765,6 +766,25 @@ class Index extends Component<any, any> {
return (
<Block>
<View catchMove>
{/* <PopupConfirm
isShow={isShowBindConfirm}
isClose
zIndex={10020}
myClassName="level-up"
title="提示"
content={
<Block>
<View>{}</View>
<View>{}</View>
<View>{}</View>
</Block>
}
cancelButtonText="暂不绑定"
confirmButtonText="确认"
textAlgin="center"
close={this.closeBindConfirm}
confirm={this.confirmBindConfirm}
/> */}
<PopupAlert
isShow={isBindingError}
title="提示"
@ -845,8 +865,10 @@ class Index extends Component<any, any> {
title="提示"
content={
<Block>
<View className="mb10"></View>
<View className="mb10">uniquie14231</View>
<View className="mb10">
{instrumentInfo.instrumentName}
</View>
<View className="mb10">{instrumentInfo.serial}</View>
<View className="mb10"></View>
</Block>
}

@ -25,6 +25,7 @@ import { getImgInfo, contraction } from "@/utils/compressImage";
/* 自定义组件 */
import Navbar from "@/components/navbar/navbar";
import PopupAlert from "@/components/popup/popup-alert";
import PopupBinding from "@/components/popup/popup-binding";
/* 组件 */
import "./instrument.less";
@ -61,6 +62,10 @@ export default class Instrument extends Component<any, any> {
userinfo: null,
showLoginPopup: "",
fromUrl: "",
isVisibleBinding: false,
isRegisterBoolean: false,
isExchangeBinding: false,
};
}
$instance = Taro.getCurrentInstance();
@ -183,10 +188,19 @@ export default class Instrument extends Component<any, any> {
const { channelInfo } = this.state;
if (channelInfo.id === item.id) return;
channelInfo.serialCode = "";
channelInfo.manualCodeBinding = "";
channelInfo.scanCodeBinding = "";
this.setState({
channelInfo: item,
channelInfo: channelInfo,
isVideo: this.isVideo(item.banner),
});
setTimeout(() => {
this.setState({
channelInfo: item,
});
}, 10);
}
closeDev = () => {
@ -248,7 +262,7 @@ export default class Instrument extends Component<any, any> {
console.log("bindingInstrument", res);
Taro.hideLoading();
if (res.code === 200) {
this.binding();
this.openBindingVisible();
} else if (res.code === 204) {
this.setState({ isBindingCheckError: false });
} else {
@ -267,7 +281,8 @@ export default class Instrument extends Component<any, any> {
});
Taro.hideLoading();
if (res.data.code === 200) {
this.binding();
// this.bindingInstrument();
this.openBindingVisible();
} else if (res.data.code === 204) {
this.setState({ isBindingCheckError: true });
} else {
@ -275,7 +290,8 @@ export default class Instrument extends Component<any, any> {
}
};
binding = async () => {
// 调用绑定接口
bindingInstrument = async () => {
Taro.showLoading({
title: "请求中...",
mask: true,
@ -297,6 +313,24 @@ export default class Instrument extends Component<any, any> {
this.setState({ isBindingError: true });
}
};
// 换绑仪器
exchangeBinding = async () => {
Taro.showLoading({
title: "请求中...",
mask: true,
});
let { channelInfo } = this.state;
let { data } = await InstrumentInfo.exchangeBinding({
serial: channelInfo.serialCode,
});
console.log("exchangeBinding", data);
Taro.hideLoading();
this.closeBinding();
if (data.code !== 200) {
//todo
}
};
onBindErrorClose = () => {
this.setState({ isBindingError: false });
};
@ -313,6 +347,25 @@ export default class Instrument extends Component<any, any> {
Taro.switchTab({ url: "/pages/index/index" });
};
// 打开绑定弹窗
openBindingVisible = () => {
this.setState({ isVisibleBinding: true });
};
closeBinding = () => {
this.setState({ isVisibleBinding: false });
};
confirmBinding = () => {
let { isExchangeBinding } = this.state;
if (!isExchangeBinding) {
// 绑定仪器
this.bindingInstrument();
} else {
// 换绑仪器
this.exchangeBinding();
}
};
render() {
let {
isBindingError,
@ -321,6 +374,9 @@ export default class Instrument extends Component<any, any> {
inputType,
style,
equipmentList,
isVisibleBinding,
isRegisterBoolean,
isExchangeBinding,
} = this.state;
return (
<Block>
@ -340,6 +396,16 @@ export default class Instrument extends Component<any, any> {
isCustomBack
customBack={this.customBack}
/>
<PopupBinding
type={channelInfo.bindingStatus}
isShow={isVisibleBinding}
isRegisterBoolean={isRegisterBoolean}
isExchangeBinding={isExchangeBinding}
data={channelInfo}
close={this.closeBinding}
confirm={this.confirmBinding}
/>
<PopupAlert
isShow={isBindingError}
title="提示"

@ -12,12 +12,12 @@ import {
} from "@tarojs/components";
/* 自定义组件 */
import Navbar from "../../components/navbar/navbar";
import Navbar from "@/components/navbar/navbar";
// import PopupAlert from "../../components/popup/popup-alert";
/* 组件 */
import { InstrumentInfo } from "../../utils/Interface";
import { setStorageSync, getStorageSync, go } from "../../utils/traoAPI";
import { InstrumentInfo } from "@/utils/Interface";
import { setStorageSync, getStorageSync, go, back } from "@/utils/traoAPI";
import "./intro.less";
@ -32,6 +32,7 @@ class Intro extends Component<any, any> {
isNursing: false,
};
}
$instance = Taro.getCurrentInstance();
async onLoad() {}
componentDidMount() {}
@ -93,11 +94,25 @@ class Intro extends Component<any, any> {
});
}
customBack = () => {
let customBack = this.$instance.router?.params?.customBack;
if (customBack) {
Taro.switchTab({ url: "/pages/index/index" });
return;
}
back();
};
render() {
let { current, introList, instrument } = this.state;
return (
<Block>
<Navbar titleSlot="仪器绑定" isBack={true} />
<Navbar
titleSlot="仪器绑定"
isBack
isCustomBack
customBack={this.customBack}
/>
<View style="position: relative">
<Swiper
className="main"

@ -115,8 +115,10 @@ export default class InstrumentClickInUpload extends Component<any, any> {
let { punchInInfo } = this.state;
let res = await InstrumentInfo.apiClock.getLatestClockRecord();
if (res.data.code === 200) {
punchInInfo.clockContent = res.data.data.clockContent;
punchInInfo.clockImageList = res.data.data.clockImg;
if (res.data.data) {
punchInInfo.clockContent = res.data.data.clockContent;
punchInInfo.clockImageList = res.data.data.clockImg;
}
}
this.setState({ punchInInfo });
};

@ -105,7 +105,11 @@ function Index({
{activeModeID === item.id && (
<View className="mode-pic">
<Image src={item.modeBanner} mode="aspectFill" />
<Image
src={item.modeBanner}
mode="aspectFill"
style="animation-iteration-count:1;"
/>
</View>
)}
</View>
@ -159,7 +163,11 @@ function Index({
{activeModeID === item.id && (
<View className="mode-pic">
<Image src={item.modeBanner} mode="aspectFill" />
<Image
src={item.modeBanner}
mode="aspectFill"
style="animation-iteration-count:1;"
/>
</View>
)}
</View>
@ -213,7 +221,11 @@ function Index({
{activeModeID === item.id && (
<View className="mode-pic">
<Image src={item.modeBanner} mode="aspectFill" />
<Image
src={item.modeBanner}
mode="aspectFill"
style="animation-iteration-count:1;"
/>
</View>
)}
</View>

@ -32,6 +32,7 @@
width: 690rpx;
height: 640rpx;
border-radius: 30rpx;
animation-iteration-count: 1; // gif只播放一次
}
.iot-device {
width: 690rpx;
@ -86,6 +87,7 @@
background-color: rgba(0, 0, 0, 0.5);
box-sizing: border-box;
border-radius: 30rpx;
z-index: 10100 !important; // 提升层级,防止被其他元素遮挡
.msg-tips-img {
width: 30rpx;
height: 30rpx;

@ -2,9 +2,14 @@ import Taro from "@tarojs/taro";
import dayjs from "dayjs";
import classnames from "classnames";
// eslint-disable-next-line import/no-named-as-default
import React, { Component, PropsWithChildren, useEffect, useState } from "react";
import Echarts from "./components/Echart/index"
import React, {
Component,
PropsWithChildren,
useEffect,
useState,
} from "react";
import Echarts from "./components/Echart/index";
import {
Block,
View,
@ -26,6 +31,7 @@ import PopupStepTips from "@/components/popup/popup-step-tips";
import PopupConfirm from "@/components/popup/popup-confirm";
import PopupAlert from "@/components/popup/popup-alert";
import PopupStatus from "@/components/popup/popup-status";
import PopupInstrumentUploadTips from "@/components/popup/popup-instrument-upload-tips";
import ConnectionBluetoot from "@/components/bluetoot/connection";
/* 公共组件 END */
@ -54,7 +60,7 @@ import {
bleCommandSamples,
} from "@/components/bluetoot/connection/test";
import { Progress } from '@antmjs/vantui'
import { Progress } from "@antmjs/vantui";
import {
s_to_s,
s_to_m,
@ -128,8 +134,6 @@ let DeviceSyncData = {
};
let deviceToolKitInstance = deviceToolKitInstanceWL200;
class IotCarePlan extends Component<any, any> {
constructor(props) {
super(props);
@ -176,7 +180,7 @@ class IotCarePlan extends Component<any, any> {
/** 护理过程 END*/
// 模式列表
isSwitchActiveMode: true, // 是否显示弹窗切换模式
isSwitchActiveMode: false, // 是否显示弹窗切换模式
ModeList: [],
ModeType: "all", // all visor面罩 cabin舱体 yimeish医美
modeClass: "", // 1面罩 2舱体 3医美
@ -209,10 +213,18 @@ class IotCarePlan extends Component<any, any> {
isShowNursingSuccess: false, // 护理成功弹窗
isShowTipsSave: false, // 切换模式时,提示是否保存部分护理记录
// 初次护理弹窗
isFirstTipShow: false,
nurseInfo: [],
// 上一次护理记录未生成,是否继续连接设备
isShowReReadRecordConnect: false,
};
}
// 不涉及渲染的页面变量
isRuning: any = false; // 设备是否运行中
jsonStatus: any = {}; // 同步设备返回数据,用于结束
tempModeCurrent: any = {}; // 临时保存的当前模式
elapsedTime: any = 0; // 设备已运行时间
@ -231,7 +243,7 @@ class IotCarePlan extends Component<any, any> {
}
componentDidMount() {}
componentWillUnmount() { }
componentWillUnmount() {}
componentDidShow() {
console.log("页面显示了");
@ -266,9 +278,9 @@ class IotCarePlan extends Component<any, any> {
console.log("info");
// 如果不存在设备模式值,则判断为首次进入,弹窗提示
let isFirstEntry = getStorageSync("isFirstEntry_" + info.id);
if (!isFirstEntry) {
this.setState({ isShowStepTips: true });
let isFirstTipShow = getStorageSync("first_instrument_" + info.id);
if (!isFirstTipShow) {
this.firstNurseInfo();
}
}
@ -281,30 +293,27 @@ class IotCarePlan extends Component<any, any> {
// 初始化蓝牙
// this.init();
}
getOption() {
const option = {
grid: { top: 8, right: 8, bottom: 24, left: 36 },
xAxis: {
type: 'category',
data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
type: "category",
data: ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"],
},
yAxis: {
type: 'value',
type: "value",
},
series: [
{
data: [820, 932, 901, 934, 1290, 1330, 1320],
type: 'line',
type: "line",
smooth: true,
},
],
tooltip: {
trigger: 'axis',
trigger: "axis",
},
// title: {
// text: 'ECharts 示例'
@ -323,8 +332,6 @@ class IotCarePlan extends Component<any, any> {
return option;
}
async init() {
// 查询自定义设备指令
const queryInstructionParams = {
@ -419,9 +426,10 @@ class IotCarePlan extends Component<any, any> {
/** 选中护理模式 */
modeCurrentFun = async (data, isNotCheck = false) => {
// 是否跳过护理检查
// 护理检查改变模式,是否提示切换护理模式
// isNotCheck为真时不进行校验直接切换
this.tempModeCurrent = data;
if (!isNotCheck) {
this.tempModeCurrent = data;
let isReturn = this.modeRuningChange();
if (isReturn) return;
}
@ -471,7 +479,7 @@ class IotCarePlan extends Component<any, any> {
this.onStartNurse();
setTimeout(() => {
this.onNursingTap();
}, 1000);
}, 800);
}
};
/** 设备运行中切换模式 */
@ -482,23 +490,24 @@ class IotCarePlan extends Component<any, any> {
this.workStatus === MODE_WORKING_ENUM.WORKING
) {
const { totalWorkingMinutes, totalWorkingSeconds } = DeviceSyncData;
const totalTime = totalWorkingMinutes * 60 + totalWorkingSeconds;
const totalTime = totalWorkingMinutes * 60 + totalWorkingSeconds; // 设备时间
let { ActiveModeItem } = this.state;
if (!ActiveModeItem || totalTime === 0) {
return false;
}
//对比仪器上报运行的总秒数 和小程序页面运行的已经运行的总秒数,如果不一致就进行校准
const currentScene = ActiveModeItem; // 获取当前的场景
let sceneTime = minSecToS(currentScene.modeTimeStr); // 场景最小护理时间
if (
sceneTime <= totalTime &&
this.state.step == 2 &&
this.state.facialMaskConnectStatus == 1
) {
if (this.state.step == 2 && this.state.facialMaskConnectStatus == 1) {
// 提示切换护理模式
this.hanldeChangeNurseFun();
if (this.isCheckNurseTime()) {
// 满足时间条件,提示是否保存部分护理记录
this.judgementWorkStatus(
MODE_WORKING_ENUM.PAUSE,
this.state.ActiveModeItem?.modeType
);
this.setState({
isShowTipsSave: true,
});
}
return true;
}
}
@ -531,29 +540,33 @@ class IotCarePlan extends Component<any, any> {
let { SwitchActiveModeItem, ActiveModeItem, isStandStatus } = this.state;
let modeArray = ["all", "visor", "cabin", "yimeish"];
// 切换护理模式时,需判断舱体和面罩是否切换
if (SwitchActiveModeItem.isCabinMode !== ActiveModeItem.isCabinMode) {
if (SwitchActiveModeItem.isCabinMode === 1) {
// 判断舱体是否连接成功
if (!isStandStatus) {
console.log(
"检测到面罩与舱体未连接成功,请确认面罩是否和舱体连接并接通舱体电源"
);
this.openErrorTipsText(
"检测到面罩与舱体未连接成功,请确认面罩是否和舱体连接并接通舱体电源"
);
return;
}
} else {
// 判断舱体是否断开连接
if (isStandStatus) {
console.log("检测到面罩与舱体仍在连接中,该模式需要分离面罩和舱体");
this.openErrorTipsText(
"检测到面罩与舱体仍在连接中,该模式需要分离面罩和舱体"
);
return;
}
}
}
// if (SwitchActiveModeItem.isCabinMode !== ActiveModeItem.isCabinMode) {
// if (SwitchActiveModeItem.isCabinMode === 1) {
// // 判断舱体是否连接成功
// if (!isStandStatus) {
// console.log(
// "检测到面罩与舱体未连接成功,请确认面罩是否和舱体连接并接通舱体电源"
// );
// this.showTips(
// "检测到面罩与舱体未连接成功,请确认面罩是否和舱体连接并接通舱体电源"
// );
// // this.openErrorTipsText(
// // "检测到面罩与舱体未连接成功,请确认面罩是否和舱体连接并接通舱体电源"
// // );
// // return;
// }
// } else {
// // 判断舱体是否断开连接
// if (isStandStatus) {
// console.log("检测到面罩与舱体仍在连接中,该模式需要分离面罩和舱体");
// this.showTips("检测到面罩与舱体仍在连接中,该模式需要分离面罩和舱体");
// // this.openErrorTipsText(
// // "检测到面罩与舱体仍在连接中,该模式需要分离面罩和舱体"
// // );
// // return;
// }
// }
// }
this.setState({
ModeType: modeArray[SwitchActiveModeItem.modeClass],
@ -612,9 +625,7 @@ class IotCarePlan extends Component<any, any> {
};
// 绘制能量图
drawProwerPicture() {
}
drawProwerPicture() {}
/** 切换光照 */
onSwitchChange = async () => {
@ -650,7 +661,6 @@ class IotCarePlan extends Component<any, any> {
this.setState({
facialMaskConnectStatus: true,
});
// log.info(commandMap.WL200Command, "配对成功");
}
break;
@ -661,15 +671,32 @@ class IotCarePlan extends Component<any, any> {
// 附属设备是否连接支架
case "Stand":
if (jsonStatus.connectMessage?.connectType == "CONNECTED") {
console.log("舱体支架连接");
this.setState({
isStandStatus: true,
isCanClick: this.state.ActiveModeItem?.isCabinMode === 1,
});
if (!this.state.isStandStatus && this.isRuning) {
// 断开连接直接暂停
this.judgementWorkStatus(
MODE_WORKING_ENUM.PAUSE,
this.state.ActiveModeItem?.modeType
);
}
} else {
console.log("舱体支架断开连接");
if (this.state.isStandStatus && this.isRuning) {
// 断开连接直接暂停
this.judgementWorkStatus(
MODE_WORKING_ENUM.PAUSE,
this.state.ActiveModeItem?.modeType
);
}
this.setState({
isStandStatus: false,
isCanClick: this.state.ActiveModeItem?.isCabinMode !== 1,
isStopNurse: true,
});
}
break;
@ -948,8 +975,7 @@ class IotCarePlan extends Component<any, any> {
* params
*/
judgementWorkStatus(nWorkStatus, nWorkMode) {
const { step, isStandStatus, workMode, ActiveModeItem, ModeList } =
this.state;
const { step, workMode, ActiveModeItem, ModeList } = this.state;
const opts: any = {};
// ActiveModeItem
let nowModeItem;
@ -1022,7 +1048,7 @@ class IotCarePlan extends Component<any, any> {
this.setState({
isShowCountdown: false,
hadShowBreakTips: false
hadShowBreakTips: false,
});
},
pause: () => {
@ -1067,7 +1093,7 @@ class IotCarePlan extends Component<any, any> {
if (isAuto == true) {
// 仪器自动上报完成, 直接上报并跳转报告页
clearInterval(currentTimeTimer);
const isEnough = this.checkNurseTime();
const isEnough = this.isCheckNurseTime();
if (isEnough) {
this.saveNurseReport(true, "endnursing");
}
@ -1090,7 +1116,6 @@ class IotCarePlan extends Component<any, any> {
ModeStepIndex,
ActiveModeItem,
} = this.state;
console.log("resetTimer workStatus", this.workStatus);
if (
this.workStatus == MODE_WORKING_ENUM.WORKING &&
step == 2 &&
@ -1268,7 +1293,7 @@ class IotCarePlan extends Component<any, any> {
// 结束护理
endNurseFun() {
this.handleWorkStatus(false, "end");
if (this.checkNurseTime()) {
if (this.isCheckNurseTime()) {
this.PostNursingLogClock();
} else {
// 时间不满足,回到主页
@ -1280,21 +1305,8 @@ class IotCarePlan extends Component<any, any> {
}
}
// 手动切换护理
hanldeChangeNurseFun() {
// 满足时间条件,提示是否保存部分护理记录
if (this.checkNurseTime()) {
// 打开提示保存护理弹窗
this.setState({
isShowTipsSave: true,
});
} else {
// 不满足条件,直接切换
}
}
/** 检查时间是否达标仪器最低护理时间 */
checkNurseTime() {
isCheckNurseTime() {
const { currentDevice, ActiveModeItem } = this.state;
const currentScene = ActiveModeItem;
let sceneTime = minSecToS(currentScene.modeTimeStr);
@ -1303,28 +1315,13 @@ class IotCarePlan extends Component<any, any> {
let nursingTimeStr = currentDevice?.nursingTimeStr;
let nursingTime = nursingTimeStr ? minSecToS(nursingTimeStr) : 60; // 设备生成护理记录至少需要运行时间
console.log("检查已运行时间", timeRemaining, nursingTime);
if (timeRemaining >= nursingTime) {
return true;
} else {
return false;
}
}
/** 检查时间是否达标仪器最低护理时间 */
isCheckNurseTime(deviceItem, ModeItem) {
const currentScene = ModeItem;
let sceneTime = minSecToS(currentScene.modeTimeStr);
const timeRemaining = sceneTime - minSecToS(this.state.currentTime); // 当前模式已运行时间
let nursingTimeStr = deviceItem?.nursingTimeStr;
let nursingTime = nursingTimeStr ? minSecToS(nursingTimeStr) : 60; // 设备生成护理记录至少需要运行时间
if (timeRemaining >= nursingTime) {
return true;
} else {
return false;
}
}
/*** 护理记录 START ***/
/** 小程序查询护理记录 */
getInstrumentHistoryData() {
@ -1670,8 +1667,8 @@ class IotCarePlan extends Component<any, any> {
});
};
confirmEndBtn = () => {
console.log("confirmEndBtn", this.checkNurseTime());
if (this.checkNurseTime()) {
console.log("confirmEndBtn", this.isCheckNurseTime());
if (this.isCheckNurseTime()) {
this.endNurseFun();
this.cancelEndBtn();
} else {
@ -1736,15 +1733,44 @@ class IotCarePlan extends Component<any, any> {
this.setState({
isShowTipsSave: false,
});
this.modeCurrentFun(this.tempModeCurrent, false);
this.modeCurrentFun(this.tempModeCurrent, true); // 不进行校验
};
confirmTipsSave = async () => {
this.setState({
isShowTipsSave: false,
});
// isShowTipsSave
this.PostNursingLogClock(null, false);
this.modeCurrentFun(this.tempModeCurrent, false);
this.modeCurrentFun(this.tempModeCurrent, true); // 不进行校验
};
/** 初次护理信息弹窗 */
firstNurseInfo = async () => {
let { currentDevice } = this.state;
let res = await InstrumentInfo.firstNurseInfo({
instrumentId: currentDevice.id,
});
if (res.data.code === 200) {
let isFirstTipShow = getStorageSync(
"first_instrument_" + currentDevice.id
);
if (!isFirstTipShow) {
// 首次进入页面:自动打开打卡介绍弹窗
this.setState({ nurseInfo: res.data.data, isFirstTipShow: true });
setStorageSync("first_instrument_" + currentDevice.id, true);
} else {
this.setState({ nurseInfo: res.data.data });
}
}
};
onTipShowOpen = async () => {
this.setState({ isFirstTipShow: true });
};
onTipShowClose = async () => {
setStorageSync("first_instrument_" + this.state.currentDevice.id, "true");
this.setState({ isFirstTipShow: false });
};
/** 初次护理信息弹窗 END */
render() {
let {
@ -1778,6 +1804,9 @@ class IotCarePlan extends Component<any, any> {
currentDevice,
isConnectionBlutoot,
isShowTipsSave,
isFirstTipShow,
nurseInfo,
isShowReReadRecordSave,
} = this.state;
return (
@ -1785,6 +1814,14 @@ class IotCarePlan extends Component<any, any> {
<Navbar titleSlot={title} isBack />
<View catchMove>
<PopupInstrumentUploadTips
isShow={isFirstTipShow}
title="打卡介绍"
data={nurseInfo}
close={this.onTipShowClose}
confirm={this.onTipShowClose}
/>
<PopupCountdown isShow={isShowCountdown} countdown={countdown} />
<PopupConfirm
@ -1817,9 +1854,9 @@ class IotCarePlan extends Component<any, any> {
onEmitShowAll={this.openModeSwitch}
/>
}
textAlgin='center'
cancelButtonText='取消'
confirmButtonText='确定'
textAlgin="center"
cancelButtonText="取消"
confirmButtonText="确定"
close={this.cancelModeSwitchBtn}
confirm={this.confirmModeSwitchBtn}
/>
@ -1859,7 +1896,7 @@ class IotCarePlan extends Component<any, any> {
confirm={this.closeErrorTipsText}
/>
<PopupAlert
<PopupConfirm
isShow={isShowTipsSave}
isClose
zIndex={10020}
@ -1878,6 +1915,25 @@ class IotCarePlan extends Component<any, any> {
confirm={this.confirmTipsSave}
/>
<PopupConfirm
isShow={isShowReReadRecordSave}
isClose
zIndex={10020}
myClassName="level-up"
title="提示"
content={
<Block>
<View></View>
<View></View>
</Block>
}
cancelButtonText="取消"
confirmButtonText="确认"
textAlgin="center"
close={this.closeTipsSave}
confirm={this.confirmTipsSave}
/>
<PopupStatus
isShow={isShowNursingSuccess}
isClose
@ -1904,12 +1960,12 @@ class IotCarePlan extends Component<any, any> {
</View>
<View>
<View className='iot-main'>
<View className='banner-box'>
<View className="iot-main">
<View className="banner-box">
<View>
{!isShowNurse && (
<Video
className='video-or-image'
className="video-or-image"
src={ActiveModeItem.modeVideo}
/>
)}
@ -1918,12 +1974,12 @@ class IotCarePlan extends Component<any, any> {
<Block>
{isStopNurse ? (
<Image
className='video-or-image'
className="video-or-image"
src={currentServiceData.stopSource}
/>
) : (
<Image
className='video-or-image'
className="video-or-image"
src={currentServiceData.startSource}
/>
)}
@ -1931,25 +1987,25 @@ class IotCarePlan extends Component<any, any> {
)}
{errorTips && (
<Block>
<View className='msg-tips'>
<View className="msg-tips">
<Image
className='msg-tips-img'
className="msg-tips-img"
src={require("../../img/tips.png")}
/>
<View className='msg-tips-content'>{errorTips}</View>
<View className="msg-tips-content">{errorTips}</View>
</View>
</Block>
)}
</View>
<View className='iot-device'>
<View className='item'>
<Text className='device-time'>
<View className="iot-device">
<View className="item">
<Text className="device-time">
<Text className='time'>{currentTime}</Text>
<Text className="time">{currentTime}</Text>
</Text>
</View>
<View className='line' />
<View className="line" />
<ElectricityView
Electricity={Electricity}
matrixElectricity={matrixElectricity}
@ -1977,7 +2033,7 @@ class IotCarePlan extends Component<any, any> {
ActiveModeItem={ActiveModeItem}
/>
<Echarts></Echarts>
{/* <Echarts></Echarts> */}
</View>
<Footer
@ -1990,10 +2046,7 @@ class IotCarePlan extends Component<any, any> {
onEmitErrorTips={this.onEmitErrorTips}
/>
</View>
<Block id='ccccc' style={{ width: '300px', height: '300px' }}>66666666666666666666</Block>
<Block id='myBox' style={{ width: '300px', height: '300px' }}></Block>
</Block >
</Block>
);
}
}

@ -104,7 +104,7 @@ export default class Recording extends Component<any, any> {
let res = await InstrumentInfo.apiClock.getLatestClockRecord();
if (res.data.code === 200) {
if (!res.data.data) {
this.setShow(true);
// this.setShow(true);
} else {
let punchInInfo = {
clockImageList: res.data.data.clockImg,

@ -55,7 +55,9 @@ class Register extends Component<any, any> {
url: "/pages/index/index",
});
};
back() {
skipRegister() {
// 跳过注册
Taro.setStorageSync("skipRegister", true);
Taro.navigateBack({
delta: 1,
});
@ -210,7 +212,7 @@ class Register extends Component<any, any> {
>
</Button>
<View className="text" onClick={this.back}>
<View className="text" onClick={this.skipRegister}>
&gt;
</View>
</View>

Loading…
Cancel
Save