diff --git a/src/instrument/pages/instrument_manage/index.config.js b/src/instrument/pages/instrument_manage/index.config.js index 8560c5f..98cae27 100644 --- a/src/instrument/pages/instrument_manage/index.config.js +++ b/src/instrument/pages/instrument_manage/index.config.js @@ -1,3 +1,4 @@ export default definePageConfig({ navigationBarTitleText: "设备管理", + enablePageMeta: true, }); diff --git a/src/instrument/pages/instrument_manage/index.tsx b/src/instrument/pages/instrument_manage/index.tsx index 71a21ee..a5c6b31 100644 --- a/src/instrument/pages/instrument_manage/index.tsx +++ b/src/instrument/pages/instrument_manage/index.tsx @@ -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 { let { bindList, unBindList, current } = this.state; return ( + {/* */} { super(props); this.state = { textshow: false, - textscreen: 'portrait', + textscreen: "portrait", name: "FR200", title: "FR200", // 页面标题 // 当前设备 @@ -185,7 +185,6 @@ class IotCarePlanFR200 extends Component { ActiveModeItem: { modeType: "", openSourceData: [], - modeType: "" }, // 当前选中模式 SwitchActiveModeItem: { modeType: "", @@ -346,7 +345,7 @@ class IotCarePlanFR200 extends Component { }; } bluetoothContainer: any = null; - isFullScreen: boolean = false; + isFullScreen: boolean = true; // 不涉及渲染的页面变量 isRuning: any = true; // 设备默认运行中:fr200贴脸就会自动开始工作 jsonStatus: any = {}; // 同步设备返回数据,用于结束 @@ -391,6 +390,7 @@ class IotCarePlanFR200 extends Component { ]; 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 { this.getInstrumentClockSummary(); this.getInstrumentClockDetail(); } - componentDidMount() { } + componentDidMount() {} - componentWillUnmount() { } + componentWillUnmount() {} componentDidShow() { console.log("页面显示了"); @@ -428,11 +428,6 @@ class IotCarePlanFR200 extends Component { } async initData() { - Taro.closeBluetoothAdapter({ - complete: () => { - // this.openBluetoothAdapter(); - }, - }); let obj = getStorageSync("instrument_detail"); if (obj) { this.setState({ @@ -453,7 +448,7 @@ class IotCarePlanFR200 extends Component { const platform = Taro.getSystemInfoSync().platform; if (platform !== "devtools") { // 仅手机端初始化蓝牙 - this.init(); + // this.init(); } } @@ -862,8 +857,8 @@ class IotCarePlanFR200 extends Component { }); }; 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 { } 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 { 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 { 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 { }, 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 { return ( - { - isFullScreen && - } - { - !isFullScreen && - } - - - - - - - - - - - - - - - } - textAlgin="center" - cancelButtonText="取消" - confirmButtonText="确定" - close={this.cancelModeSwitchBtn} - confirm={this.confirmModeSwitchBtn} - /> - - {ActiveModeItem.openSourceData.length > 0 && ( - + + + + + + + + + + - )} - - - - + + {ActiveModeItem.openSourceData.length > 0 && ( + - - - 当前模式已护理部分时间 - 是否保存护理记录 - - } - cancelButtonText="取消" - confirmButtonText="确认" - textAlgin="center" - close={this.closeTipsSave} - cancel={this.cancelTipsSave} - confirm={this.confirmTipsSave} + data={ActiveModeItem.openSourceData} + close={this.closeStepTips} /> - - { - /*不需要做处理*/ - }} + )} + + + + + + + 当前模式已护理部分时间 + 是否保存护理记录 + + } + cancelButtonText="取消" + confirmButtonText="确认" + textAlgin="center" + close={this.closeTipsSave} + cancel={this.cancelTipsSave} + confirm={this.confirmTipsSave} + /> + + { + /*不需要做处理*/ + }} + /> + + {isConnectShow && ( + {}} + pairingChange={this.pairingChange} + upgradeFun={() => {}} /> + )} + + + 正在同步护理记录... + + - {isConnectShow && ( - { }} - pairingChange={this.pairingChange} - upgradeFun={() => { }} - /> - )} - - - 正在同步护理记录... - - + + + {isFullScreen && ( + + + - - - - {isFullScreen && - - -