步骤条在第一步提现申请的时候,只显示下一步。在第二步提现确认的时候,显示上一步和下一步。第三步完成提现的时候显示确认按钮。
<span :class="{active:prevStep===0}" >
<a-button type="" @click="prev" >上一步</a-button>
</span>
<a-button v-if="stepIndex === 0" type="primary" @click="next" >下一步</a-button>
<a-button v-else-if="stepIndex === 1" type="primary" :loading="nextLoading" @click=" prev() {
this.stepIndex--
if (this.stepIndex < 0) {
this.stepIndex = 0
}
if (this.stepIndex === 0) {
this.prevStep = 0;
this.getWithdrawableAmount()
}
},
next() {
if (!this.queryParams.fDeAmount) {
this.$message.warning('请填写提现金额')
return
}
this.stepIndex++
if (this.stepIndex > 2) {
this.stepIndex = 2
}
if(this.stepIndex=1){
this.prevStep=1;
}
},">确认</a-button>
active类名,控制样式隐藏
data中定义 prevStep:0,
prev() {
this.stepIndex--
if (this.stepIndex < 0) {
this.stepIndex = 0
}
if (this.stepIndex === 0) {
this.prevStep = 0;
this.getAmount()//调用方法
}
},
next() {
if (!this.queryParams.fDeAmount) {
this.$message.warning('请填写提现金额')
return
}
this.stepIndex++
if (this.stepIndex > 2) {
this.stepIndex = 2
}
if(this.stepIndex=1){
this.prevStep=1;
}
},