diff --git a/src/project/fengdu/AppNewFarmerBank/integralAdd.vue b/src/project/fengdu/AppNewFarmerBank/integralAdd.vue index aa4e587..c7b70c8 100644 --- a/src/project/fengdu/AppNewFarmerBank/integralAdd.vue +++ b/src/project/fengdu/AppNewFarmerBank/integralAdd.vue @@ -12,14 +12,14 @@

上传图片

- +
可上传图片,最多上传9张。

上传视频

- +
可上传视频,最大30M。
@@ -44,16 +44,19 @@ export default { data() { return { form: { - applyItemId: 0, + applyItemId: '', applyIntegral: '', applyItemName: '', content: '', files: [], + images: [], + videos: [], girdId: '', girdName: '', }, list: [], dictList: [], + flag: false, } }, onLoad(o) { @@ -70,11 +73,32 @@ export default { }, methods: { submit() { + if(this.flag) return + + if (!this.form.applyItemId) { + return this.$u.toast('请选择事件类型') + } + + if ((this.form.images.length + this.form.videos.length) > 9) { + return this.$u.toast('图片和视频不得超过9个') + } else { + this.form.files = [...this.form.images,...this.form.videos] + } + + if (!this.form.girdId) { + return this.$u.toast('请选择所属网格') + } + + this.flag = true this.$instance.post(`/app/appintegraluserapply/addOrUpdate`,{ ...this.form }).then(res=> { + this.flag = false if(res?.data) { - console.log(res); + this.$u.toast('提交成功') + setTimeout(()=> { + uni.navigateBack() + },500) } }) }, @@ -102,7 +126,7 @@ export default { \ No newline at end of file