优化表单校验逻辑
This commit is contained in:
parent
201fed4ae0
commit
4f60150d48
@ -212,23 +212,22 @@
|
|||||||
},
|
},
|
||||||
// 创建账号
|
// 创建账号
|
||||||
addAcountNum() {
|
addAcountNum() {
|
||||||
this.$refs.uForm.validate().then((e) => {
|
let flag = this.$refs.districtSelectorRef.validate();
|
||||||
if (e) this.$refs.districtSelectorRef.validate().then(async (e) => {
|
this.$refs.uForm.validate().then(async (e) => {
|
||||||
if (e) {
|
if(e&&flag){
|
||||||
uni.showLoading()
|
uni.showLoading()
|
||||||
let res = await loginAdd({...this.formData, ...this.$refs.districtSelectorRef.formData});
|
let res = await loginAdd({...this.formData, ...this.$refs.districtSelectorRef.formData});
|
||||||
uni.hideLoading()
|
uni.hideLoading()
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
icon: "none",
|
icon: "none",
|
||||||
title: "添加成功",
|
title: "添加成功",
|
||||||
success: () => {
|
success: () => {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
uni.navigateBack()
|
uni.navigateBack()
|
||||||
}, 1000)
|
}, 1000)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// // 获取机型,[1-微信小程序 2-微信公众号 3-手机H5 4-电脑PC 5-苹果APP 6-安卓APP]
|
// // 获取机型,[1-微信小程序 2-微信公众号 3-手机H5 4-电脑PC 5-苹果APP 6-安卓APP]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user