blak-kong 2 years ago
parent 62901485e0
commit a4d2d7a438

@ -1,3 +1,4 @@
export default definePageConfig({
navigationBarTitleText: "设备管理",
enablePageMeta: true,
});

@ -12,6 +12,7 @@ import {
ScrollView,
Swiper,
SwiperItem,
PageMeta,
} from "@tarojs/components";
import "./index.less";
@ -132,6 +133,7 @@ export default class InstrumentManage extends Component<any, any> {
let { bindList, unBindList, current } = this.state;
return (
<Block>
{/* <PageMeta pageOrientation="landscape"></PageMeta> */}
<Navbar
titleSlot="设备管理"
background="#fff"

@ -48,3 +48,7 @@
.show {
display: none;
}
.echart-rotate {
transform: rotate(90deg);
}

@ -20,10 +20,10 @@ import {
Video,
Input,
Button,
PageMeta
PageMeta,
} from "@tarojs/components";
import { sendCommand } from "@/utils/bluetoothWXAPI";
import { sendCommand, closeBLEConnection } from "@/utils/bluetoothWXAPI";
import {
deviceCommandSamples,
bleCommandSamples,
@ -100,7 +100,7 @@ class IotCarePlanFR200 extends Component<any, any> {
super(props);
this.state = {
textshow: false,
textscreen: 'portrait',
textscreen: "portrait",
name: "FR200",
title: "FR200", // 页面标题
// 当前设备
@ -185,7 +185,6 @@ class IotCarePlanFR200 extends Component<any, any> {
ActiveModeItem: {
modeType: "",
openSourceData: [],
modeType: ""
}, // 当前选中模式
SwitchActiveModeItem: {
modeType: "",
@ -346,7 +345,7 @@ class IotCarePlanFR200 extends Component<any, any> {
};
}
bluetoothContainer: any = null;
isFullScreen: boolean = false;
isFullScreen: boolean = true;
// 不涉及渲染的页面变量
isRuning: any = true; // 设备默认运行中fr200贴脸就会自动开始工作
jsonStatus: any = {}; // 同步设备返回数据,用于结束
@ -391,6 +390,7 @@ class IotCarePlanFR200 extends Component<any, any> {
];
async onLoad(option) {
// await closeBLEConnection(this.props.bluetoothInfo.deviceId);
console.log(option, "跳转过来的数据");
if (option.modeId) {
this.setState({ activeModeID: option.modeId });
@ -403,9 +403,9 @@ class IotCarePlanFR200 extends Component<any, any> {
this.getInstrumentClockSummary();
this.getInstrumentClockDetail();
}
componentDidMount() { }
componentDidMount() {}
componentWillUnmount() { }
componentWillUnmount() {}
componentDidShow() {
console.log("页面显示了");
@ -428,11 +428,6 @@ class IotCarePlanFR200 extends Component<any, any> {
}
async initData() {
Taro.closeBluetoothAdapter({
complete: () => {
// this.openBluetoothAdapter();
},
});
let obj = getStorageSync("instrument_detail");
if (obj) {
this.setState({
@ -453,7 +448,7 @@ class IotCarePlanFR200 extends Component<any, any> {
const platform = Taro.getSystemInfoSync().platform;
if (platform !== "devtools") {
// 仅手机端初始化蓝牙
this.init();
// this.init();
}
}
@ -862,8 +857,8 @@ class IotCarePlanFR200 extends Component<any, any> {
});
};
ontextshow() {
let textshow = this.state.textshow
this.setState({ textshow: !textshow })
let textshow = this.state.textshow;
this.setState({ textshow: !textshow });
}
updata() {
let that = this;
@ -898,16 +893,16 @@ class IotCarePlanFR200 extends Component<any, any> {
}
full() {
let landscape = this.state.textscreen
if (landscape === 'landscape') {
this.setState({ textscreen: 'portrait' })
this.changeFull();
let landscape = this.state.textscreen;
if (landscape === "landscape") {
this.setState({ textscreen: "portrait" });
} else {
this.setState({ textscreen: 'landscape' })
this.setState({ textscreen: "landscape" });
}
// return 'landscape'
this.setState({ isFullScreen: !this.state.isFullScreen });
console.log(this.state.textscreen, 1111);
}
/** 切换光照 */
@ -2185,11 +2180,11 @@ class IotCarePlanFR200 extends Component<any, any> {
let report = true;
go(
"/recoding/pages/face_report_one/face_report_one?id=" +
ids +
"&report=" +
report +
"&obj=" +
JSON.stringify(obj)
ids +
"&report=" +
report +
"&obj=" +
JSON.stringify(obj)
);
} else if ("moistureTest" === nursingData.workMode) {
console.log("水分测试");
@ -2200,11 +2195,11 @@ class IotCarePlanFR200 extends Component<any, any> {
go(
"/recoding/pages/face_report/face_report?id=" +
deviceid +
"&recordId=" +
currentDevice +
"&report=" +
report
deviceid +
"&recordId=" +
currentDevice +
"&report=" +
report
);
}
};
@ -2328,6 +2323,26 @@ class IotCarePlanFR200 extends Component<any, any> {
}, 100);
};
changeFull() {
console.log("changeFull");
let { isFullScreen } = this.state;
/* eslint-enable */
// @ts-ignore
if (typeof wx !== "undefined" && wx.setPageOrientation) {
if (isFullScreen) {
// @ts-ignore
wx.setPageOrientation({
orientation: "landscape",
});
} else {
// @ts-ignore
wx.setPageOrientation({
orientation: "portrait",
});
}
}
}
render() {
let {
title,
@ -2377,290 +2392,262 @@ class IotCarePlanFR200 extends Component<any, any> {
return (
<Block>
{
isFullScreen && <PageMeta pageOrientation='portrait'></PageMeta>
}
{
!isFullScreen && <PageMeta pageOrientation='landscape'></PageMeta>
}
<Block>
<Navbar
titleSlot={title}
isBack
isCustomBack
customBack={this.customBack}
/>
<View>
<View catchMove>
<PopupAlert
isShow={isModeLock}
zIndex={10020}
myClassName="level-up"
title="提示"
content="该模式即将上线,敬请期待"
confirmButtonText="我知道了"
textAlgin="center"
close={this.onModeLockClose}
confirm={this.onModeLockClose}
/>
<PopupInstrumentUploadTips
isShow={isFirstTipShow}
zIndex={10020}
myClassName="level-up"
title="打卡介绍"
data={nurseInfo}
close={this.onTipShowClose}
confirm={this.onTipShowClose}
/>
<PopupCountdown isShow={isShowCountdown} countdown={countdown} />
<PopupConfirm
isLarge
isClose
isShow={isEndCarePlan}
title="提示"
content="是否结束护理"
textAlgin="center"
cancelButtonText="取消"
confirmButtonText="确定"
close={this.cancelEndBtn}
confirm={this.confirmEndBtn}
/>
<PopupConfirm
isLarge
isClose
isShow={isSwitchActiveMode}
title="护理模式切换"
content={
<ModeListView
ModeID={ModeID}
activeModeID={activeModeID}
isPop
isShowNurse={isShowNurse}
ModeList={ModeList}
ModeType={ModeType}
onEmit={this.switchModeCurrentFun}
onEmitShowAll={this.openModeSwitch}
onModeLockOpen={this.onModeLockOpen}
/>
}
textAlgin="center"
cancelButtonText="取消"
confirmButtonText="确定"
close={this.cancelModeSwitchBtn}
confirm={this.confirmModeSwitchBtn}
/>
{ActiveModeItem.openSourceData.length > 0 && (
<PopupStepTips
isShow={isShowStepTips}
isLarge
isFirstEntry={false}
confirmButtonText="知道了"
data={ActiveModeItem.openSourceData}
close={this.closeStepTips}
<Navbar
titleSlot={title}
isBack
isCustomBack
customBack={this.customBack}
/>
<View>
<View catchMove>
<PopupAlert
isShow={isModeLock}
zIndex={10020}
myClassName="level-up"
title="提示"
content="该模式即将上线,敬请期待"
confirmButtonText="我知道了"
textAlgin="center"
close={this.onModeLockClose}
confirm={this.onModeLockClose}
/>
<PopupInstrumentUploadTips
isShow={isFirstTipShow}
zIndex={10020}
myClassName="level-up"
title="打卡介绍"
data={nurseInfo}
close={this.onTipShowClose}
confirm={this.onTipShowClose}
/>
<PopupCountdown isShow={isShowCountdown} countdown={countdown} />
<PopupConfirm
isLarge
isClose
isShow={isEndCarePlan}
title="提示"
content="是否结束护理"
textAlgin="center"
cancelButtonText="取消"
confirmButtonText="确定"
close={this.cancelEndBtn}
confirm={this.confirmEndBtn}
/>
<PopupConfirm
isLarge
isClose
isShow={isSwitchActiveMode}
title="护理模式切换"
content={
<ModeListView
ModeID={ModeID}
activeModeID={activeModeID}
isPop
isShowNurse={isShowNurse}
ModeList={ModeList}
ModeType={ModeType}
onEmit={this.switchModeCurrentFun}
onEmitShowAll={this.openModeSwitch}
onModeLockOpen={this.onModeLockOpen}
/>
)}
<PopupAlert
isShow={isNotEnoughTime}
isClose
title="提示"
content="您的本次护理时间不足,请重新护理"
confirmButtonText="确认"
textAlgin="center"
close={this.closeNotEnoughTime}
confirm={this.closeNotEnoughTime}
/>
<PopupAlert
isShow={isShowErrorTipsText}
isClose
zIndex={10020}
myClassName="level-up"
title="提示"
content={errorTipsText}
}
textAlgin="center"
cancelButtonText="取消"
confirmButtonText="确定"
close={this.cancelModeSwitchBtn}
confirm={this.confirmModeSwitchBtn}
/>
{ActiveModeItem.openSourceData.length > 0 && (
<PopupStepTips
isShow={isShowStepTips}
isLarge
isFirstEntry={false}
confirmButtonText="知道了"
textAlgin="center"
close={this.closeErrorTipsText}
confirm={this.closeErrorTipsText}
/>
<PopupConfirm
isShow={isShowTipsSave}
isClose
zIndex={10020}
myClassName="level-up"
title="提示"
content={
<Block>
<View></View>
<View></View>
</Block>
}
cancelButtonText="取消"
confirmButtonText="确认"
textAlgin="center"
close={this.closeTipsSave}
cancel={this.cancelTipsSave}
confirm={this.confirmTipsSave}
data={ActiveModeItem.openSourceData}
close={this.closeStepTips}
/>
<PopupStatus
isShow={isShowNursingSuccess}
isClose
title="您已结束本次护理"
type="success"
content="正在上传护理记录……"
confirmButtonText="知道了"
textAlgin="center"
close={() => {
/*不需要做处理*/
}}
)}
<PopupAlert
isShow={isNotEnoughTime}
isClose
title="提示"
content="您的本次护理时间不足,请重新护理"
confirmButtonText="确认"
textAlgin="center"
close={this.closeNotEnoughTime}
confirm={this.closeNotEnoughTime}
/>
<PopupAlert
isShow={isShowErrorTipsText}
isClose
zIndex={10020}
myClassName="level-up"
title="提示"
content={errorTipsText}
confirmButtonText="知道了"
textAlgin="center"
close={this.closeErrorTipsText}
confirm={this.closeErrorTipsText}
/>
<PopupConfirm
isShow={isShowTipsSave}
isClose
zIndex={10020}
myClassName="level-up"
title="提示"
content={
<Block>
<View></View>
<View></View>
</Block>
}
cancelButtonText="取消"
confirmButtonText="确认"
textAlgin="center"
close={this.closeTipsSave}
cancel={this.cancelTipsSave}
confirm={this.confirmTipsSave}
/>
<PopupStatus
isShow={isShowNursingSuccess}
isClose
title="您已结束本次护理"
type="success"
content="正在上传护理记录……"
confirmButtonText="知道了"
textAlgin="center"
close={() => {
/*不需要做处理*/
}}
/>
{isConnectShow && (
<ConnectionBluetoot
deviceInfo={currentDevice}
close={this.connectionClose}
isDisconnect={!isConnectionBlutoot}
offlineChange={() => {}}
pairingChange={this.pairingChange}
upgradeFun={() => {}}
/>
)}
<Popup
show={isShowHistoryMsg}
className="custom-popup"
overlay={false}
>
<View className="sync-history-msg">...</View>
</Popup>
</View>
{isConnectShow && (
<ConnectionBluetoot
deviceInfo={currentDevice}
close={this.connectionClose}
isDisconnect={!isConnectionBlutoot}
offlineChange={() => { }}
pairingChange={this.pairingChange}
upgradeFun={() => { }}
/>
)}
<Popup
show={isShowHistoryMsg}
className="custom-popup"
overlay={false}
>
<View className="sync-history-msg">...</View>
</Popup>
</View>
<View>
<View className="iot-main">
{isFullScreen && (
<View className="banner-box">
<View>
<Video
className="video-or-image"
src={currentVideoSrc}
loop
id="myVideo"
objectFit="cover"
enablePlayGesture
showFullscreenBtn={false}
onLoadedMetaData={this.GetVideosTime}
/>
{/* <button onClick={this.executePromises}>点击按钮</button> */}
{errorTips && (
<Block>
<View className="msg-tips">
<Image
className="msg-tips-img"
src={require("@/img/tips.png")}
/>
<View className="msg-tips-content">{errorTips}</View>
</View>
</Block>
)}
</View>
<View>
<View className="iot-main">
{isFullScreen &&
<View className="banner-box">
<View>
<Video
className="video-or-image"
src={currentVideoSrc}
loop
id="myVideo"
objectFit="cover"
enablePlayGesture
showFullscreenBtn={false}
onLoadedMetaData={this.GetVideosTime}
/>
{/* <button onClick={this.executePromises}>点击按钮</button> */}
{errorTips && (
<Block>
<View className="msg-tips">
<Image
className="msg-tips-img"
src={require("@/img/tips.png")}
/>
<View className="msg-tips-content">{errorTips}</View>
</View>
</Block>
)}
<View className="fr200-iot-device">
<View className="item">
<Text className="device-time">
<Text className="time">{currentTime}</Text>
</Text>
</View>
<View className="fr200-iot-device">
<View className="item">
<Text className="device-time">
<Text className="time">{currentTime}</Text>
</Text>
</View>
<View className="line" />
<View className="item">
<Text className="gear">{currentGear}</Text>
</View>
<View className="line" />
<ElectricityView
Electricity={Electricity}
DeviceConnectStatus={DeviceConnectStatus}
/>
<View className="line" />
<View className="item">
<Text className="gear">{currentGear}</Text>
</View>
<View className="line" />
<ElectricityView
Electricity={Electricity}
DeviceConnectStatus={DeviceConnectStatus}
/>
</View>
}
{ModeList.length > 0 && isFullScreen && (
<ModeListView
isPop={false}
isShowNurse={isShowNurse}
ModeList={ModeList}
ModeType={ModeType}
ModeID={ModeID}
activeModeID={activeModeID}
onEmit={this.modeCurrentFun}
onEmitShowAll={this.openModeSwitch}
onModeLockOpen={this.onModeLockOpen}
/>
)}
<button onClick={this.updata.bind(this)}> </button>
{/* <button onClick={this.updata.bind(this)}>添加数据 </button> */}
{(ActiveModeItem?.modeType === "maskPenetration" ||
ActiveModeItem?.modeType === "essence") && isFullScreen && (
<Gears
onEmitMinus={this.handleMinus}
onEmitAdd={this.handleAdd}
GearData={GearData}
></Gears>
)}
{ActiveModeItem?.modeType === "moistureTest" && isFullScreen && (
<WaterTest
isRuningTest={isRuningTest}
stepList={waterStepList}
stepIndex={waterStepIndex}
></WaterTest>
)}
<View className={classnames({ show: showEcharts })}>
<Echarts
series={series}
full={this.full.bind(this)}
></Echarts>
{/* <EchartsFullScean
series={series}
full={this.full}
></EchartsFullScean> */}
</View>
</View>
)}
{isFullScreen &&
<Footer
currentWorkModeType={currentWorkModeType}
isRuningTest={isRuningTest}
isStopNurse={isStopNurse}
onEmitStartNurse={this.onStartNurse}
onEmitSwitchChange={this.onSwitchChange}
onEmitEndPlan={this.onEndPlan}
onsuccess={this.onsuccess}
{ModeList.length > 0 && isFullScreen && (
<ModeListView
isPop={false}
isShowNurse={isShowNurse}
ModeList={ModeList}
ModeType={ModeType}
ModeID={ModeID}
activeModeID={activeModeID}
onEmit={this.modeCurrentFun}
onEmitShowAll={this.openModeSwitch}
onModeLockOpen={this.onModeLockOpen}
/>
}
)}
<button onClick={this.updata.bind(this)}> </button>
{/* <button onClick={this.updata.bind(this)}>添加数据 </button> */}
{(ActiveModeItem?.modeType === "maskPenetration" ||
ActiveModeItem?.modeType === "essence") &&
isFullScreen && (
<Gears
onEmitMinus={this.handleMinus}
onEmitAdd={this.handleAdd}
GearData={GearData}
></Gears>
)}
{ActiveModeItem?.modeType === "moistureTest" && isFullScreen && (
<WaterTest
isRuningTest={isRuningTest}
stepList={waterStepList}
stepIndex={waterStepIndex}
></WaterTest>
)}
</View>
{isFullScreen && (
<Footer
currentWorkModeType={currentWorkModeType}
isRuningTest={isRuningTest}
isStopNurse={isStopNurse}
onEmitStartNurse={this.onStartNurse}
onEmitSwitchChange={this.onSwitchChange}
onEmitEndPlan={this.onEndPlan}
onsuccess={this.onsuccess}
/>
)}
</View>
</View>
{/*
{/*
<View>
<button onClick={this.updata.bind(this)}> </button>
@ -2670,18 +2657,12 @@ class IotCarePlanFR200 extends Component<any, any> {
></EchartsFullScean>
</View> */}
</Block>
{/* <View
style="position:fixed;width:100vw;height:100vh"
<View
className={classnames({ show: showEcharts })}
style="margin-top:200px"
>
<button onClick={this.full.bind(this)}> </button>
<Echarts
series={series}
full={this.full.bind(this)}
></Echarts>
</View> */}
<Echarts series={series} full={this.full.bind(this)}></Echarts>
</View>
</Block>
);
}

Loading…
Cancel
Save