From 878999c441d768050002ffe5b854eea8f87da289 Mon Sep 17 00:00:00 2001 From: shijingjing <1789544664@qq.com> Date: Mon, 3 Apr 2023 15:33:27 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=A6=E6=83=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fengdu/AppNewFarmerBank/integralAdd.vue | 54 ++++--- .../fengdu/AppNewFarmerBank/integralApply.vue | 17 ++- .../AppNewFarmerBank/integralDetail.vue | 139 +++++++++++++++++- 3 files changed, 174 insertions(+), 36 deletions(-) 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