扫码bug修复

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

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

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

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

@ -412,7 +412,9 @@ class IotCarePlanFR200 extends Component<any, any> {
}, 0); }, 0);
} }
/** 选中护理模式 */ /**
* @name /
* */
modeCurrentFun = async (data, isNotCheck = false) => { modeCurrentFun = async (data, isNotCheck = false) => {
let { isShowNurse } = this.state; let { isShowNurse } = this.state;
// 护理检查改变模式,是否提示切换护理模式 // 护理检查改变模式,是否提示切换护理模式
@ -442,6 +444,16 @@ class IotCarePlanFR200 extends Component<any, any> {
let currentTime = data.modeTimeStr; 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({ this.setState({
ActiveModeItem: data, ActiveModeItem: data,
activeModeID: data.id, activeModeID: data.id,
@ -572,9 +584,9 @@ class IotCarePlanFR200 extends Component<any, any> {
setTimeout(() => { setTimeout(() => {
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);
// 如果检查失败,则报错 // 如果检查失败,则报错
@ -1867,6 +1879,7 @@ class IotCarePlanFR200 extends Component<any, any> {
ModeStepIndex, ModeStepIndex,
currentServiceData, currentServiceData,
ActiveModeItem, ActiveModeItem,
currentWorkModeType,
isSwitchActiveMode, isSwitchActiveMode,
ModeID, ModeID,
activeModeID, activeModeID,
@ -2134,12 +2147,12 @@ class IotCarePlanFR200 extends Component<any, any> {
)} )}
{ActiveModeItem.modeType === "moistureTest" && ( {ActiveModeItem.modeType === "moistureTest" && (
<WaterTest></WaterTest> <WaterTest isRuningTest={isRuningTest}></WaterTest>
)} )}
</View> </View>
<Footer <Footer
currentWorkMode={ActiveModeItem.modeType} currentWorkModeType={currentWorkModeType}
isRuningTest={isRuningTest} isRuningTest={isRuningTest}
isStopNurse={isStopNurse} isStopNurse={isStopNurse}
onEmitStartNurse={this.onStartNurse} onEmitStartNurse={this.onStartNurse}

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

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

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

Loading…
Cancel
Save