This commit is contained in:
liuye
2021-12-23 17:30:17 +08:00
parent 8cba16bb91
commit bab9b0e3cf
6 changed files with 35 additions and 28 deletions

View File

@@ -125,34 +125,37 @@ export default {
return this.$u.toast('请选择类别')
}
const imgs = []
var imgs = []
if (this.forms.fileIds) {
this.forms.fileIds.map((e) => {
imgs.push({ url: e.url, id: e.id })
})
}
this.flag = true
console.log(222)
this.$http.post(`/app/appcontentinfo/addOrUpdate`, {
title: this.forms.title,
areaId: this.forms.areaId,
content: this.forms.content,
files: imgs || [],
id: this.id,
moduleId: this.moduleId,
categoryId: this.selectList[this.forms.selectIndex].id,
categoryName: this.selectList[this.forms.selectIndex].categoryName,
})
.then((res) => {
if (res.code == 0) {
uni.$emit('update')
this.$u.toast('发布成功')
this.flag = false
setTimeout(() => {
uni.navigateBack()
}, 600)
}
})
title: this.forms.title,
areaId: this.forms.areaId,
content: this.forms.content,
files: imgs || [],
id: this.id,
moduleId: this.moduleId,
categoryId: this.selectList[this.forms.selectIndex].id,
categoryName: this.selectList[this.forms.selectIndex].categoryName,
})
.then((res) => {
console.log(333)
if (res.code == 0) {
uni.$emit('update')
this.$u.toast('发布成功')
this.flag = true
setTimeout(() => {
uni.navigateBack()
}, 600)
}
}).catch((err) => {
console.log(err)
})
} else {
this.$u.toast('失败')
}