fix给自动重新登录加上2秒延迟定时器

master
blak-kong 2 years ago
parent a1d3824adf
commit bc9b6bc487

@ -438,7 +438,9 @@ class Index extends Component<any, any> {
}, 300); }, 300);
} else { } else {
msg("请求失败,尝试重新请求"); msg("请求失败,尝试重新请求");
setTimeout(() => {
this.WCUserLogin(); this.WCUserLogin();
}, 2000);
} }
} }
closeBinding = () => { closeBinding = () => {

@ -46,11 +46,6 @@ import { go, getStorageSync, setStorageSync } from "@/utils/traoAPI";
import { InstrumentInfo } from "@/utils/Interface"; import { InstrumentInfo } from "@/utils/Interface";
import "./iotCarePlan.less"; import "./iotCarePlan.less";
import UpdateIotWL200 from "@/components/bluetoot/update-wl200/index";
// import log from "@/utils/log";
// log.info("123456info", 123456, { sdfasdf: 123 });
import { import {
notifyBLECharacteristicValueChange, notifyBLECharacteristicValueChange,
sendCommand, sendCommand,
@ -60,15 +55,7 @@ import {
bleCommandSamples, bleCommandSamples,
} from "@/components/bluetoot/connection/test"; } from "@/components/bluetoot/connection/test";
import { Progress } from "@antmjs/vantui"; import { minSecToS, s_to_ms, s_to_hms, sleep } from "@/utils/util";
import {
s_to_s,
s_to_m,
minSecToS,
s_to_ms,
s_to_hms,
sleep,
} from "@/utils/util";
import { DeviceToolKit as DeviceToolKitWE100 } from "@flossom-npm/iot-translater-we100"; import { DeviceToolKit as DeviceToolKitWE100 } from "@flossom-npm/iot-translater-we100";
import commandMap from "@/utils/commandMap"; import commandMap from "@/utils/commandMap";
@ -77,7 +64,6 @@ const deviceToolKitInstanceWL200 = new DeviceToolKitWE100("WL200", "WL200");
let currentTimeTimer: any = null; // 当前项目时间定时器 let currentTimeTimer: any = null; // 当前项目时间定时器
let CountdownTimer: any = null; let CountdownTimer: any = null;
let timer: any = null; let timer: any = null;
let checkVersionTimeout: any = null;
let showTipsTimer: any = null; let showTipsTimer: any = null;
let loadingTipsTimer: any = null; // 蓝牙连接提示 let loadingTipsTimer: any = null; // 蓝牙连接提示
let switchModeStatus = "free"; // 用于标记是否在切换模式中, free: 空闲, switching: 切换中 let switchModeStatus = "free"; // 用于标记是否在切换模式中, free: 空闲, switching: 切换中
@ -277,7 +263,6 @@ class IotCarePlan extends Component<any, any> {
}); });
await this.GetModeList(info.id); await this.GetModeList(info.id);
console.log("info");
// 如果不存在设备模式值,则判断为首次进入,弹窗提示 // 如果不存在设备模式值,则判断为首次进入,弹窗提示
let isFirstTipShow = getStorageSync("first_instrument_" + info.id); let isFirstTipShow = getStorageSync("first_instrument_" + info.id);
@ -439,14 +424,7 @@ class IotCarePlan extends Component<any, any> {
if (isReturn) return; if (isReturn) return;
} }
let { isStandStatus, isShowNurse } = this.state; let { isShowNurse } = this.state;
// let isCabinMode = data.isCabinMode === 1;
// if (isStandStatus === isCabinMode) {
// this.setState({ isCanClick: true }); // 是否舱体一致时,可以点击
// } else {
// this.setState({ isCanClick: false });
// }
let currentServiceData = { let currentServiceData = {
startSource: "", startSource: "",
@ -713,6 +691,7 @@ class IotCarePlan extends Component<any, any> {
// 设备断开时,给定一个断开时间 // 设备断开时,给定一个断开时间
ActiveModeItem.breakTimeStr = this.state.currentTime; ActiveModeItem.breakTimeStr = this.state.currentTime;
this.setState({ this.setState({
isStandStatus: false, isStandStatus: false,
isStopNurse: true, isStopNurse: true,
@ -977,6 +956,11 @@ class IotCarePlan extends Component<any, any> {
}); });
this.judgementWorkStatus(MODE_WORKING_ENUM.END, jsonStatus.workMode); this.judgementWorkStatus(MODE_WORKING_ENUM.END, jsonStatus.workMode);
} }
// 每次同步后,更新历史缓存
setTimeout(() => {
this.updateWL200NursingHistory();
}, 100);
}, },
}; };
@ -1192,9 +1176,6 @@ class IotCarePlan extends Component<any, any> {
"仅在时间达到下一步步骤切换时更新currentServiceData", "仅在时间达到下一步步骤切换时更新currentServiceData",
currentServiceData currentServiceData
); );
this.updateWL200NursingHistory(currentServiceData);
this.setState({ this.setState({
ModeStepIndex: index, ModeStepIndex: index,
currentServiceData, currentServiceData,
@ -1527,6 +1508,8 @@ class IotCarePlan extends Component<any, any> {
if (this.WL200NursingHistory) { if (this.WL200NursingHistory) {
let params: any = this.WL200NursingHistory; let params: any = this.WL200NursingHistory;
// 设置当前时间
params.currentTime = this.state.currentTime; params.currentTime = this.state.currentTime;
// 设置正确封面 // 设置正确封面
@ -1860,11 +1843,9 @@ class IotCarePlan extends Component<any, any> {
render() { render() {
let { let {
name,
title, title,
isConnectShow, isConnectShow,
isShowStepTips, isShowStepTips,
isCanClick,
isShowNurse, isShowNurse,
isStopNurse, isStopNurse,
ModeList, ModeList,

Loading…
Cancel
Save