blak-kong 2 years ago
parent 62901485e0
commit a4d2d7a438

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

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

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

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

Loading…
Cancel
Save