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