This commit is contained in:
lnn19986213 2022-07-18 16:53:41 +08:00
parent 19f21c62ab
commit 695176c42d
1 changed files with 91 additions and 23 deletions

View File

@ -162,6 +162,7 @@
morePer: true, morePer: true,
perNumber: 1, perNumber: 1,
fileList3: [], fileList3: [],
ok: true,
} }
}, },
onShow() { onShow() {
@ -289,32 +290,99 @@
}) })
}, },
next() { next() {
let image = [] this.ok = true
this.fileList3.forEach(function(item) { if(this.name == ''){
image.push(item.url)
})
let data = image.join(',')
this.http.request('/hall/addHall', {
activityTime: this.wTime,
content: this.text2,
deadline: this.eTime,
demand: this.text1,
isMultiple: this.morePer,
quantity: this.perNumber,
receiverType: this.userTypeValue,
title: this.name,
type: this.typeId,
enclosure: data
}, "POST").then(res => {
if (res.code == 200) {
uni.navigateBack()
}
}).catch(e => {
uni.showToast({ uni.showToast({
title: e.data.message, title: '请输入名称',
icon: "none", icon: "none",
}); });
}) this.ok = false
return
}
if(this.typeId == ''){
uni.showToast({
title: '请选择类型',
icon: "none",
});
this.ok = false
return
}
if(this.text1 == ''){
uni.showToast({
title: '请输入需求清单',
icon: "none",
});
this.ok = false
return
}
if(this.text2 == ''){
uni.showToast({
title: '请输入具体内容',
icon: "none",
});
this.ok = false
return
}
if(this.eTime == ''){
uni.showToast({
title: '请选择截止时间',
icon: "none",
});
this.ok = false
return
}
if(this.wTime == ''){
uni.showToast({
title: '请请选择活动时间',
icon: "none",
});
this.ok = false
return
}
if(this.userTypeValue == ''){
uni.showToast({
title: '请选择可接单用户',
icon: "none",
});
this.ok = false
return
}
if(this.fileList3.length == 0){
uni.showToast({
title: '请上传附件',
icon: "none",
});
this.ok = false
return
}
if(this.ok){
let image = []
this.fileList3.forEach(function(item) {
image.push(item.url)
})
let data = image.join(',')
this.http.request('/hall/addHall', {
activityTime: this.wTime,
content: this.text2,
deadline: this.eTime,
demand: this.text1,
isMultiple: this.morePer,
quantity: this.perNumber,
receiverType: this.userTypeValue,
title: this.name,
type: this.typeId,
enclosure: data
}, "POST").then(res => {
if (res.code == 200) {
uni.navigateBack()
}
}).catch(e => {
uni.showToast({
title: e.data.message,
icon: "none",
});
})
}
} }
} }