rongweikang 2 years ago
commit 5f44514b2d

@ -117,11 +117,11 @@ class ConnectionBluetoot extends Component<any, any> {
// WL200匹配
tranType: [
"WE100", // 发箍
"WE200", // 发箍
"WL200", // 面罩
"12CAA", // 面罩前缀名
"FR200", // FR200
// "WE100", // 发箍
// "WE200", // 发箍
// "WL200", // 面罩
// "12CAA", // 面罩前缀名
// "FR200", // FR200
],
currentDeviceType: "", // 现在的设备类型: WE200 WL200
@ -319,14 +319,15 @@ class ConnectionBluetoot extends Component<any, any> {
/** 4.蓝牙查找 */
onBluetoothDeviceFound() {
Taro.onBluetoothDeviceFound((item: any) => {
console.log("蓝牙查找item", item, item.devices[0].name);
console.info("搜索到到蓝牙设备 value => ", item.devices[0]?.name);
console.log(">>>>>>>当前传入设备类型>>>>>", this.props.deviceInfo.model);
// 先匹配到哪个连接哪个
let tranType = [
this.props.deviceInfo.model, // 当前传入设备类型
...this.state.tranType,
];
let model = this.props.deviceInfo.model; // 限制只匹配当前传入的设备类型
// 匹配数组:先匹配到哪个连接哪个
let tranType: string[] = [];
// 判断条件随着设备的增加而增加
if (model === "WL200") {
tranType = ["WL200", "WE200", "WE100", "12CAA"];
} else if (model === "FR200") {
tranType = ["FR200"];
}
for (let i = 0; i < item.devices.length; i++) {
let devicesName = item.devices[i].localName || item.devices[i].name;
// 是否匹配可连接设备

@ -225,7 +225,7 @@ class IotCarePlanFR200 extends Component<any, any> {
nasolabialOrMandibularOutput: false, // 鼻唇或下颌输出
partition: 0, // 分割?
pointOutChangeSide: false, // 交叉输出点
impedance: 107, // 阻抗?
impedance: 107, // 阻抗/能量等级1档<200 200<2档<280 280<3档<360 后面以此类推每加一档+80抗阻
};
/** FR200模式类型名称 */
@ -426,13 +426,14 @@ class IotCarePlanFR200 extends Component<any, any> {
/** 选中护理模式 */
modeCurrentFun = async (data, isNotCheck = false) => {
let { isShowNurse } = this.state;
// 护理检查改变模式,是否提示切换护理模式
// isNotCheck为真时不进行校验直接切换
this.tempModeCurrent = data;
// 仅在未开始护理前,切换模式的时候提示模式弹窗
// FR200默认开始护理
if (!this.state.isShowNurse) {
if (!isShowNurse) {
this.openStepTips();
}
@ -443,7 +444,6 @@ class IotCarePlanFR200 extends Component<any, any> {
if (isReturn) return;
}
let { isShowNurse } = this.state;
let currentServiceData = {
startSource: "",
stopSource: "",
@ -471,15 +471,13 @@ class IotCarePlanFR200 extends Component<any, any> {
}
});
// 如果是正在运行中切换,则直接准备运行
if (isShowNurse) {
if (!this.footerIsDisabled()) {
this.stepNext(); // 如果切换模式,则不执行开始逻辑
setTimeout(() => {
this.onNursingTap("switch");
}, 800);
}
}
// 开发中,暂时允许直接切换
// 每次切换模式时清空一下历史数据
this.changeItemUpdateFR200NursingHistory();
this.stepNext(); // 如果切换模式,则不执行开始逻辑
setTimeout(() => {
this.onNursingTap("switch");
}, 800);
};
/** 设备运行中切换模式 */
modeRuningChange() {
@ -1516,7 +1514,7 @@ class IotCarePlanFR200 extends Component<any, any> {
instrumentName: currentDevice.name,
modeId: ActiveModeItem.id,
modeName: ActiveModeItem.modeName,
id: jsonStatus.id,
id: dayjs().format("YYYY-MM-DD HH:mm:ss"),
neededTotalSeconds: jsonStatus.neededTotalSeconds,
jsonStatus,
ActiveModeItem: this.state.ActiveModeItem,
@ -1553,6 +1551,7 @@ class IotCarePlanFR200 extends Component<any, any> {
// 缓存每秒数据
if (!params.dataArray) params.dataArray = [];
params.dataArray.push(jsonStatus);
params.jsonStatus = jsonStatus;
}
}
Taro.setStorageSync("FR200NursingHistory", params);
@ -1561,6 +1560,13 @@ class IotCarePlanFR200 extends Component<any, any> {
this.setFR200NursingHistory(jsonStatus);
}
};
changeItemUpdateFR200NursingHistory() {
this.FR200NursingHistory = Taro.getStorageSync("FR200NursingHistory");
if (this.FR200NursingHistory) {
this.FR200NursingHistory.dataArray = [];
Taro.setStorageSync("FR200NursingHistory", this.FR200NursingHistory);
}
}
/**
* @name WL200
* @description 1 2
@ -1580,10 +1586,20 @@ class IotCarePlanFR200 extends Component<any, any> {
}
};
/** 提交护理记录 */
todoPromise = () => {
return new Promise<void>((resolve, reject) => {
setTimeout(() => {
resolve();
});
});
};
/** 提交护理记录:完成护理后自动调用,会跳转页面 */
PostNursingLogClock = async (data: any = null, isJump = true) => {
let { currentDevice, ActiveModeItem } = this.state;
// todo 建议写一个Promise异步函数用 await 执行,在提交前处理好数据
return;
let { currentDevice, ActiveModeItem } = this.state;
let params = {};
if (data) {
params = data;
@ -1599,7 +1615,6 @@ class IotCarePlanFR200 extends Component<any, any> {
let res: any = await InstrumentInfo.apiNursingLog.addLog(params);
console.log("PostNursingLogClock", res);
if (res.data.code === 200) {
let params = {
instrumentId: currentDevice.id,
@ -1617,7 +1632,7 @@ class IotCarePlanFR200 extends Component<any, any> {
this.setState({
isShowNursingSuccess: false,
});
this.goFaceReport();
this.goFaceReport(); // 跳转
}, 2000);
}
}

@ -11,8 +11,8 @@ import React, {
useRef,
} from "react";
import Echarts from "./components/Echart/index";
import EchartFace from "./components/Echart_face/index";
// import Echarts from "./components/Echart/index";
// import EchartFace from "./components/Echart_face/index";
import {
Block,
View,
@ -378,9 +378,12 @@ class IotCarePlanWL200 extends Component<any, any> {
let res = await InstrumentInfo.modeInfoList(params);
if (res.data.code === 200) {
if (res.data.data.length > 0) {
this.tempModeCurrent = res.data.data[0];
this.setState({
ActiveModeItem: res.data.data[0],
ModeList: res.data.data,
activeModeID: res.data.data[0].id,
ModeID: "mode_" + res.data.data[0].id,
});
// setTimeout(() => {
@ -458,9 +461,16 @@ class IotCarePlanWL200 extends Component<any, any> {
currentServiceData,
ModeStepIndex: 0,
currentTime,
ModeType: modeArray[data.modeClass],
// ModeType: modeArray[data.modeClass],
});
// 只有点击过开始,才隐藏其他模式类型
if (isShowNurse) {
this.setState({
ModeType: modeArray[data.modeClass],
});
}
setTimeout(() => {
// 设置时间组合
if (data.serviceData.length > 0) {
@ -2271,7 +2281,7 @@ class IotCarePlanWL200 extends Component<any, any> {
onTimeUpdate={this.GetVideosTime}
/>
)}
<button onClick={this.GetVideosTime}></button>
{/* <button onClick={this.GetVideosTime}>获取视频时长</button> */}
{/* <button onClick={this.handleClicksound}>音频播放/音频暂停</button> */}
{/* <button onClick={this.handleClickVideo}>播放/暂停</button> */}
{isShowNurse && (
@ -2340,8 +2350,8 @@ class IotCarePlanWL200 extends Component<any, any> {
/>
)}
<Echarts></Echarts>
<EchartFace></EchartFace>
{/* <Echarts></Echarts>
<EchartFace></EchartFace> */}
</View>
<Footer

@ -43,7 +43,7 @@ page {
/* background: red; */
}
.infobox5 {
.index-infobox5 {
padding: 44rpx 30rpx 0;
}

@ -164,11 +164,11 @@ class Index extends Component<any, any> {
}
}
componentDidMount() { }
componentDidMount() {}
componentWillUnmount() {
// 页面卸载监听
Taro.offAppHide((res) => { });
Taro.offAppHide((res) => {});
this.$instance = null;
}
@ -261,7 +261,7 @@ class Index extends Component<any, any> {
this.isSancQrcodeEnter();
}
},
fail: () => { },
fail: () => {},
complete: () => {
// 授权完成运行页面初始化
},
@ -520,7 +520,7 @@ class Index extends Component<any, any> {
this.setState({ isShowSiteSwiper: false });
};
bannerSwiperchange() { }
bannerSwiperchange() {}
gobanner(item) {
// 跳转类型0无跳转、1跳转内部链接、3跳转外部链接、4跳转小程序、5导向视频号、6导向视频号直播间',
@ -839,9 +839,9 @@ class Index extends Component<any, any> {
};
// 跳转仪器介绍页
goNursing = (item) => {
console.log(item,'查看item');
goNursing = (item) => {
console.log(item, "查看item");
// 仅开发者工具调试使用
const platform = Taro.getSystemInfoSync().platform;
if (platform === "devtools") {
@ -1109,7 +1109,7 @@ class Index extends Component<any, any> {
<View catchMove>
<PopupAlert
isShow={isCommonError}
title='提示'
title="提示"
content={
<Block>
{commonErrorText.map((item) => {
@ -1117,60 +1117,60 @@ class Index extends Component<any, any> {
})}
</Block>
}
confirmButtonText='知道了'
textAlgin='center'
confirmButtonText="知道了"
textAlgin="center"
close={this.onCommonErrorFun}
confirm={this.onCommonErrorFun}
/>
<PopupConfirm
isShow={isShowReConnectDeviceRecordWL200}
isClose
title='提示'
title="提示"
zIndex={10020}
myClassName='level-up'
myClassName="level-up"
content={
<Block>
<View></View>
<View></View>
</Block>
}
cancelButtonText='取消'
confirmButtonText='连接设备'
textAlgin='center'
cancelButtonText="取消"
confirmButtonText="连接设备"
textAlgin="center"
close={this.closeReConnectDeviceRecordWL200}
confirm={this.confirmReConnectDeviceRecordWL200}
/>
<PopupAlert
isShow={isBindingError}
title='提示'
title="提示"
content={
<Block>
<View></View>
<View></View>
</Block>
}
confirmButtonText='知道了'
textAlgin='center'
confirmButtonText="知道了"
textAlgin="center"
close={this.onBindErrorClose}
confirm={this.onBindErrorConfirm}
/>
<PopupAlert
isShow={isNotRegister}
isClose
title='提示'
content='暂未授权注册,请点击注册'
confirmButtonText='确定'
textAlgin='center'
type='1'
title="提示"
content="暂未授权注册,请点击注册"
confirmButtonText="确定"
textAlgin="center"
type="1"
close={this.closeAlert}
confirm={this.closeAlert}
/>
<PopupAlert
isShow={isDev}
title='提示'
content='页面正在开发中'
confirmButtonText='确定'
textAlgin='center'
title="提示"
content="页面正在开发中"
confirmButtonText="确定"
textAlgin="center"
close={this.closeDev}
confirm={this.closeDev}
/>
@ -1189,54 +1189,54 @@ class Index extends Component<any, any> {
/>
<PopupAlert
isShow={isBindingError}
title='提示'
title="提示"
content={
<Block>
<View></View>
<View></View>
</Block>
}
confirmButtonText='知道了'
textAlgin='center'
confirmButtonText="知道了"
textAlgin="center"
close={this.onBindErrorClose}
confirm={this.onBindErrorConfirm}
/>
<PopupAlert
isShow={isBeforeBindingError}
title='提示'
title="提示"
content={
BeforeBindingErrorText || "您选择的仪器有误,请重新确认选择"
}
confirmButtonText='知道了'
textAlgin='center'
confirmButtonText="知道了"
textAlgin="center"
close={this.onBeforeBindClose}
confirm={this.onBeforeBindConfirm}
/>
<PopupAlert
isShow={isBindingError203}
title='提示'
content='序列码已被别人绑定,请联系微信助手'
confirmButtonText='知道了'
textAlgin='center'
title="提示"
content="序列码已被别人绑定,请联系微信助手"
confirmButtonText="知道了"
textAlgin="center"
close={this.onBindErrorClose203}
confirm={this.onBindErrorConfirm203}
></PopupAlert>
<PopupAlert
isShow={showEquipment}
title='提示'
title="提示"
content={
<Block>
<View className='mb10'>
<View className="mb10">
{instrumentInfo.instrumentName}
</View>
<View className='mb10'>{instrumentInfo.serial}</View>
<View className='mb10'></View>
<View className="mb10">{instrumentInfo.serial}</View>
<View className="mb10"></View>
</Block>
}
confirmButtonText='知道了'
textAlgin='center'
confirmButtonText="知道了"
textAlgin="center"
close={this.onUnloginClose.bind(this)}
confirm={this.onUnloginConfirm.bind(this)}
></PopupAlert>
@ -1244,9 +1244,9 @@ class Index extends Component<any, any> {
<PopupSiteSwiper
isShow={isShowSiteSwiper}
siteData={sitePopupList}
size='middle'
confirmButtonText='确定'
textAlgin='center'
size="middle"
confirmButtonText="确定"
textAlgin="center"
close={this.closeSiteSwiper}
confirm={this.closeSiteSwiper}
/>
@ -1266,15 +1266,15 @@ class Index extends Component<any, any> {
isLarge
isClose
isShow={isShowUpdateVersionTip}
title='提示'
title="提示"
content={
<Block>
<View></View>
<View></View>
</Block>
}
textAlgin='center'
confirmButtonText='确定'
textAlgin="center"
confirmButtonText="确定"
close={this.cancelUpdateVersionTip}
confirm={this.confirmUpdateVersionTip}
/>
@ -1287,16 +1287,16 @@ class Index extends Component<any, any> {
)}
<PopupAlert
isShow={isShowVersionUpgradFinish}
title='升级内容公告'
title="升级内容公告"
content={
<Block>
<View className='nodes'>
<View className="nodes">
<RichText nodes={versionUpgradFinishNodes} />
</View>
</Block>
}
confirmButtonText='知道了'
textAlgin='left'
confirmButtonText="知道了"
textAlgin="left"
isClose
close={this.onVersionUpgradFinish}
confirm={this.onVersionUpgradFinish}
@ -1308,29 +1308,29 @@ class Index extends Component<any, any> {
leftSlot={
<Block>
<View
className='message'
className="message"
onClick={this.gourl}
data-url='/pages/message/message'
data-url="/pages/message/message"
>
<Image
className='message-img'
className="message-img"
src={require("../../img/index/message.png")}
mode='aspectFill'
mode="aspectFill"
/>
{messagecount ? <View className='tip' /> : ""}
{messagecount ? <View className="tip" /> : ""}
</View>
</Block>
}
/>
<View className='index'>
<View className='date-title' onClick={this.toNursingRecords}>
<Text className='text'></Text>
<View className="index">
<View className="date-title" onClick={this.toNursingRecords}>
<Text className="text"></Text>
<Image
src={require("../../img/index/right.png")}
style='width: 20rpx;height: 20rpx;'
style="width: 20rpx;height: 20rpx;"
/>
</View>
<View className='bg-while'>
<View className="bg-while">
<AtCalendar
hideArrow
isSwiper={false}
@ -1342,40 +1342,40 @@ class Index extends Component<any, any> {
/>
</View>
</View>
<View className='infobox5'>
<View className="index-infobox5">
{instrumentList.length > 0 && (
<Block>
<View className='nurse_plan_box flex aitems sb'>
<View className='title'></View>
<View className="nurse_plan_box flex aitems sb">
<View className="title"></View>
<View
className='txt_box flex jcenter aitems'
data-url='/pages/instrument/instrument'
className="txt_box flex jcenter aitems"
data-url="/pages/instrument/instrument"
onClick={this.gourl}
>
<Image
className='right_icon'
className="right_icon"
src={require("../../img/black-add.png")}
mode='aspectFill'
mode="aspectFill"
/>
<View className='txt'></View>
<View className="txt"></View>
</View>
</View>
<View style='overflow-x: auto;'>
<View className='device_list flex'>
<View style="overflow-x: auto;">
<View className="device_list flex">
{instrumentList.map((item, index) => {
return (
<View
key={"instrumentList" + index}
className='device_item'
className="device_item"
onClick={this.goNursing.bind(this, item)}
>
<Image
className='banner_img'
className="banner_img"
src={item.banner}
mode='aspectFill'
mode="aspectFill"
/>
<View className='device_name ellipsis1'>
<View className="device_name ellipsis1">
{item.name}
</View>
</View>
@ -1387,28 +1387,28 @@ class Index extends Component<any, any> {
)}
{instrumentList.length === 0 && (
<Block>
<View className='nurse_plan_box flex aitems sb'>
<View className='title'></View>
<View className="nurse_plan_box flex aitems sb">
<View className="title"></View>
</View>
<View className='add_device flex jcenter aitems bg-while'>
<View className='add_device_btn'>
<View className='txt_box flex jcenter aitems'>
<View className="add_device flex jcenter aitems bg-while">
<View className="add_device_btn">
<View className="txt_box flex jcenter aitems">
<View
className='at-icon at-icon-add'
style='color: #fff;font-size: 30rpx;'
className="at-icon at-icon-add"
style="color: #fff;font-size: 30rpx;"
></View>
<View className='txt' onClick={this.addNewDevice}>
<View className="txt" onClick={this.addNewDevice}>
</View>
</View>
</View>
<View className='tips'></View>
<View className="tips"></View>
</View>
</Block>
)}
</View>
<View className='infobox3'>
<View className="infobox3">
<Swiper
autoplay
onAnimationFinish={this.bannerSwiperchange.bind(this)}
@ -1420,15 +1420,15 @@ class Index extends Component<any, any> {
key={"banner_" + index}
onClick={this.gobanner.bind(this, item)}
>
<Image style='width:100%;height:100%' src={item.fileUrl} />
<Image style="width:100%;height:100%" src={item.fileUrl} />
</SwiperItem>
);
})}
</Swiper>
</View>
<View style='height:200rpx'></View>
<Popup show={show} className='custom-popup' overlay={false}>
<View className='popBox'></View>
<View style="height:200rpx"></View>
<Popup show={show} className="custom-popup" overlay={false}>
<View className="popBox"></View>
</Popup>
</Block>
);

Loading…
Cancel
Save