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);
}
/** 切换光照 */
@ -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,
@ -2376,15 +2391,6 @@ class IotCarePlanFR200 extends Component<any, any> {
} = this.state;
return (
<Block>
{
isFullScreen && <PageMeta pageOrientation='portrait'></PageMeta>
}
{
!isFullScreen && <PageMeta pageOrientation='landscape'></PageMeta>
}
<Block>
<Navbar
titleSlot={title}
@ -2528,9 +2534,9 @@ class IotCarePlanFR200 extends Component<any, any> {
deviceInfo={currentDevice}
close={this.connectionClose}
isDisconnect={!isConnectionBlutoot}
offlineChange={() => { }}
offlineChange={() => {}}
pairingChange={this.pairingChange}
upgradeFun={() => { }}
upgradeFun={() => {}}
/>
)}
@ -2545,8 +2551,7 @@ class IotCarePlanFR200 extends Component<any, any> {
<View>
<View className="iot-main">
{isFullScreen &&
{isFullScreen && (
<View className="banner-box">
<View>
<Video
@ -2576,7 +2581,8 @@ class IotCarePlanFR200 extends Component<any, any> {
<View className="fr200-iot-device">
<View className="item">
<Text className="device-time">
<Text className="time">{currentTime}</Text>
<Text className="time">{currentTime}</Text>
</Text>
</View>
<View className="line" />
@ -2590,7 +2596,7 @@ class IotCarePlanFR200 extends Component<any, any> {
/>
</View>
</View>
}
)}
{ModeList.length > 0 && isFullScreen && (
<ModeListView
@ -2608,13 +2614,9 @@ class IotCarePlanFR200 extends Component<any, any> {
<button onClick={this.updata.bind(this)}> </button>
{/* <button onClick={this.updata.bind(this)}>添加数据 </button> */}
{(ActiveModeItem?.modeType === "maskPenetration" ||
ActiveModeItem?.modeType === "essence") && isFullScreen && (
ActiveModeItem?.modeType === "essence") &&
isFullScreen && (
<Gears
onEmitMinus={this.handleMinus}
onEmitAdd={this.handleAdd}
@ -2629,22 +2631,9 @@ class IotCarePlanFR200 extends Component<any, any> {
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 &&
{isFullScreen && (
<Footer
currentWorkModeType={currentWorkModeType}
isRuningTest={isRuningTest}
@ -2654,9 +2643,7 @@ class IotCarePlanFR200 extends Component<any, any> {
onEmitEndPlan={this.onEndPlan}
onsuccess={this.onsuccess}
/>
}
)}
</View>
</View>
@ -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