fix:bug修复

master
blak-kong 2 years ago
parent 0459a45ab4
commit 0e2d775ebe

@ -0,0 +1,53 @@
import Taro from "@tarojs/taro";
import { Component, PropsWithChildren } from "react";
import "./app.less";
// // html4
// import "@tarojs/taro/html.css";
// // html5
// import "@tarojs/taro/html5.css";
import { Provider } from "react-redux";
import store from "./store";
import "./iconfont/iconfont.css";
import "taro-ui/rn/style/components/icon.scss";
import { go } from "./utils/traoAPI";
class App extends Component {
// 可以使用所有的 React 生命周期方法
componentDidMount() {}
// 对应 onLaunch
onLaunch(options) {
// console.log("onLaunch", options);
if (options.scene == 1007 || options.scene == 1008) {
return;
}
// go("/pages/iotCarePlan/iotCarePlan");
// go("/pages/instrument_clickin_upload/index");
// go("/pages/instrument/intro");
// Taro.switchTab({
// url: "/pages/user/user",
// });
go("/pages/index/index");
}
onError(error) {
console.log("error 错误捕获", error);
}
// 对应 onShow
componentDidShow() {}
// 对应 onHide
componentDidHide() {}
// this.props.children 是将要会渲染的页面
render() {
// return this.props.children
return <Provider store={store} children={this.props.children}></Provider>;
}
}
export default App;

@ -952,7 +952,7 @@ class ConnectionBluetoot extends Component<any, any> {
// 超时未返回版本号 // 超时未返回版本号
if (isGetVersionTimer) clearTimeout(isGetVersionTimer); if (isGetVersionTimer) clearTimeout(isGetVersionTimer);
console.log("超时未返回版本号 this.pairingChange", this.state); console.log("超时未返回版本号 this.pairingChange", this.state);
// this.pairingChange(this.state); this.pairingChange(this.state);
} else { } else {
this.sendGetVersion(); this.sendGetVersion();
} }
@ -1022,7 +1022,7 @@ class ConnectionBluetoot extends Component<any, any> {
}; };
render() { render() {
let { name, isConnection, connectionSuccess, error } = this.state; let { isConnection, connectionSuccess, error } = this.state;
let { deviceInfo, isDisconnect } = this.props; let { deviceInfo, isDisconnect } = this.props;
return ( return (
<Block> <Block>
@ -1037,7 +1037,6 @@ class ConnectionBluetoot extends Component<any, any> {
error={error} error={error}
title="面罩模式启动中" title="面罩模式启动中"
/> />
<View>{name}</View>
</Block> </Block>
); );
} }

@ -36,7 +36,12 @@ export default class Navbar extends Component<any, any> {
} }
back = () => { back = () => {
//判断是否自定义跳转
if (!this.props.isCustomBack) {
back(); back();
} else {
this.props.customBack();
}
}; };
setStatusBar() { setStatusBar() {
@ -44,7 +49,8 @@ export default class Navbar extends Component<any, any> {
success: (res) => { success: (res) => {
const statusBarHeight = res.statusBarHeight || 0; const statusBarHeight = res.statusBarHeight || 0;
// 获取微信胶囊的位置信息 width,height,top,right,left,bottom // 获取微信胶囊的位置信息 width,height,top,right,left,bottom
const custom = Taro.getMenuButtonBoundingClientRect(); // const custom = Taro.getMenuButtonBoundingClientRect();
const custom = { height: 60, top: 20 };
// 导航栏高度(标题栏高度) = 胶囊高度 + (顶部距离 - 状态栏高度) * 2 // 导航栏高度(标题栏高度) = 胶囊高度 + (顶部距离 - 状态栏高度) * 2
const navigationBarHeight = const navigationBarHeight =
custom.height + (custom.top - statusBarHeight) * 2; custom.height + (custom.top - statusBarHeight) * 2;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 80 KiB

After

Width:  |  Height:  |  Size: 22 KiB

@ -97,6 +97,10 @@ export default class Index extends Component<any, any> {
async initData() {} async initData() {}
GoIndex = () => {
Taro.switchTab({ url: "/pages/index/index" });
};
render() { render() {
let { name, statistics, recordList, recordData } = this.state; let { name, statistics, recordList, recordData } = this.state;
return ( return (
@ -221,7 +225,7 @@ export default class Index extends Component<any, any> {
<View className="footer flex aitems"> <View className="footer flex aitems">
<View className="btn"></View> <View className="btn"></View>
<View className="text flex aitems"> <View className="text flex aitems">
<View></View> <View onClick={this.GoIndex}></View>
<Image <Image
src={require("../../img/right.png")} src={require("../../img/right.png")}
mode="aspectFill" mode="aspectFill"

@ -60,7 +60,7 @@ import commandMap from "@/utils/commandMap";
import InstrumentTypeEnum from "@/components/bluetoot/InstrumentTypeEnum"; import InstrumentTypeEnum from "@/components/bluetoot/InstrumentTypeEnum";
import OtaDeviceTypeEnum from "@/components/bluetoot/OtaDeviceTypeEnum"; import OtaDeviceTypeEnum from "@/components/bluetoot/OtaDeviceTypeEnum";
const log = require("@/utils/log"); // const log = require("@/utils/log");
class Index extends Component<any, any> { class Index extends Component<any, any> {
// pageCtx = Taro.getCurrentInstance().page; // pageCtx = Taro.getCurrentInstance().page;
@ -447,8 +447,6 @@ class Index extends Component<any, any> {
} }
} }
closeBinding = () => { closeBinding = () => {
Taro.removeStorageSync("isScan"); // 扫码弹窗显示完后,不需要再判断是否扫码
Taro.removeStorageSync("serial"); // 扫码弹窗显示完后,删除缓存的扫码序列号
this.setState({ isVisibleBinding: false }); this.setState({ isVisibleBinding: false });
}; };
confirmBinding = () => { confirmBinding = () => {
@ -500,6 +498,9 @@ class Index extends Component<any, any> {
// 获取失败和绑定失败一个弹窗 // 获取失败和绑定失败一个弹窗
this.setState({ isBindingError: true }); this.setState({ isBindingError: true });
} }
Taro.removeStorageSync("isScan"); // 扫码弹窗显示完后,不需要再判断是否扫码
Taro.removeStorageSync("serial"); // 扫码弹窗显示完后,删除缓存的扫码序列号
} }
}; };
@ -564,16 +565,12 @@ class Index extends Component<any, any> {
console.log("exchangeBinding", data); console.log("exchangeBinding", data);
Taro.hideLoading(); Taro.hideLoading();
this.closeBinding(); this.closeBinding();
if (data.code === 200) { if (data.code !== 200) {
} else { //todo
this.closeBinding();
this.setState({ isBindingError: true });
} }
}; };
// 仪器绑定失败弹窗 // 仪器绑定失败弹窗
onBindErrorClose = () => { onBindErrorClose = () => {
Taro.removeStorageSync("isScan"); // 扫码弹窗显示完后,不需要再判断是否扫码
Taro.removeStorageSync("serial"); // 扫码弹窗显示完后,删除缓存的扫码序列号
this.setState({ isBindingError: false }); this.setState({ isBindingError: false });
}; };
onBindErrorConfirm = () => { onBindErrorConfirm = () => {
@ -581,8 +578,6 @@ class Index extends Component<any, any> {
go("/pages/consultant/consultant"); go("/pages/consultant/consultant");
}; };
onBeforeBindClose = () => { onBeforeBindClose = () => {
Taro.removeStorageSync("isScan"); // 扫码弹窗显示完后,不需要再判断是否扫码
Taro.removeStorageSync("serial"); // 扫码弹窗显示完后,删除缓存的扫码序列号
this.setState({ isBeforeBinding: false }); this.setState({ isBeforeBinding: false });
}; };
onBeforeBindConfirm = () => { onBeforeBindConfirm = () => {
@ -714,6 +709,7 @@ class Index extends Component<any, any> {
); );
this.setState({ this.setState({
isShowVersionUpgrading: false, isShowVersionUpgrading: false,
isShowVersionUpgradFinish: true, // 升级介绍
versionUpgradFinishNodes: nodes, versionUpgradFinishNodes: nodes,
}); });
}; };
@ -887,7 +883,7 @@ class Index extends Component<any, any> {
upgradeFun={this.upgradeFun} upgradeFun={this.upgradeFun}
/> />
)} )}
<PopupConfirm <PopupAlert
isLarge isLarge
isClose isClose
isShow={isShowUpdateVersionTip} isShow={isShowUpdateVersionTip}
@ -899,7 +895,6 @@ class Index extends Component<any, any> {
</Block> </Block>
} }
textAlgin="center" textAlgin="center"
cancelButtonText="取消"
confirmButtonText="确定" confirmButtonText="确定"
close={this.cancelUpdateVersionTip} close={this.cancelUpdateVersionTip}
confirm={this.confirmUpdateVersionTip} confirm={this.confirmUpdateVersionTip}
@ -1081,3 +1076,4 @@ const mapDispatchToProps = (dispatch) => ({
}, },
}); });
export default connect(mapStateToProps, mapDispatchToProps)(Index); export default connect(mapStateToProps, mapDispatchToProps)(Index);
// instrumentId

@ -18,7 +18,7 @@ import {
} from "@tarojs/components"; } from "@tarojs/components";
import { InstrumentInfo } from "@/utils/Interface"; import { InstrumentInfo } from "@/utils/Interface";
import { go, back, msg, setStorageSync, getStorageSync } from "@/utils/traoAPI"; import { go, msg, setStorageSync, getStorageSync } from "@/utils/traoAPI";
import { getImgInfo, contraction } from "@/utils/compressImage"; import { getImgInfo, contraction } from "@/utils/compressImage";
@ -63,15 +63,27 @@ export default class Instrument extends Component<any, any> {
fromUrl: "", fromUrl: "",
}; };
} }
$instance = Taro.getCurrentInstance();
isOnly: boolean = false;
currentDevice: any = null;
id: any = "";
async onLoad() { async onLoad() {}
this.unbindingInstrumentInfoList();
}
componentDidMount() {} componentDidMount() {}
componentWillUnmount() {} componentWillUnmount() {}
componentDidShow() {} componentDidShow() {
let params: any = this.$instance.router?.params;
if (params?.isOnly && params?.id) {
if (params?.isOnly === "true") {
this.isOnly = true;
this.id = params?.id;
}
}
console.log("params", params);
this.unbindingInstrumentInfoList();
}
componentDidHide() {} componentDidHide() {}
@ -85,18 +97,6 @@ export default class Instrument extends Component<any, any> {
this.setState({ channelInfo }); this.setState({ channelInfo });
}; };
// onScanCode() {
// Taro.scanCode({
// scanType: ["qrCode"],
// success: (res) => {
// let { channelInfo } = this.state;
// channelInfo.serialCode = res.result;
// this.setState({ channelInfo });
// },
// });
// }
onTipShow = () => { onTipShow = () => {
this.setState({ tipShow: true }); this.setState({ tipShow: true });
}; };
@ -140,88 +140,6 @@ export default class Instrument extends Component<any, any> {
}); });
}; };
// getBindCodeInfo = async () => {
// const { bindCode, instrumentList, channelInfo } = this.state;
// // // 1.查询资料
// // try {
// // const { data } = await InstrumentCodeCheck({
// // code: bindCode,
// // });
// // const bindCodeInfo = { ...data.data.bindCodeInfo };
// // // 2.判断是否是选中的仪器, 如果不是, 直接弹出scanErrorPopup
// // if (channelInfo.id != bindCodeInfo.instrument_id) {
// // this.setState({
// // bindPopup: "scanErrorPopup",
// // });
// // return;
// // }
// // const match = instrumentList.find((item) => {
// // if (item.id == bindCodeInfo.instrument_id && item.serial) {
// // // 找到同一个仪器
// // bindCodeInfo.hadBindSame = true;
// // if (item.serial == bindCodeInfo.antifakeCode) {
// // // 找到同一个序列号
// // bindCodeInfo.hadBindSameCode = true;
// // } else {
// // bindCodeInfo.hadBindSameCode = false;
// // }
// // return item;
// // }
// // if (item.id == bindCodeInfo.instrument_id) {
// // const { channelInfo } = this.state;
// // if (channelInfo.id === item.id) return;
// // this.setState({
// // channelInfo: item,
// // isVideo: isVideo(item.bind_intro_video),
// // });
// // }
// // });
// // if (match) {
// // bindCodeInfo.hadBind = true;
// // } else {
// // bindCodeInfo.hadBindSame = false;
// // }
// // this.setState({
// // bindCodeInfo,
// // });
// // this.judgeBindCode();
// // } catch (e) {
// // this.judgeBindCode();
// // }
// };
// judgeBindCode = () => {
// const { bindCode, bindCodeInfo } = this.state;
// const opts: any = {};
// if (bindCode && !bindCodeInfo) {
// // 有仪器码, 但是没有找到信息时
// opts.bindPopup = "noFoundPopup";
// } else if (bindCode && bindCodeInfo && bindCodeInfo.isLabelCode) {
// opts.bindPopup = "labelPopup";
// } else if (
// bindCode &&
// bindCodeInfo.hadBindSame &&
// bindCodeInfo.hadBindSameCode
// ) {
// // 有仪器码, 如果有登录, 判断是绑定了同样的仪器和仪器的序列号是一致 -- 不弹弹窗, 回到首页
// opts.bindCode = ""; // 重置bindCode
// opts.bindPopup = ""; // 隐藏bindPopup
// } else if (
// bindCode &&
// bindCodeInfo.hadBindSame &&
// !bindCodeInfo.hadBindSameCode
// ) {
// // 有仪器码, 如果有登录, 判断是绑定了同样的仪器, 但仪器的序列号不一致 -- 判断换绑
// opts.bindPopup = "switchBindCodePopup";
// } else if (bindCode && !bindCodeInfo.hadBindSame) {
// // 有仪器码, 如果有登录, 判断不是绑定了同样的仪器 -- 绑定
// opts.bindPopup = "toBindPopup";
// }
// if (Object.keys(opts).length) {
// this.setState(opts);
// }
// };
onCustomerTap = () => { onCustomerTap = () => {
this.onCancelBind2Tap(); this.onCancelBind2Tap();
go("/pages/consultant/consultant"); go("/pages/consultant/consultant");
@ -271,10 +189,6 @@ export default class Instrument extends Component<any, any> {
}); });
} }
public back = () => {
back();
};
closeDev = () => { closeDev = () => {
// go("/pages/user/user"); // go("/pages/user/user");
let isInstrumentJump = Taro.getStorageSync("isInstrumentJump"); let isInstrumentJump = Taro.getStorageSync("isInstrumentJump");
@ -297,6 +211,7 @@ export default class Instrument extends Component<any, any> {
let { data } = await InstrumentInfo.unbindingInstrumentInfoList(); let { data } = await InstrumentInfo.unbindingInstrumentInfoList();
if (data.code === 200) { if (data.code === 200) {
if (data.data.length) { if (data.data.length) {
if (!this.isOnly) {
let item = data.data[0]; let item = data.data[0];
item.serialCode = ""; item.serialCode = "";
this.setState({ this.setState({
@ -304,6 +219,15 @@ export default class Instrument extends Component<any, any> {
channelInfo: item, channelInfo: item,
isVideo: this.isVideo(item.banner), isVideo: this.isVideo(item.banner),
}); });
} else {
let item = data.data.find((item) => String(item.id) === this.id);
item.serialCode = "";
this.setState({
equipmentList: [item],
channelInfo: item,
isVideo: this.isVideo(item.banner),
});
}
} }
} }
}; };
@ -385,6 +309,10 @@ export default class Instrument extends Component<any, any> {
this.setState({ isBindingCheckError: false }); this.setState({ isBindingCheckError: false });
}; };
customBack = () => {
Taro.switchTab({ url: "/pages/index/index" });
};
render() { render() {
let { let {
isBindingError, isBindingError,
@ -406,7 +334,12 @@ export default class Instrument extends Component<any, any> {
close={this.closeDev} close={this.closeDev}
confirm={this.closeDev} confirm={this.closeDev}
/> */} /> */}
<Navbar titleSlot="仪器绑定" isBack={true} /> <Navbar
titleSlot="仪器绑定"
isBack
isCustomBack
customBack={this.customBack}
/>
<PopupAlert <PopupAlert
isShow={isBindingError} isShow={isBindingError}
title="提示" title="提示"

@ -41,7 +41,7 @@ class Intro extends Component<any, any> {
// this.getInstrumentInfo(params.id); // this.getInstrumentInfo(params.id);
// } // }
let strObj = getStorageSync("instrument_item"); let strObj = getStorageSync("instrument_detail");
if (strObj) { if (strObj) {
let instrument = JSON.parse(strObj); let instrument = JSON.parse(strObj);
this.getInstrumentInfo(instrument.id); this.getInstrumentInfo(instrument.id);

@ -127,7 +127,7 @@ export default class InstrumentClickInUpload extends Component<any, any> {
// 获取仪器模式列表 // 获取仪器模式列表
modeInfoList = async (id) => { modeInfoList = async (id) => {
let res = await InstrumentInfo.modeInfoList({ let res = await InstrumentInfo.modeInfoList({
instrumentId: "84", instrumentId: id,
}); });
if (res.data.code === 200) { if (res.data.code === 200) {
if (res.data.data.length) { if (res.data.data.length) {

@ -93,7 +93,7 @@ export default class InstrumentManage extends Component<any, any> {
} }
goBind(item) { goBind(item) {
let bindid = item.id; let bindid = item.id;
go("/pages/instrument/instrument?id=" + bindid); go("/pages/instrument/instrument?isOnly=true&id=" + bindid); // 只显示当前仪器内容
} }
goBindInfo(item) { goBindInfo(item) {
@ -127,10 +127,11 @@ export default class InstrumentManage extends Component<any, any> {
<Block> <Block>
<Navbar titleSlot="设备管理" background="#fff" isBack={true} /> <Navbar titleSlot="设备管理" background="#fff" isBack={true} />
<View className="instrument_box"> <View className="instrument_box">
{bindList.length > 0 && {bindList.length > 0 && (
<Block> <Block>
<View className="title"></View> <View className="title"></View>
<View className="scroll"> <View className="scroll">
{bindList.length > 0 && (
<Swiper <Swiper
className="bind_list" className="bind_list"
current={current} current={current}
@ -179,48 +180,10 @@ export default class InstrumentManage extends Component<any, any> {
); );
})} })}
</Swiper> </Swiper>
{/* <ScrollView scroll-x="true" className="bind_list"> )}
{bindList.map((item, index) => {
if (item.status === 0) {
return (
<View className="wrapper" key={"bind_" + index}>
<View className="cover" onClick={this.goIntro}>
<Image
className="Image"
src={item.banner}
mode="aspectFill"
></Image>
<View className="bind_status"></View>
<View className="intro">
<View className="tips" onClick={this.goIntro}>
</View>
<View className="right">
<Image
src={require("../../img/index/right.png")}
mode="widthFix"
style="height: 20rpx;"
/>
</View>
</View>
</View>
<View className="bind_cont">
<View className="title">{item.name}</View>
<View
className="bindinfo"
onClick={this.goBindInfo.bind(this, item)}
>
</View>
</View>
</View>
);
}
})}
</ScrollView> */}
</View> </View>
</Block> </Block>
} )}
<View className="title"></View> <View className="title"></View>
<View className="scroll"> <View className="scroll">
<ScrollView scroll-x="true" className="un_bind_list"> <ScrollView scroll-x="true" className="un_bind_list">

@ -91,15 +91,7 @@ function Index({
<View className="v2 battery_icon"></View> <View className="v2 battery_icon"></View>
</Block> </Block>
)} )}
{Electricity === 1 && ( {Electricity <= 1 && (
<Block>
<View className="v1 battery_icon"></View>
<View className="v2 battery_icon"></View>
<View className="v2 battery_icon"></View>
<View className="v2 battery_icon"></View>
</Block>
)}
{Electricity === 0 && (
<Block> <Block>
<View className="v3 battery_icon"></View> <View className="v3 battery_icon"></View>
<View className="v2 battery_icon"></View> <View className="v2 battery_icon"></View>

@ -380,9 +380,7 @@ class IotCarePlan extends Component<any, any> {
let { isStandStatus, isShowNurse } = this.state; let { isStandStatus, isShowNurse } = this.state;
// 舱体模式无法对应的时候,置灰开始按钮 // 舱体模式无法对应的时候,置灰开始按钮
let isCabinMode = isStandStatus let isCabinMode = data.isCabinMode === 1;
? data.isCabinMode === 1
: data.isCabinMode === 0;
if (isStandStatus === isCabinMode) { if (isStandStatus === isCabinMode) {
this.setState({ isCanClick: true }); // 是否舱体一致时,可以点击 this.setState({ isCanClick: true }); // 是否舱体一致时,可以点击
} else { } else {
@ -425,7 +423,7 @@ class IotCarePlan extends Component<any, any> {
this.onStartNurse(); this.onStartNurse();
setTimeout(() => { setTimeout(() => {
this.onNursingTap(); this.onNursingTap();
}, 500); }, 1000);
} }
}; };
/** 设备运行中切换模式 */ /** 设备运行中切换模式 */
@ -544,10 +542,8 @@ class IotCarePlan extends Component<any, any> {
// } // }
let { isStandStatus, ActiveModeItem } = this.state; let { isStandStatus, ActiveModeItem } = this.state;
let isCabinMode = isStandStatus let isCabinMode = ActiveModeItem.isCabinMode === 1;
? ActiveModeItem.isCabinMode === 1 if (isStandStatus === isCabinMode) {
: ActiveModeItem.isCabinMode === 0;
if (isStandStatus && isCabinMode) {
this.stepNext(); this.stepNext();
return; return;
} }
@ -613,12 +609,13 @@ class IotCarePlan extends Component<any, any> {
if (jsonStatus.connectMessage?.connectType == "CONNECTED") { if (jsonStatus.connectMessage?.connectType == "CONNECTED") {
this.setState({ this.setState({
isStandStatus: true, isStandStatus: true,
isCanClick: this.state.isCabinMode === 1, isCanClick: this.state.ActiveModeItem?.isCabinMode === 1,
}); });
} else { } else {
console.log("舱体支架断开连接");
this.setState({ this.setState({
isStandStatus: false, isStandStatus: false,
isCanClick: this.state.isCabinMode !== 1, isCanClick: this.state.ActiveModeItem?.isCabinMode !== 1,
}); });
} }
break; break;
@ -637,8 +634,8 @@ class IotCarePlan extends Component<any, any> {
this.setState({ this.setState({
isStandStatus: isStandDevice, isStandStatus: isStandDevice,
isCanClick: isStandDevice isCanClick: isStandDevice
? this.state.isCabinMode === 1 ? this.state.ActiveModeItem?.isCabinMode === 1
: this.state.isCabinMode !== 1, : this.state.ActiveModeItem?.isCabinMode !== 1,
}); });
// 连上面罩后, 获取仪器记录, 与缓存信息对比 // 连上面罩后, 获取仪器记录, 与缓存信息对比
@ -1048,8 +1045,6 @@ class IotCarePlan extends Component<any, any> {
let totalSeconds = minSecToS(ActiveModeItem.modeTimeStr); let totalSeconds = minSecToS(ActiveModeItem.modeTimeStr);
let currentSeconds = minSecToS(currentTime); let currentSeconds = minSecToS(currentTime);
let checkTime = totalSeconds - currentSeconds; let checkTime = totalSeconds - currentSeconds;
console.log("设备已运行多少秒", checkTime);
console.log("ModeStepTimeArray", ModeStepTimeArray);
this.elapsedTime = checkTime; this.elapsedTime = checkTime;
if (currentSeconds >= 1) { if (currentSeconds >= 1) {
// 小程序显示倒计时 // 小程序显示倒计时
@ -1062,8 +1057,8 @@ class IotCarePlan extends Component<any, any> {
// 模式多个步骤节点切换 // 模式多个步骤节点切换
// 已运行时间达到下一节点时,切换 // 已运行时间达到下一节点时,切换
if (checkTime > ModeStepTimeArray[ModeStepIndex]) { if (checkTime > ModeStepTimeArray[ModeStepIndex]) {
// 已运行时间达到下一节点,步骤切换时更新 // 已运行时间达到下一节点,且存在下一节点,步骤切换时更新
if (ModeStepIndex < length) { if (ModeStepIndex < length - 1) {
let index = ModeStepIndex + 1; // 提前步骤+1 let index = ModeStepIndex + 1; // 提前步骤+1
let currentServiceData = { let currentServiceData = {
startSource: "", startSource: "",
@ -1123,20 +1118,12 @@ class IotCarePlan extends Component<any, any> {
} }
} }
// // 工作状态,开始组合模式
// if (
// this.state.ActiveModeItem.combineData.length &&
// this.workStatus == MODE_WORKING_ENUM.WORKING
// ) {
// this.startCombinationMode();
// }
const sendParams = { const sendParams = {
...deviceCommandSamples.pause, ...deviceCommandSamples.pause,
workMode: ActiveModeItem.modeType, // 使用模式 workMode: ActiveModeItem.modeType, // 使用模式
workStatus: newWorkStatus, workStatus: newWorkStatus,
}; };
console.log("准备发送自定义指令", ActiveModeItem, sendParams); console.log("准备发送自定义或工作指令", ActiveModeItem, sendParams);
const pauseArrayBuffer = deviceToolKitInstance.toBleCommand( const pauseArrayBuffer = deviceToolKitInstance.toBleCommand(
sendParams as any sendParams as any
); );
@ -1188,11 +1175,6 @@ class IotCarePlan extends Component<any, any> {
); );
console.log(ActiveModeItem); console.log(ActiveModeItem);
console.log("isStandStatus:" + isStandStatus); console.log("isStandStatus:" + isStandStatus);
console.log(
this.workStatus !== MODE_WORKING_ENUM.WORKING &&
this.workStatus !== MODE_WORKING_ENUM.STANDBY &&
this.workStatus !== MODE_WORKING_ENUM.PAUSE
);
if (facialMaskConnectStatus != 1) { if (facialMaskConnectStatus != 1) {
console.log("facialMaskConnectStatus 开始处", facialMaskConnectStatus); console.log("facialMaskConnectStatus 开始处", facialMaskConnectStatus);
@ -1222,7 +1204,11 @@ class IotCarePlan extends Component<any, any> {
this.showCountdownFun(downNum, () => {}); // 倒计时弹窗 this.showCountdownFun(downNum, () => {}); // 倒计时弹窗
// 开始执行护理 // 开始执行护理
this.workStatus = MODE_WORKING_ENUM.WORKING; // 不管当前什么状态,直接设为工作状态
this.handleWorkStatus(true, MODE_WORKING_ENUM.WORKING); this.handleWorkStatus(true, MODE_WORKING_ENUM.WORKING);
this.setState({
isStopNurse: false,
});
} }
// 结束护理 // 结束护理
@ -1472,16 +1458,16 @@ class IotCarePlan extends Component<any, any> {
console.log("PostNursingLogClock", res); console.log("PostNursingLogClock", res);
if (res.data.code === 200) { if (res.data.code === 200) {
if (!isJump) { if (isJump) {
this.setState({ this.setState({
isShowNursingSuccess: true, isShowNursingSuccess: true,
}); });
}
if (isJump) {
setTimeout(() => { setTimeout(() => {
this.setState({
isShowNursingSuccess: false,
});
this.goFaceReport(); this.goFaceReport();
}, 1000); }, 2000);
} }
} }
}; };
@ -1674,6 +1660,8 @@ class IotCarePlan extends Component<any, any> {
/** 完成护理提交:跳转护理报告页 */ /** 完成护理提交:跳转护理报告页 */
goFaceReport = () => { goFaceReport = () => {
// 跳转前置空定时器,防止重复提交
if (currentTimeTimer) clearInterval(currentTimeTimer);
go("/pages/face_report/face_report?id=" + this.state.currentDevice.id); go("/pages/face_report/face_report?id=" + this.state.currentDevice.id);
}; };
@ -1960,3 +1948,5 @@ const mapDispatchToProps = (dispatch) => ({
// }, // },
}); });
export default connect(mapStateToProps, mapDispatchToProps)(IotCarePlan); export default connect(mapStateToProps, mapDispatchToProps)(IotCarePlan);
// isCharging

@ -77,10 +77,13 @@ page {
.infobox1 .info2 { .infobox1 .info2 {
border-radius: 20rpx; border-radius: 20rpx;
height: 200rpx; height: 200rpx;
margin: 40rpx 28rpx 0; display: flex;
justify-content: space-between;
margin: 40rpx 28rpx 0 28rpx;
} }
.infobox1 .info3 { .infobox1 .info3 {
margin: 22rpx 30rpx 0; margin: 0 30rpx;
margin-top: 22rpx;
font-size: 24rpx; font-size: 24rpx;
font-weight: 400; font-weight: 400;
color: #999999; color: #999999;
@ -98,8 +101,10 @@ page {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: space-between; justify-content: space-between;
align-items: flex-start;
padding: 36rpx 0 26rpx 36rpx; padding: 36rpx 0 26rpx 36rpx;
box-sizing: border-box; box-sizing: border-box;
margin-top: 0;
} }
.infobox1 .info2 .block .bg_img { .infobox1 .info2 .block .bg_img {
@ -166,6 +171,7 @@ page {
width: 25%; width: 25%;
flex-direction: column; flex-direction: column;
position: relative; position: relative;
margin-top: 0;
.img image { .img image {
width: 40rpx; width: 40rpx;
height: 40rpx; height: 40rpx;

@ -267,12 +267,12 @@ class User extends Component<any, any> {
)} )}
</View> </View>
</View> </View>
<View className="info2 flex aitems sa"> <View className="info2">
<View <View
style="margin-top:0"
className="block" className="block"
data-url="/pages/instrument_manage/index?isback=1" data-url="/pages/instrument_manage/index?isback=1"
onClick={this.goUrlNoRegister} onClick={this.goUrlNoRegister}
// onClick={this.devOpen}
> >
<Image <Image
className="bg_img" className="bg_img"
@ -289,6 +289,7 @@ class User extends Component<any, any> {
<View className="txt"></View> <View className="txt"></View>
</View> </View>
<View <View
style="margin-top:0"
className="block" className="block"
onClick={this.goUrlNoRegister} onClick={this.goUrlNoRegister}
data-url="/pages/integral_list/integral_list" data-url="/pages/integral_list/integral_list"
@ -308,10 +309,52 @@ class User extends Component<any, any> {
</View> </View>
</View> </View>
<View className="num">{userInfo.credit}</View> <View className="num">{userInfo.credit}</View>
{/* <View className="txt"></View> */}
<View className="txt"></View> <View className="txt"></View>
</View> </View>
</View> </View>
{/* <View className="info2 flex aitems sa">
<View
className="block"
data-url="/pages/instrument_manage/index?isback=1"
onClick={this.goUrlNoRegister}
>
<Image
className="bg_img"
src={require("../../img/device_bg.png")}
mode="aspectFill"
></Image>
<View className="tip flex aitems">
<View className="tip1"></View>
<View className="right">
<Image src="/img/my_right.png" mode="aspectFill" />
</View>
</View>
<View className="num">{userInfo.devicesNum}</View>
<View className="txt"></View>
</View>
<View
className="block"
onClick={this.goUrlNoRegister}
data-url="/pages/integral_list/integral_list"
>
<Image
className="bg_img"
src={require("../../img/point_bg.png")}
mode="aspectFill"
></Image>
<View className="tip flex aitems">
<View className="tip1"></View>
<View className="right">
<Image
src={require("../../img/my_right.png")}
mode="aspectFill"
/>
</View>
</View>
<View className="num">{userInfo.credit}</View>
<View className="txt"></View>
</View>
</View> */}
<View className="info3"> <View className="info3">
{lastDay} : {userInfo.expireCredit} {lastDay} : {userInfo.expireCredit}
</View> </View>
@ -358,7 +401,7 @@ class User extends Component<any, any> {
<View className="tip1"></View> <View className="tip1"></View>
</View> </View>
</View> </View>
<View className="title2"></View> <View className="title2"></View>
<View className="info flex aitems"> <View className="info flex aitems">
<View <View
className="block flex aitems" className="block flex aitems"
@ -389,6 +432,7 @@ class User extends Component<any, any> {
</View> </View>
<View className="tip1"></View> <View className="tip1"></View>
</View> </View>
<View className="block flex aitems">{/* 样式留空 */}</View>
{/* <View {/* <View
className="block flex aitems" className="block flex aitems"
data-url="/pages/privacyPolicy/privacyPolicy" data-url="/pages/privacyPolicy/privacyPolicy"

@ -1,7 +1,8 @@
import Taro from "@tarojs/taro"; import Taro from "@tarojs/taro";
// var logger = Taro.getRealtimeLogManager ? Taro.getRealtimeLogManager() : null; // var logger = Taro.getRealtimeLogManager ? Taro.getRealtimeLogManager() : null;
var logger = Taro.getRealtimeLogManager(); // var logger = Taro.getRealtimeLogManager();
var logger = console;
const log = { const log = {
debug() { debug() {

Loading…
Cancel
Save