临时提交,准备合并

master
blak-kong 2 years ago
parent 474dfe2637
commit 40f33ed5a6

@ -24,6 +24,9 @@ class App extends Component<PropsWithChildren> {
return; return;
} }
// 每次进入小程序,删除可能残留的同步状态
Taro.removeStorageSync("isSyncHistory");
// go("/pages/iotCarePlan/iotCarePlan"); // go("/pages/iotCarePlan/iotCarePlan");
// go("/pages/instrument_clickin_upload/index"); // go("/pages/instrument_clickin_upload/index");
// go("/pages/instrument/intro"); // go("/pages/instrument/intro");

@ -22,7 +22,7 @@ function Index({ isShowNurse, ActiveModeItem }: Props) {
<View className="modelInfo-title"></View> <View className="modelInfo-title"></View>
<View className="modelInfo-effect">{ActiveModeItem.modeDesc}</View> <View className="modelInfo-effect">{ActiveModeItem.modeDesc}</View>
</View> </View>
{ActiveModeItem.combineData.length > 0 && ( {ActiveModeItem?.combineData && (
<View className="modelInfo-line"> <View className="modelInfo-line">
<View className="modelInfo-title"></View> <View className="modelInfo-title"></View>
<View className="modelInfo-light-box"> <View className="modelInfo-light-box">

@ -209,6 +209,8 @@ class IotCarePlan extends Component<any, any> {
// 按钮是否不可运行 // 按钮是否不可运行
isFooterBtnDisabled: true, isFooterBtnDisabled: true,
// isFirstEntryMode: false, // 模式首次打开 // isFirstEntryMode: false, // 模式首次打开
isShowHistoryMsg: false, // 是否显示正在同步历史
}; };
} }
@ -260,6 +262,7 @@ class IotCarePlan extends Component<any, any> {
if (obj) { if (obj) {
this.setState({ this.setState({
currentDevice: obj, currentDevice: obj,
title: obj.name,
}); });
await this.GetModeList(obj.id); await this.GetModeList(obj.id);
@ -377,7 +380,7 @@ class IotCarePlan extends Component<any, any> {
// this.modeCurrentFun(res.data.data[0]); // this.modeCurrentFun(res.data.data[0]);
// }, 100); // }, 100);
} else { } else {
this.setState({ ModeList: res.data.data }); this.setState({ ModeList: [] });
} }
} }
}; };
@ -797,6 +800,13 @@ class IotCarePlan extends Component<any, any> {
jsonStatus jsonStatus
); );
this.workStatus = jsonStatus.workStatus;
this.setState({
Electricity: jsonStatus.battery,
// fr200Electricity: jsonStatus.battery,
matrixElectricity: jsonStatus.matrixBattery,
});
// 判断设备主动上报的关机事件 // 判断设备主动上报的关机事件
if (jsonStatus.workStatus === MODE_WORKING_ENUM.END) { if (jsonStatus.workStatus === MODE_WORKING_ENUM.END) {
// 判断id是否一致, 一致的话则生成护理报表, 并提示 // 判断id是否一致, 一致的话则生成护理报表, 并提示
@ -810,13 +820,6 @@ class IotCarePlan extends Component<any, any> {
return; return;
} }
this.workStatus = jsonStatus.workStatus;
this.setState({
Electricity: jsonStatus.battery,
// fr200Electricity: jsonStatus.battery,
matrixElectricity: jsonStatus.matrixBattery,
});
if (jsonStatus?.workMode === this.state.ActiveModeItem.modeType) { if (jsonStatus?.workMode === this.state.ActiveModeItem.modeType) {
this.setState({ this.setState({
workMode: jsonStatus?.workMode, // 仅当设备上报模式与小程序一致时,才允许改变小程序变量缓存 workMode: jsonStatus?.workMode, // 仅当设备上报模式与小程序一致时,才允许改变小程序变量缓存
@ -1444,6 +1447,12 @@ class IotCarePlan extends Component<any, any> {
await sleep(2); await sleep(2);
} }
let isSyncHistory = Taro.getStorageSync("isSyncHistory");
if (isSyncHistory) {
this.setState({ isShowHistoryMsg: false });
Taro.removeStorageSync("isSyncHistory");
}
// 2.判断是否已存在缓存的护理记录:如果没有历史,则缓存 // 2.判断是否已存在缓存的护理记录:如果没有历史,则缓存
let workStatus = this.workStatus; let workStatus = this.workStatus;
let WL200NursingHistory = this.WL200NursingHistory; let WL200NursingHistory = this.WL200NursingHistory;
@ -1541,10 +1550,16 @@ class IotCarePlan extends Component<any, any> {
/** 获取小程序本地缓存的历史记录 */ /** 获取小程序本地缓存的历史记录 */
getWL200NursingHistory() { getWL200NursingHistory() {
this.WL200NursingHistory = Taro.getStorageSync("WL200NursingHistory"); this.WL200NursingHistory = Taro.getStorageSync("WL200NursingHistory");
// 同步历史记录
if (this.state.isSyncHistory) { // 是否同步历史记录
// 同步历史记录 let isSyncHistory = Taro.getStorageSync("isSyncHistory");
this.setState({}); if (isSyncHistory) {
// 直接进入开始护理状态
this.setState({
isShowNurse: true,
isShowHistoryMsg: true,
});
} }
} }
/** 设置WL200护理历史 */ /** 设置WL200护理历史 */
@ -1980,6 +1995,7 @@ class IotCarePlan extends Component<any, any> {
nurseInfo, nurseInfo,
isShowReReadRecordSave, isShowReReadRecordSave,
isFooterBtnDisabled, isFooterBtnDisabled,
isShowHistoryMsg,
} = this.state; } = this.state;
return ( return (
@ -2120,6 +2136,10 @@ class IotCarePlan extends Component<any, any> {
)} )}
</View> </View>
{isShowHistoryMsg && (
<View className="sync-history-msg">...</View>
)}
<View> <View>
<View className="iot-main"> <View className="iot-main">
<View className="banner-box"> <View className="banner-box">
@ -2189,10 +2209,12 @@ class IotCarePlan extends Component<any, any> {
/> />
)} )}
<ModeContent {ActiveModeItem.combineData && (
isShowNurse={isShowNurse} <ModeContent
ActiveModeItem={ActiveModeItem} isShowNurse={isShowNurse}
/> ActiveModeItem={ActiveModeItem}
/>
)}
{/* <Echarts></Echarts> */} {/* <Echarts></Echarts> */}
</View> </View>

@ -417,8 +417,6 @@ class Index extends Component<any, any> {
}; };
gourl = (e) => { gourl = (e) => {
const { url } = e.currentTarget.dataset; const { url } = e.currentTarget.dataset;
if (this.isRegister()) { if (this.isRegister()) {
go(url); go(url);
@ -481,11 +479,11 @@ class Index extends Component<any, any> {
mask: true, mask: true,
}); });
let { data: res } = await InstrumentInfo.bindingInstrumentList(); let { data: res } = await InstrumentInfo.bindingInstrumentList();
console.log(res,'查看绑定的设备'); console.log(res, "查看绑定的设备");
// Taro.hideLoading(); // Taro.hideLoading();
if (res.code === 200) { if (res.code === 200) {
if(res.data.length === 0){ if (res.data.length === 0) {
this.setState({ ViewAddInstrument: false }); this.setState({ ViewAddInstrument: false });
} }
this.setState({ instrumentList: res.data }); this.setState({ instrumentList: res.data });
@ -752,7 +750,6 @@ class Index extends Component<any, any> {
// 跳转仪器介绍页 // 跳转仪器介绍页
goNursing = (item) => { goNursing = (item) => {
if (item.status === 0) { if (item.status === 0) {
setStorageSync("instrument_detail", item); setStorageSync("instrument_detail", item);
this.setState({ connectInstrument: item }); this.setState({ connectInstrument: item });
@ -768,7 +765,6 @@ class Index extends Component<any, any> {
/** 蓝牙逻辑 */ /** 蓝牙逻辑 */
bindBlockLeft() { bindBlockLeft() {
if (!this.state.isRegisterBoolean) { if (!this.state.isRegisterBoolean) {
//未注册授权 //未注册授权
this.alertRegister(); this.alertRegister();
@ -927,6 +923,7 @@ class Index extends Component<any, any> {
let item = getStorageSync("instrument_detail"); let item = getStorageSync("instrument_detail");
this.setState({ connectInstrument: item }); this.setState({ connectInstrument: item });
setTimeout(() => this.bindBlockLeft()); setTimeout(() => this.bindBlockLeft());
Taro.setStorageSync("isSyncHistory", true);
}; };
// 扫码绑定必须先完成注册弹窗:确定以后删除扫码缓存,防止死循环 // 扫码绑定必须先完成注册弹窗:确定以后删除扫码缓存,防止死循环

@ -385,7 +385,6 @@ export default class Instrument extends Component<any, any> {
let { data } = await InstrumentInfo.exchangeBinding({ let { data } = await InstrumentInfo.exchangeBinding({
serial: channelInfo.serialCode, serial: channelInfo.serialCode,
}); });
console.log("exchangeBinding", data);
Taro.hideLoading(); Taro.hideLoading();
this.closeBinding(); this.closeBinding();
if (data.code === 200) { if (data.code === 200) {

Loading…
Cancel
Save