fix:bug修复,临时提交用于同步

master
blak-kong 2 years ago
parent ff44a435fe
commit 8d3e804844

@ -764,15 +764,6 @@ class Index extends Component<any, any> {
// return;
}
// 扫码绑定必须先完成注册弹窗:确定以后删除扫码缓存,防止死循环
onUnloginConfirm() {
this.setState({ showEquipment: false });
this.removeScanFun();
}
onUnloginClose() {
this.setState({ showEquipment: false });
this.removeScanFun();
}
//连接完成时数据的回调
offlineChange = async (e) => {
console.log("offlineChange", e);
@ -876,6 +867,16 @@ class Index extends Component<any, any> {
// this.goNursing()
};
// 扫码绑定必须先完成注册弹窗:确定以后删除扫码缓存,防止死循环
onUnloginConfirm() {
this.setState({ showEquipment: false });
this.removeScanFun();
}
onUnloginClose() {
this.setState({ showEquipment: false });
this.removeScanFun();
}
/**
* @name
* @description

@ -11,13 +11,23 @@ import {
SwiperItem,
} from "@tarojs/components";
/* 自定义组件 */
/** 自定义组件 **/
import PopupAlert from "@/components/popup/popup-alert";
import PopupConfirm from "@/components/popup/popup-confirm";
import Navbar from "@/components/navbar/navbar";
// import PopupAlert from "../../components/popup/popup-alert";
/* 组件 */
import ConnectionBluetoot from "@/components/bluetoot/connection";
import UpdateIotWL200 from "@/components/bluetoot/update-wl200/index";
/** 自定义组件 **/
import { InstrumentInfo } from "@/utils/Interface";
import { setStorageSync, getStorageSync, go, back } from "@/utils/traoAPI";
import {
setStorageSync,
getStorageSync,
go,
back,
showModal,
} from "@/utils/traoAPI";
import "./intro.less";
@ -29,6 +39,23 @@ class Intro extends Component<any, any> {
current: 0,
instrument: {},
introList: [],
isCommonError: false, // 是否显示通用错误提示
commonErrorText: [], // 通用错误提示
/** 蓝牙相关 */
isConnectShow: false,
connectInstrument: {}, // 当前连接设备
/* END */
// 设备升级弹窗
isShowUpdateVersionTip: false, // 升级提示
isShowVersionUpgrading: false, // 升级中
isShowVersionUpgradFinish: false, // 升级完成:升级内容公告
versionUpgradFinishNodes: "", // 公告内容
// 设备是否重连弹窗
isShowReConnectDeviceRecordWL200: false,
};
}
$instance = Taro.getCurrentInstance();
@ -100,16 +127,292 @@ class Intro extends Component<any, any> {
back();
};
// 跳转仪器介绍页
goNursing = (item) => {
if (item.status === 0) {
setStorageSync("instrument_detail", item);
this.setState({ connectInstrument: item });
setTimeout(() => this.bindBlockLeft());
} else {
// todo
this.openCommonError([
"该仪器暂时无法进行在线护理,",
"请联系微信小助理",
]);
}
};
/**
* @name
* @description
* @params
*/
openCommonError = (text) => {
this.setState({
commonErrorText: text,
isCommonError: true,
});
};
onCommonErrorFun = () => {
this.setState({
isCommonError: false,
});
};
/** 蓝牙逻辑 */
bindBlockLeft() {
if (!this.state.isRegisterBoolean) {
//未注册授权
this.alertRegister();
return false;
}
if (this.state.connectInstrument.type === 1) {
//非IOT
setTimeout(() => {
go("/pages/instrumentClickinUpload/index");
}, 10);
} else {
Taro.getSystemInfo({
success: (res) => {
console.log("getSystemInfo", res);
let { locationEnabled, locationAuthorized, bluetoothEnabled } = res;
if (!locationEnabled || !locationAuthorized) {
showModal({
t2: "您的手机定位授权未开启,请前往手机设置,打开定位访问授权",
btn2text: "查看指引",
}).then(() => {
go("/pages/connection_help/connection_help?type=location");
});
} else if (!bluetoothEnabled) {
showModal({
t2: "您的手机蓝牙授权未开启,请前往手机设置,打开蓝牙访问授权",
btn2text: "查看指引",
}).then(() => {
go("/pages/connection_help/connection_help?type=bluetoot");
});
} else {
// 打开连接弹窗
this.connectionOpen();
}
},
});
}
}
/**
* WE100,WL200
*/
pairingChange = (e) => {
console.log("===epairingChange===》", e);
go("/pages/iotCarePlan/iotCarePlan"); // 画页面直接跳转
this.connectionClose();
};
async goIot() {
go("/pages/iotCarePlan/iotCarePlan"); // 画页面直接跳转
// return;
}
//连接完成时数据的回调
offlineChange = async (e) => {
console.log("offlineChange", e);
this.pairingChange("offlineChange");
};
connectionOpen = async () => {
this.setState({ isConnectShow: true });
};
connectionClose = async () => {
this.setState({ isConnectShow: false });
};
connectionConfirm = async () => {
this.connectionClose();
};
/*蓝牙 END*/
/** 设备iot固件版本升级 */
// 是否更新弹窗
upgradeFun = () => {
this.setState({ isShowUpdateVersionTip: true, isConnectShow: false });
};
cancelUpdateVersionTip = () => {
// 关闭提示
this.setState({ isShowUpdateVersionTip: false });
};
confirmUpdateVersionTip = () => {
// 提示升级与开始升级
this.setState({
isShowUpdateVersionTip: false,
isShowVersionUpgrading: true,
});
};
// 完成升级
wl200UpgradeFinishFun = (isWL200) => {
let { connectInstrument } = this.state;
console.log("connectInstrument", connectInstrument);
let content = "";
if (isWL200) {
content = connectInstrument.iotVersionUpgrade;
} else {
content = connectInstrument.we200IotVersionUpgrade;
}
let nodes = decodeURIComponent(content || "");
nodes = nodes.replace(/\<img/gi, '<img style="width:100%;height:auto" ');
nodes = nodes.replace(
/\<table/gi,
'<table style="border-spacing: 0;border-collapse: collapse;border: 1px solid #000" '
);
nodes = nodes.replace(
/\<td/gi,
'<td style="border: 1px solid #000;text-align:center" '
);
this.setState({
isShowVersionUpgrading: false,
isShowVersionUpgradFinish: true, // 升级介绍
versionUpgradFinishNodes: nodes,
});
};
// 升级失败
wl200UpgradeErrorFun = () => {
this.setState({
isShowVersionUpgrading: false,
});
};
// 关闭升级完成公告
onVersionUpgradFinish = () => {
this.setState({
isShowVersionUpgradFinish: false,
});
};
/** iot版本升级 END */
/**
* @name WL200
* @description
*/
initDeviceNursingHistory = async () => {
let WL200NursingHistory = Taro.getStorageSync("WL200NursingHistory");
if (WL200NursingHistory) {
this.setState({
isShowReConnectDeviceRecordWL200: true,
});
}
};
closeReConnectDeviceRecordWL200 = () => {
Taro.removeStorageSync("WL200NursingHistory");
this.setState({
isShowReConnectDeviceRecordWL200: false,
});
};
confirmReConnectDeviceRecordWL200 = () => {
let WL200NursingHistory = Taro.getStorageSync("WL200NursingHistory");
console.log("WL200NursingHistory", WL200NursingHistory);
this.setState({
isShowReConnectDeviceRecordWL200: false,
});
// this.goNursing()
};
render() {
let { current, introList, instrument } = this.state;
return (
<Block>
<Navbar
titleSlot="仪器绑定"
titleSlot="仪器介绍"
isBack
isCustomBack
customBack={this.customBack}
/>
<View catchMove>
<PopupAlert
isShow={isCommonError}
title="提示"
content={
<Block>
{commonErrorText.map((item) => {
return <View>{item}</View>;
})}
</Block>
}
confirmButtonText="知道了"
textAlgin="center"
close={this.onCommonErrorFun}
confirm={this.onCommonErrorFun}
/>
<PopupConfirm
isShow={isShowReConnectDeviceRecordWL200}
isClose
title="提示"
zIndex={10020}
myClassName="level-up"
content={
<Block>
<View></View>
<View></View>
</Block>
}
cancelButtonText="暂不绑定"
confirmButtonText="确认"
textAlgin="center"
close={this.closeReConnectDeviceRecordWL200}
confirm={this.confirmReConnectDeviceRecordWL200}
/>
{/* IOT相关弹窗 */}
{isConnectShow && (
<ConnectionBluetoot
deviceInfo={connectInstrument}
close={this.connectionClose}
confirm={this.connectionConfirm}
offlineChange={this.offlineChange}
pairingChange={this.pairingChange}
upgradeFun={this.upgradeFun}
/>
)}
<PopupAlert
isLarge
isClose
isShow={isShowUpdateVersionTip}
title="提示"
content={
<Block>
<View></View>
<View></View>
</Block>
}
textAlgin="center"
confirmButtonText="确定"
close={this.cancelUpdateVersionTip}
confirm={this.confirmUpdateVersionTip}
/>
{isShowVersionUpgrading && (
<UpdateIotWL200
isShow={isShowVersionUpgrading}
finishFun={this.wl200UpgradeFinishFun}
errorFun={this.wl200UpgradeErrorFun}
/>
)}
<PopupAlert
isShow={isShowVersionUpgradFinish}
title="升级内容公告"
content={
<Block>
<View className="nodes">
<RichText nodes={versionUpgradFinishNodes} />
</View>
</Block>
}
confirmButtonText="知道了"
textAlgin="left"
isClose
close={this.onVersionUpgradFinish}
confirm={this.onVersionUpgradFinish}
/>
{/* IOT相关弹窗 END */}
</View>
<View style="position: relative">
<Swiper
className="main"

@ -101,13 +101,18 @@ export default class InstrumentClickInUpload extends Component<any, any> {
});
if (res.data.code === 200) {
// 仅在有数据的时候执行
if (res.data.length) {
if (res.data.length > 0) {
let isTipShow = getStorageSync(
"first_instrument_" + instrumentDetail.id
);
if (!isTipShow) {
// 首次进入页面:自动打开打卡介绍弹窗
this.setState({ nurseInfo: res.data.data, isTipShow: true });
// 已打开初次护理
setStorageSync(
"first_instrument_" + this.state.instrumentDetail.id,
true
);
} else {
this.setState({ nurseInfo: res.data.data });
}
@ -276,10 +281,6 @@ export default class InstrumentClickInUpload extends Component<any, any> {
}
};
onTipShowClose = async () => {
setStorageSync(
"first_instrument_" + this.state.instrumentDetail.id,
"true"
);
this.setState({ isTipShow: false });
};

@ -42,7 +42,7 @@ import ModeContent from "./components/ModeContent/index";
import Footer from "./components/Footer";
/* 本页组件 END */
import { go, getStorageSync, setStorageSync } from "@/utils/traoAPI";
import { go, getStorageSync, setStorageSync, msg } from "@/utils/traoAPI";
import { InstrumentInfo } from "@/utils/Interface";
import "./iotCarePlan.less";
@ -149,7 +149,6 @@ class IotCarePlan extends Component<any, any> {
showVideoPlayBtn: true, // 视频播放按钮
duration: 0, // 视频总时长
hadShowBreakTips: false, // 是否展示过支架断开提示
popupType: "", // enoughTimePopup: 时间达标提示, endPopup: 结束弹窗
isConnectShow: false, // 是否弹出连蓝牙弹窗:在蓝牙断开时弹出
/** 连接设备 End */
@ -417,8 +416,9 @@ class IotCarePlan extends Component<any, any> {
// 护理检查改变模式,是否提示切换护理模式
// isNotCheck为真时不进行校验直接切换
this.tempModeCurrent = data;
this.footerIsDisabled();
// 如果按钮不可点击则报错,内部自带检查底部按钮函数
this.onEmitErrorTips();
if (!isNotCheck) {
let isReturn = this.modeRuningChange();
if (isReturn) return;
@ -566,12 +566,16 @@ class IotCarePlan extends Component<any, any> {
onEmitErrorTips = async () => {
let { ActiveModeItem } = this.state;
if (ActiveModeItem.isCabinMode === 0) {
this.showTips("检测到面罩与舱体仍在连接中,该模式需要分离面罩和舱体");
} else {
this.showTips(
"检测到面罩与舱体未连接成功,请确认面罩是否和舱体连接并接通舱体电源"
);
// 按钮不可点击时,提示报错
let isDisabled = this.footerIsDisabled();
if (isDisabled) {
if (ActiveModeItem.isCabinMode === 0) {
this.showTips("检测到面罩与舱体仍在连接中,该模式需要分离面罩和舱体");
} else {
this.showTips(
"检测到面罩与舱体未连接成功,请确认面罩是否和舱体连接并接通舱体电源"
);
}
}
};
@ -601,10 +605,12 @@ class IotCarePlan extends Component<any, any> {
let isFirstEntryModeNot = getStorageSync(
"isFirstEntryMode_" + this.state.currentDevice.id
);
console.log("isFirstEntryModeNot", isFirstEntryModeNot);
// 如果没有持久化不再提示,每次进入都会弹窗提示
// 1.如果没有持久化不再提示,每次进入都会弹窗提示
if (!isFirstEntryModeNot) {
this.setState({ isShowStepTips: true });
// 2.必须要有数据才弹窗
if (this.state.ActiveModeItem.openSourceData) {
this.setState({ isShowStepTips: true });
}
}
};
closeStepTips = (data) => {
@ -1870,9 +1876,6 @@ class IotCarePlan extends Component<any, any> {
}
}
console.log("isStandStatus", isStandStatus);
console.log("isFooterBtnDisabled", isFooterBtnDisabled);
console.log("isCanClick", isCanClick);
this.setState({
isFooterBtnDisabled: isFooterBtnDisabled,
});

Loading…
Cancel
Save