扫码bug修复

master
blak-kong 2 years ago
parent 6e83ce5f16
commit ad1fb93e14

@ -63,13 +63,14 @@ export const fr200DeviceControlCommand = {
* face: "01", 面部
* eyes: "02", 眼部
*
* nasolabialFold: "03", 法令纹
* mandibularLine: "04", 下颌线
* nasolabialFold: "03", 法令纹Pro
* mandibularLine: "04", 下颌线Pro
* led: "05", led
* headLiftingPro: "09", 抬头纹Pro
*
* moistureTest: "06", 水分测试
* maskPenetration: "07",面膜促渗
* essence: "08", 精华模式
* headLiftingPro: "09", 抬头纹Pro
*
* neck: "0A", 颈纹
* partition: "11", 分区模式 废弃VM1001

@ -347,7 +347,7 @@ class Instrument extends Component<any, any> {
// this.openBindingVisible();
msg("绑定成功");
setTimeout(() => {
setStorageSync("instrument_detail", JSON.stringify(channelInfo));
setStorageSync("instrument_detail", channelInfo);
this.getInstrumentIntroInfo(channelInfo.id);
}, 500);
} else if (code === 202) {
@ -384,6 +384,7 @@ class Instrument extends Component<any, any> {
Taro.setStorageSync("isScan", true);
Taro.setStorageSync("serial", channelInfo.serialCode);
Taro.switchTab({ url: "/pages/index/index" });
return;
// this.openBindingVisible();
} else if (res.data.code === 202) {
this.changeBindBox();
@ -414,7 +415,7 @@ class Instrument extends Component<any, any> {
this.setState({ isVisibleBinding: false });
msg("绑定成功");
setTimeout(() => {
setStorageSync("instrument_detail", JSON.stringify(channelInfo));
setStorageSync("instrument_detail", channelInfo);
this.getInstrumentIntroInfo(channelInfo.id);
}, 500);
} else if (res.data.code === 202) {
@ -444,7 +445,7 @@ class Instrument extends Component<any, any> {
if (data.code === 200) {
msg("换绑成功");
setTimeout(() => {
setStorageSync("instrument_detail", JSON.stringify(channelInfo));
setStorageSync("instrument_detail", channelInfo);
this.getInstrumentIntroInfo(channelInfo.id);
}, 500);
}
@ -457,7 +458,7 @@ class Instrument extends Component<any, any> {
});
if (res.data.code === 200) {
if (res.data.data.length > 0) {
go("/instrument/pages/instrument/intro??customBack=true&id=" + id);
go("/instrument/pages/instrument/intro?customBack=true&id=" + id);
} else {
Taro.switchTab({ url: "/pages/index/index" });
}

@ -67,6 +67,7 @@ class Intro extends Component<any, any> {
}
componentDidMount() {
let strObj = getStorageSync("instrument_detail");
console.log("strObj", strObj);
if (strObj) {
let instrument = strObj;
this.getInstrumentInfo(instrument.id);

@ -412,7 +412,9 @@ class IotCarePlanFR200 extends Component<any, any> {
}, 0);
}
/** 选中护理模式 */
/**
* @name /
* */
modeCurrentFun = async (data, isNotCheck = false) => {
let { isShowNurse } = this.state;
// 护理检查改变模式,是否提示切换护理模式
@ -442,6 +444,16 @@ class IotCarePlanFR200 extends Component<any, any> {
let currentTime = data.modeTimeStr;
let currentWorkModeType = 1;
if (data.modeType === "moistureTest") {
currentWorkModeType = 3;
} else if (
data.modeType === "maskPenetration" ||
data.modeType === "essence"
) {
currentWorkModeType = 2;
}
this.setState({
ActiveModeItem: data,
activeModeID: data.id,
@ -572,9 +584,9 @@ class IotCarePlanFR200 extends Component<any, any> {
setTimeout(() => {
this.onNursingTap();
// 倒计时弹窗: 倒计时完成后,自动开始,并判断弹窗
let downNum = CountDownTime[this.state.ActiveModeItem.modeType] || 3;
this.showCountdownFun(downNum, () => {});
// // 倒计时弹窗: 倒计时完成后,自动开始,并判断弹窗
// let downNum = CountDownTime[this.state.ActiveModeItem.modeType] || 3;
// this.showCountdownFun(downNum, () => {});
}, 500);
// 如果检查失败,则报错
@ -1867,6 +1879,7 @@ class IotCarePlanFR200 extends Component<any, any> {
ModeStepIndex,
currentServiceData,
ActiveModeItem,
currentWorkModeType,
isSwitchActiveMode,
ModeID,
activeModeID,
@ -2134,12 +2147,12 @@ class IotCarePlanFR200 extends Component<any, any> {
)}
{ActiveModeItem.modeType === "moistureTest" && (
<WaterTest></WaterTest>
<WaterTest isRuningTest={isRuningTest}></WaterTest>
)}
</View>
<Footer
currentWorkMode={ActiveModeItem.modeType}
currentWorkModeType={currentWorkModeType}
isRuningTest={isRuningTest}
isStopNurse={isStopNurse}
onEmitStartNurse={this.onStartNurse}

@ -3,7 +3,7 @@ import "./FR200.less";
interface Props {
// isShowNurse: boolean;
currentWorkMode: string; // 当前工作模式
currentWorkModeType: number; // 当前工作模式 1基础脸部等只有结束按钮 2.促渗,可以开始暂停和结束 3.水分测试
isStopNurse: boolean;
isRuningTest: boolean; // 是否在运行测试
onEmitStartNurse: Function; // 每次点击item回调事件和数据给父组件
@ -11,7 +11,7 @@ interface Props {
onEmitEndPlan: Function;
}
function Index({
currentWorkMode,
currentWorkModeType,
isStopNurse,
isRuningTest,
onEmitStartNurse,
@ -33,7 +33,7 @@ function Index({
return (
<Block>
<View className="iot-footer">
{currentWorkMode === "moistureTest" && (
{currentWorkModeType === 3 && (
<Block>
{!isRuningTest ? (
<View className="btn " onClick={onStartNurse}>
@ -45,7 +45,7 @@ function Index({
</Block>
)}
{currentWorkMode !== "moistureTest" && (
{currentWorkModeType === 2 && (
<View className="switch-btn-box">
<View className="btn-item border-right" onClick={onSwitchChange}>
{isStopNurse ? (

@ -6,12 +6,10 @@ import { Popup, Progress, Slider } from "@antmjs/vantui";
import "./index.less";
interface Props {
Electricity: any;
matrixElectricity: any;
facialMaskConnectStatus: any;
isRuningTest: boolean; // 是否已开始水分测试
}
function Index() {
function Index(isRuningTest) {
const stepIndex = 0;
const testIndex = 1;
@ -33,53 +31,56 @@ function Index() {
},
];
return (
<Block>
<View>
<View className='water_test'>
<View className='test_step flex aitems sb'>
<Block>
<View>
{!isRuningTest && (
<View className="water_test">
<View className="test_step flex aitems sb">
{stepList.map((item, index) => {
return (
<View className='step_block flex aitems' key={index}>
<View className='step_top flex aitems'>
<View className='drop'></View>
<View className='step_num'>{item.value}</View>
{index != 2 && <View className='line'></View>}
<View className="step_block flex aitems" key={index}>
<View className="step_top flex aitems">
<View className="drop"></View>
<View className="step_num">{item.value}</View>
{index != 2 && <View className="line"></View>}
</View>
<View className='step_name'>{item.name}</View>
<View className="step_name">{item.name}</View>
</View>
);
})}
</View>
<View className='test_txt'>
<View className="test_txt">
</View>
</View>
)}
<View className='testing'>
<View className='testing_header flex aitems'>
{isRuningTest && (
<View className="testing">
<View className="testing_header flex aitems">
{stepList.map((item, index) => {
return (
<View
className='items flex aitems jcenter'
className="items flex aitems jcenter"
key={index}
style={stepIndex == index ? "background: #fff" : ""}
>
{stepIndex > index && (
<Image
className='finish_img'
className="finish_img"
src={require("@/img/full-scran.png")}
mode='aspectFill'
mode="aspectFill"
></Image>
)}
<View className='value'>{item.value}</View>
<View className='name'>{item.name}</View>
<View className="value">{item.value}</View>
<View className="name">{item.name}</View>
</View>
);
})}
</View>
<View className='testing_content'>
<View className='progress_box flex aitems'>
<View className='title'>
<View className="testing_content">
<View className="progress_box flex aitems">
<View className="title">
{stepList[stepIndex].name + "水分测试"}
</View>
{/* <view class='progress_block flex aitems'> */}
@ -87,22 +88,22 @@ function Index() {
style={{
width: "300rpx",
}}
percentage='80'
strokeWidth='14'
percentage="80"
strokeWidth="14"
showPivot={false}
color='#C2E5F3'
color="#C2E5F3"
></Progress>
{stepList[stepIndex].finish && 80 >= 99 ? (
<Image
className='finish_img'
className="finish_img"
src={require("@/img/finished.png")}
mode='aspectFill'
mode="aspectFill"
></Image>
) : (
<Image
className='finish_img'
className="finish_img"
src={require("@/img/no-finish.png")}
mode='aspectFill'
mode="aspectFill"
></Image>
)}
{/* </view> */}
@ -110,7 +111,7 @@ function Index() {
{/* <view class='tips' wx:if='{{!finish}}'> */}
{/* 请参考视频指引,将仪器紧贴<text style='color: #000000'>额头区域</text> */}
{/* </view> */}
<View className='tips flex sb'>
<View className="tips flex sb">
<View>
{(testIndex == 1 || testIndex == 2 || testIndex == 4) && (
@ -129,10 +130,9 @@ function Index() {
</View>
</View>
</View>
</View>
</Block>
)}
</View>
</Block>
);
}

@ -674,11 +674,8 @@ class Index extends Component<any, any> {
}
// 0已绑定 1未绑定 2已解绑
if (instrumentInfo.bindingStatus === 0) {
setTimeout(() => {
this.isBindingSerial();
}, 100);
let isBind = this.state.instrumentList.find(
(item) => item.id === instrumentInfo.id
(item) => item.id === instrumentInfo.instrumentId
);
if (isBind) {
msg("序列号已绑定");
@ -688,7 +685,6 @@ class Index extends Component<any, any> {
BeforeBindingErrorText: "序列号已被其他用户绑定",
});
}
return;
} else if (
instrumentInfo.bindingStatus === 1 ||
@ -749,7 +745,7 @@ class Index extends Component<any, any> {
msg("绑定成功");
let obj = unbindingInstrumentList.find(
(item) => item.id === instrumentInfo.id
(item) => item.id === instrumentInfo.instrumentId
);
if (obj) {
setStorageSync("instrument_detail", obj);
@ -757,8 +753,8 @@ class Index extends Component<any, any> {
setTimeout(() => {
// 绑定成功后,先查询设备介绍页,有数据则跳转,没数据则刷新已绑定数据
this.getInstrumentIntroInfo(instrumentInfo.id);
}, 1000);
this.getInstrumentIntroInfo(instrumentInfo.instrumentId);
}, 500);
return;
} else if (data.code === 204) {
this.setState({
@ -780,9 +776,10 @@ class Index extends Component<any, any> {
let res = await InstrumentInfo.instructionInfo({
instrumentId: id,
});
console.log("res", res);
if (res.data.code === 200) {
if (res.data.data.length > 0) {
go("/instrument/pages/instrument/intro??customBack=true&id=" + id);
go("/instrument/pages/instrument/intro?customBack=true&id=" + id);
} else {
this.bindingInstrumentList();
}
@ -804,8 +801,13 @@ class Index extends Component<any, any> {
if (data.code === 200) {
msg("换绑成功");
setTimeout(() => {
setStorageSync("instrument_detail", JSON.stringify(instrumentInfo));
this.getInstrumentIntroInfo(instrumentInfo.id);
let obj = this.state.unbindingInstrumentList.find(
(item) => item.id === instrumentInfo.instrumentId
);
if (obj) {
setStorageSync("instrument_detail", obj);
}
this.getInstrumentIntroInfo(instrumentInfo.instrumentId);
}, 500);
}
};

Loading…
Cancel
Save