Commit a7df09c7 by chenwq

优化步骤导航逻辑,简化返回上一步的处理

1 parent a8389602
......@@ -181,26 +181,12 @@ Page({
handlePrevStep() {
if (this.data.currentStep > 1) {
if (this.data.currentStep === 2) {
const secondStepComp = this.selectComponent("#SecondStep");
if (secondStepComp) {
const errorObj = secondStepComp.validate();
if (errorObj) return;
}
} else if (this.data.currentStep === 3) {
const thirdStepComp = this.selectComponent("#ThirdStep");
if (thirdStepComp) {
const errorObj = thirdStepComp.validate();
if (errorObj) return;
}
} else if (this.data.currentStep === 4) {
const fourthStepComp = this.selectComponent("#FourthStep");
if (fourthStepComp) {
const errorObj = fourthStepComp.validate();
if (errorObj) return;
}
}
this.saveOrderData("prev");
const prevNum = this.data.currentStep - 1;
const stepMap = { 1: "first", 2: "second", 3: "third", 4: "fourth" };
this.setData({
currentStep: prevNum,
step: stepMap[prevNum],
});
}
},
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!