rongweikang 2 years ago
commit 5f44514b2d

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

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

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

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

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

Loading…
Cancel
Save