Fix(店铺):字段值为null时,必填校验会报错导致无法提交数据

This commit is contained in:
lifizer
2024-07-05 20:48:53 +08:00
parent 44d4a21eba
commit 4c8e79ebba
4 changed files with 15 additions and 15 deletions
+12 -12
View File
@@ -330,36 +330,36 @@ export default {
})
},
submit() {
if (this.innApplyInfo.logo.length === 0) {
this.$dialog.error('请上传店铺LOGO图片')
if (!this.innApplyInfo.logo) {
this.$dialog.error('请上传店铺LOGO')
return
}
if (this.innApplyInfo.cover.length === 0 && this.innApplyInfo.coverType === 1) {
if (!this.innApplyInfo.cover && this.innApplyInfo.coverType === 1) {
this.$dialog.error('请上传店铺封面图片')
return
}
if (this.innApplyInfo.coverVideo.length === 0 && this.innApplyInfo.coverType === 2) {
if (!this.innApplyInfo.coverVideo && this.innApplyInfo.coverType === 2) {
this.$dialog.error('请上传店铺封面视频')
return
}
if (this.innApplyInfo.ownerName.length === 0) {
if (!this.innApplyInfo.ownerName) {
this.$dialog.error('请输入店主名字')
return
}
if (this.innApplyInfo.content.length === 0) {
if (!this.innApplyInfo.content) {
this.$dialog.error('请输入一句话介绍')
return
}
if (this.innApplyInfo.desc.length === 0) {
this.$dialog.error('请输入店铺简介')
return
}
// if (!this.innApplyInfo.desc) {
// this.$dialog.error('请输入店铺简介')
// return
// }
if (this.uploadedFilesArray.length === 0) {
this.$dialog.error('请上传至少一张店铺图片')
this.$dialog.error('请上传店铺图片')
return
}
if (this.uploadedQualificationFilesArray.length === 0) {
this.$dialog.error('请上传至少一张店铺资质图片')
this.$dialog.error('请上传资质图片')
return
}
// 深拷贝
+1 -1
View File
@@ -538,7 +538,7 @@ export default {
},
getCode() {
if (this.reviewing) return
if (this.form.phone.length === 0) {
if (!this.form.phone) {
uni.$u.toast('请输入手机号')
return
}
+1 -1
View File
@@ -719,7 +719,7 @@ export default {
},
getCode() {
if (this.reviewing) return
if (this.formSupplier.phone.length === 0) {
if (!this.formSupplier.phone) {
uni.$u.toast('请输入手机号')
return
}
+1 -1
View File
@@ -328,7 +328,7 @@ export default {
},
getCode() {
if (this.reviewing) return
if (this.form.phone.length === 0) {
if (!this.form.phone) {
uni.$u.toast('请输入手机号')
return
}