页面跳转

master
rongweikang 2 years ago
parent 2f0ce40830
commit 07d684ff5f

@ -242,7 +242,7 @@ class IotCarePlanFR200 extends Component<any, any> {
/** 基础版:脸部/眼部 */ /** 基础版:脸部/眼部 */
BaseModeType: string[] = ["face", "eyes"]; BaseModeType: string[] = ["face", "eyes"];
async onLoad() { async onLoad(option) {
// 保持屏幕常亮 // 保持屏幕常亮
Taro.setKeepScreenOn({ Taro.setKeepScreenOn({
keepScreenOn: true, keepScreenOn: true,
@ -250,10 +250,13 @@ class IotCarePlanFR200 extends Component<any, any> {
this.initData(); this.initData();
this.getInstrumentClockSummary(); this.getInstrumentClockSummary();
this.getInstrumentClockDetail(); this.getInstrumentClockDetail();
if (option.modeId) {
this.setState({ activeModeID: option.modeId })
}
} }
componentDidMount() {} componentDidMount() { }
componentWillUnmount() {} componentWillUnmount() { }
componentDidShow() { componentDidShow() {
console.log("页面显示了"); console.log("页面显示了");
@ -389,6 +392,16 @@ class IotCarePlanFR200 extends Component<any, any> {
ModeList: res.data.data, ModeList: res.data.data,
}); });
if (this.state.activeModeID != '') {
this.state.ModeList.map(item => {
if (item.id === this.state.activeModeID) {
this.setState({
ActiveModeItem: item
});
}
})
}
setTimeout(() => { setTimeout(() => {
this.modeCurrentFun(res.data.data[0]); this.modeCurrentFun(res.data.data[0]);
}, 100); }, 100);
@ -587,7 +600,7 @@ class IotCarePlanFR200 extends Component<any, any> {
this.onNursingTap(); this.onNursingTap();
// 倒计时弹窗: 倒计时完成后,自动开始,并判断弹窗 // 倒计时弹窗: 倒计时完成后,自动开始,并判断弹窗
let downNum = CountDownTime[this.state.ActiveModeItem.modeType] || 3; let downNum = CountDownTime[this.state.ActiveModeItem.modeType] || 3;
this.showCountdownFun(downNum, () => {}); this.showCountdownFun(downNum, () => { });
}, 500); }, 500);
return; return;
@ -613,7 +626,7 @@ class IotCarePlanFR200 extends Component<any, any> {
}; };
// 绘制能量图 // 绘制能量图
drawProwerPicture() {} drawProwerPicture() { }
/** 切换光照 */ /** 切换光照 */
onSwitchChange = async () => { onSwitchChange = async () => {
@ -2083,9 +2096,9 @@ class IotCarePlanFR200 extends Component<any, any> {
deviceInfo={currentDevice} deviceInfo={currentDevice}
close={this.connectionClose} close={this.connectionClose}
isDisconnect={!isConnectionBlutoot} isDisconnect={!isConnectionBlutoot}
offlineChange={() => {}} offlineChange={() => { }}
pairingChange={this.pairingChange} pairingChange={this.pairingChange}
upgradeFun={() => {}} upgradeFun={() => { }}
/> />
)} )}

@ -38,7 +38,8 @@ class MoistureTestReport extends Component<any, any> {
xinde: '', xinde: '',
imglist: [], imglist: [],
id: 0, id: 0,
show: false show: false,
modeId: 0
}; };
} }
@ -71,20 +72,18 @@ class MoistureTestReport extends Component<any, any> {
reportData.shuifenGear.rightFace = gear reportData.shuifenGear.rightFace = gear
} }
}) })
this.setState({ reportData }); this.setState({ reportData, modeId: option.modeId });
setTimeout(() => {
console.log(this.state.reportData);
}, 50);
} }
async initData() { } async initData() { }
toIndex() { toIndex() {
Taro.reLaunch({ url: "/pages/index/index" }); Taro.reLaunch({ url: "/pages/index/index" });
} }
toNursing() {
go(`/moduleIOT/pages/iotCarePlan/FR200?modeId=${this.state.modeId}`)
}
render() { render() {
let { name, imgUrl, reportData, reportData1, isClock, xinde, imglist, id, show } = this.state let { name, imgUrl, reportData, reportData1, isClock, xinde, imglist, id, show, modeId } = this.state
const getStatusData = (level) => { const getStatusData = (level) => {
var bgCssData = { var bgCssData = {
@ -288,7 +287,7 @@ class MoistureTestReport extends Component<any, any> {
</View> </View>
<View className='go_clock_in flex sb aitems' > <View className='go_clock_in flex sb aitems' >
<View className='go_clock_btn'></View> <View className='go_clock_btn' onClick={this.toNursing.bind(this)}></View>
<View className='jump_box flex aitems' onClick={this.toIndex}> <View className='jump_box flex aitems' onClick={this.toIndex}>
<View className='txt'></View> <View className='txt'></View>
<Image src='@/img/fr200/right.png' mode='aspectFill'></Image> <Image src='@/img/fr200/right.png' mode='aspectFill'></Image>

@ -1,4 +1,4 @@
import Taro from "@tarojs/taro"; import Taro, { setStorageSync } from "@tarojs/taro";
import classnames from "classnames"; import classnames from "classnames";
import { Component, PropsWithChildren, useEffect, useState } from "react"; import { Component, PropsWithChildren, useEffect, useState } from "react";
@ -289,7 +289,11 @@ export default class Recording extends Component<any, any> {
}; };
// 跳转到护理报告 // 跳转到护理报告
toReport(id, recordId, item) { toReport(id, recordId, item) {
console.log(item, "查看类型", item.jumpType); this.state.bindingInstrumentList.map(instrument => {
if (instrument.id == id) {
setStorageSync("instrument_detail", instrument);
}
})
switch (item.jumpType) { switch (item.jumpType) {
case 1: case 1:
this.One(item); this.One(item);
@ -325,7 +329,7 @@ export default class Recording extends Component<any, any> {
}; };
// 打开第三种类型 // 打开第三种类型
three = async (item) => { three = async (item) => {
go(`/recoding/pages/moisture_test_report/moisture_test_report?data=${item.nursingData}&date=${item.createTime}`); go(`/recoding/pages/moisture_test_report/moisture_test_report?data=${item.nursingData}&date=${item.createTime}&modeId=${item.modeId}`);
}; };
// 打开其他类型 // 打开其他类型
AllDevice = async (item) => { AllDevice = async (item) => {

Loading…
Cancel
Save