From 0394f22965d1f045d48a191bd424acedb92196df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Dchenxuelian=E2=80=9C?= <“chenxuelian@cjiedata.com”> Date: Sat, 28 Jan 2023 20:40:22 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E5=88=9B=E6=84=8F=E5=8F=91=E5=B8=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/ideasAndNeeds/ideasAndNeeds.vue | 24 ++++++++++++++++++++++-- service/request.js | 7 +++++++ 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/pages/ideasAndNeeds/ideasAndNeeds.vue b/pages/ideasAndNeeds/ideasAndNeeds.vue index 8f28b3a..5d46cf4 100644 --- a/pages/ideasAndNeeds/ideasAndNeeds.vue +++ b/pages/ideasAndNeeds/ideasAndNeeds.vue @@ -355,17 +355,37 @@ }); }, submitForm() { + console.log(this.fileList1) if (!/^1[3456789]\d{9}$/.test(this.needsPublishForm.mobile)) { this.$toast.warn('请输入正确的手机号') return false } this.needsPublishForm.type = Number(this.tabCurrent + 1) - this.needsPublishForm.pub_time = new Date().getTime() + this.needsPublishForm.pub_time = this.needsPublishForm.pub_time ? this.needsPublishForm.pub_time : new Date().getTime() + const temp = [] + if(this.fileList1.length > 0) { + this.fileList1.map(item => { + temp.push(item.url) + }) + } + this.needsPublishForm.images = temp.join(';') const data = { + type: null, + name: null, + pname: null, + area_code: null, + area_name: null, + images: null, + mobile: null, + class: null, + product: null, + loc: null, + desc: null, + pub_time: null, ...this.needsPublishForm } apiService.submitIdeasAndNeeds(data).then(res => { - this.$toast.success(res.msg) + this.$toast.success(res.data.msg) }) }, reOnLoad() { diff --git a/service/request.js b/service/request.js index 8a1141d..4ca9ede 100644 --- a/service/request.js +++ b/service/request.js @@ -375,6 +375,13 @@ const apiService = { resolve(service.post(url, data)) }) }, + // 提交 + submitIdeasAndNeeds(data) { + const url = `/require/release/` + return new Promise((resolve, reject) => { + resolve(service.putWithFormData(url, data)) + }) + }, getIdeasAndNeedsFormdata(data) { const url = `/require/formdata/` return new Promise((resolve, reject) => { From 5f8cc12b5002e50ba2959ac68383715170398b8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Dchenxuelian=E2=80=9C?= <“chenxuelian@cjiedata.com”> Date: Sat, 28 Jan 2023 21:03:05 +0800 Subject: [PATCH 2/3] Merge branch 'dev' into chenxuelian --- service/request.js | 7 ------- 1 file changed, 7 deletions(-) diff --git a/service/request.js b/service/request.js index 9cc8a1b..4ca9ede 100644 --- a/service/request.js +++ b/service/request.js @@ -326,13 +326,6 @@ const apiService = { resolve(service.get(url)) }) }, - //修改个人信息 - getUser() { - const url = `/center/userinfo` - return new Promise((resolve, reject) => { - resolve(service.get(url)) - }) - }, // 获取首页分类Tag getTags(data) { const url = `/home/tags` From 9959d86a4478ddb6425e72215d1d599de7a1df68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Dchenxuelian=E2=80=9C?= <“chenxuelian@cjiedata.com”> Date: Sat, 28 Jan 2023 21:35:10 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E9=9C=80=E6=B1=82=E5=8F=91=E5=B8=83?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E9=A1=BA=E5=BA=8F=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/ideasAndNeeds/ideasAndNeeds.vue | 31 ++++++++++++++++----------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/pages/ideasAndNeeds/ideasAndNeeds.vue b/pages/ideasAndNeeds/ideasAndNeeds.vue index 7d635ea..2fa2e31 100644 --- a/pages/ideasAndNeeds/ideasAndNeeds.vue +++ b/pages/ideasAndNeeds/ideasAndNeeds.vue @@ -143,9 +143,7 @@ positionPickerColumn: [ [] ], - categoryPickerList: [ - ['类别1', '类别', '类别'] - ], + categoryPickerList: [], fileList1: [ // uploads/images/20230117/202301172309397deda1543.jpg ], @@ -155,16 +153,8 @@ token: null } }, - onLoad(options) { - //我的发布点击修改回显数据 - let publishFormList = JSON.parse(options.item) - this.fileList1 = publishFormList.images - this.needsPublishForm = publishFormList - if (options.index == 0) { - this.tabCurrent = 0 - } else if (options.index == 1) { - this.tabCurrent = 1 - } + onTabItemTap() { + console.log('----onTabItemTap') if (!uni.getStorageSync('token') || uni.getStorageSync('token').length === 0) { console.log(uni.getStorageSync('token')) this.isLoad = false @@ -176,6 +166,20 @@ this.isLoad = true this.token = uni.getStorageSync('token') this.getFormData() + this.fileList1 = [] + this.needsPublishForm = {} + }, + onLoad(options) { + console.log('---onLoad') + //我的发布点击修改回显数据 + let publishFormList = JSON.parse(options.item) + this.fileList1 = publishFormList.images + this.needsPublishForm = publishFormList + if (options.index == 0) { + this.tabCurrent = 0 + } else if (options.index == 1) { + this.tabCurrent = 1 + } // this.getProductPickerList() }, methods: { @@ -403,6 +407,7 @@ } this.token = uni.getStorageSync('token') this.isLoad = true + this.getFormData() }, failToLoad() { console.log('----------------false')