blak-kong 2 years ago
parent 67070731fa
commit 487903cf43

@ -104,7 +104,7 @@ class ConnectionBluetoot extends Component<any, any> {
searchError: false, //是否没有搜索到设备
connectionStatus: false, //是否连接成功状态
hasVersionInfo: false, // 是否已获得版本信息
hasSyncRecord: false,
hasSyncRecord: false, // 是否已同步记录
subDeviceConnectedStatus: false, //子设备是否连接成功状态
synchronousStatus: false, // 设备同步记录状态
islian: false, //是否获取离线记录状态
@ -131,11 +131,6 @@ class ConnectionBluetoot extends Component<any, any> {
// 只有非断开状态的弹窗才自动连接蓝牙
if (!this.props.isDisconnect) {
this.connection();
} else {
// 断开状态弹窗:自动设置为错误模式
this.setState({
error: true,
});
}
}
@ -989,22 +984,17 @@ class ConnectionBluetoot extends Component<any, any> {
this.sendGetVersion();
}
}
}, 1000);
}, 600);
// 5秒后没有收到版本返回直接跳去护理页
// if (isGetVersionTimer) clearTimeout(isGetVersionTimer);
// isGetVersionTimer = setTimeout(() => {
// that.setData({
// connectionStatus: true,
// // subDeviceConnectedStatus: true, // 子设备连接状态
// })
// this.sendSyncRecording()
// }, 5000);
if (isGetVersionTimer) clearTimeout(isGetVersionTimer);
isGetVersionTimer = setTimeout(() => {
this.sendSyncRecording();
}, 5000);
}
/** 发送同步记录 */
sendSyncRecording() {
const { deviceInfo } = this.props;
const versionCommand = {
commandType: "InfoQuery",
infoQueryType: "offlineClockSummary",
@ -1035,6 +1025,7 @@ class ConnectionBluetoot extends Component<any, any> {
console.log("onReconnect");
// 重置信息并重连
this.setState({
isBreak: false,
error: false,
searchError: false,
errorText: "",
@ -1077,6 +1068,7 @@ class ConnectionBluetoot extends Component<any, any> {
connectionSuccess={connectionSuccess}
isConnection={isConnection}
error={error}
isDisconnect={isDisconnect}
title="面罩模式启动中"
/>
</Block>

@ -84,6 +84,7 @@ export default class DeviceConnectPopup extends Component<any, any> {
isConnection,
currentDeviceType,
error,
isDisconnect,
} = this.props;
return (
@ -103,7 +104,7 @@ export default class DeviceConnectPopup extends Component<any, any> {
></View>
{/* 非错误弹窗 */}
{!error && (
{!error && !isDisconnect && (
<View className={classnames("common-box device-connection-box")}>
<View
className={classnames("common-popup-title", "margin-samll")}
@ -188,8 +189,48 @@ export default class DeviceConnectPopup extends Component<any, any> {
</View>
)}
{/* 错误与失败弹窗 */}
{error && (
{/* 断开弹窗 */}
{!error && isDisconnect && (
<View className={classnames("common-box", "device-connection-box")}>
<View
className={classnames("common-popup-title", "margin-samll")}
>
{data.bluetoothClosedTitle}
</View>
<View className="device-popup-content-box">
{!this.isImage(data.bluetoothClosed) ? (
<Video className="videos" src={data.bluetoothClosed} />
) : (
<Image
className="images"
src={data.bluetoothClosed}
mode="aspectFill"
/>
)}
<View className="error-block">
<View className="tip1"></View>
<View className="tip2">
{data.bluetoothClosedContent || "请重启设备后点击重新连接"}
</View>
</View>
</View>
<View className="common-popup-btns device-popup-btns">
<Button className="common-popup-btn2" onClick={this.onClose}>
</Button>
<Button
className="common-popup-btn2"
onClick={this.onReconnect}
>
</Button>
</View>
</View>
)}
{/* 错误失败弹窗 */}
{error && !isDisconnect && (
<View className={classnames("common-box", "device-connection-box")}>
<View
className={classnames("common-popup-title", "margin-samll")}

@ -22,26 +22,28 @@ function Index({ isShowNurse, ActiveModeItem }: Props) {
<View className="modelInfo-title"></View>
<View className="modelInfo-effect">{ActiveModeItem.modeDesc}</View>
</View>
<View className="modelInfo-line">
<View className="modelInfo-title"></View>
<View className="modelInfo-light-box">
{ActiveModeItem.combineData.map((item) => {
return (
<View className="modelInfo-light-item" key={item.id}>
<View
className="modelInfo-light-color"
style={{
backgroundColor: ModeColor[item.technologyInfo],
}}
></View>
<View className="modelInfo-light-colorname">
{item.effectContent}({item.technologyInfo})
{ActiveModeItem.combineData.length > 0 && (
<View className="modelInfo-line">
<View className="modelInfo-title"></View>
<View className="modelInfo-light-box">
{ActiveModeItem.combineData.map((item) => {
return (
<View className="modelInfo-light-item" key={item.id}>
<View
className="modelInfo-light-color"
style={{
backgroundColor: ModeColor[item.technologyInfo],
}}
></View>
<View className="modelInfo-light-colorname">
{item.effectContent}({item.technologyInfo})
</View>
</View>
</View>
);
})}
);
})}
</View>
</View>
</View>
)}
</View>
)}
</Block>

@ -1468,8 +1468,9 @@ class IotCarePlan extends Component<any, any> {
// 仪器缓存模式,判断是否存在于现有模式中
let recordModeItem = ModeList.find((item) => {
return item.id == WL200NursingHistory.currentServiceData.id;
return item.id == WL200NursingHistory.currentServiceData.modeId;
});
console.log("recordModeItem", recordModeItem);
if (!WL200NursingHistory || !recordModeItem) {
console.log("仪器有数据, 但是缓存没有数据, 忽略");
return;

@ -106,6 +106,7 @@ class Index extends Component<any, any> {
isBindingError: false, // 绑定失败
isBeforeBindingError: false, // 绑定前校验错误弹窗
BeforeBindingErrorText: "", // 绑定前校验错误文本
isBindingError203: false, // 绑定失败弹窗:已被别人绑定
instrumentList: [], // 仪器列表
unbindingInstrumentList: [], // 未绑定仪器列表
@ -661,6 +662,8 @@ class Index extends Component<any, any> {
this.getInstrumentIntroInfo(instrumentInfo.id);
}, 1000);
return;
} else if (data.code === 203) {
this.setState({ isBindingError203: true });
} else if (data.code === 202) {
// 换绑操作
this.setState({ isExchangeBinding: true, isVisibleBinding: true });
@ -705,6 +708,7 @@ class Index extends Component<any, any> {
}
};
// 仪器绑定失败弹窗
// 绑定失败
onBindErrorClose = () => {
this.setState({ isBindingError: false });
this.removeScanFun();
@ -713,6 +717,15 @@ class Index extends Component<any, any> {
this.onBindErrorClose();
go("/pages/consultant/consultant?customBack=true");
};
// 已被别人绑定
onBindErrorClose203 = () => {
this.setState({ isBindingError203: false });
};
onBindErrorConfirm203 = () => {
this.onBindErrorClose203();
go("/pages/consultant/consultant");
};
// 绑定后弹窗
onBeforeBindClose = () => {
this.setState({ isBeforeBindingError: false });
this.removeScanFun();
@ -951,6 +964,7 @@ class Index extends Component<any, any> {
isBindingError,
isBeforeBindingError,
BeforeBindingErrorText,
isBindingError203,
isRegisterBoolean,
isExchangeBinding,
instrumentInfo,
@ -1080,6 +1094,16 @@ class Index extends Component<any, any> {
confirm={this.onBeforeBindConfirm}
/>
<PopupAlert
isShow={isBindingError203}
title="提示"
content="序列码已被别人绑定,请联系微信助手"
confirmButtonText="知道了"
textAlgin="center"
close={this.onBindErrorClose203}
confirm={this.onBindErrorConfirm203}
></PopupAlert>
<PopupAlert
isShow={showEquipment}
title="提示"

@ -295,7 +295,7 @@ export default class Instrument extends Component<any, any> {
let code = Number(res.code); // 强制类型转换
if (code === 200) {
this.openBindingVisible();
} else if (code === 204) {
} else if (code === 204 || code === 205) {
this.setState({ isBindingCheckError: true });
} else {
this.setState({ isBindingError: true });
@ -345,6 +345,8 @@ export default class Instrument extends Component<any, any> {
go("/pages/instrument/intro?id=" + channelInfo.id);
} else if (res.data.code === 204) {
this.setState({ isBindingCheckError: false });
} else if (res.data.code === 203) {
this.setState({ isBindingError203: true });
} else {
this.setState({ isBindingError: true });
}

Loading…
Cancel
Save