From ef2443dc58bb69f077b2da4e935967655a8debae Mon Sep 17 00:00:00 2001 From: lifizer <913626195@qq.com> Date: Tue, 25 Jun 2024 11:07:53 +0800 Subject: [PATCH] =?UTF-8?q?Fix(=E5=85=A5=E9=A9=BB):[#1811]=E5=95=86?= =?UTF-8?q?=E6=88=B7=E6=8F=90=E4=BA=A4=E5=85=A5=E9=A9=BB=E7=94=B3=E8=AF=B7?= =?UTF-8?q?=EF=BC=8C=E5=86=8D=E6=AC=A1=E8=BF=9B=E5=85=A5=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E6=97=B6=E5=95=86=E5=AE=B6=E8=B5=84=E8=B4=A8=E5=9B=BE=E7=89=87?= =?UTF-8?q?=E4=B8=8D=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg_join/views/shop.vue | 51 +++++++++++++++++++++++++------------ pkg_join/views/supplier.vue | 50 +++++++++++++++++++++++++----------- 2 files changed, 70 insertions(+), 31 deletions(-) diff --git a/pkg_join/views/shop.vue b/pkg_join/views/shop.vue index 9f4118e..14ddaeb 100644 --- a/pkg_join/views/shop.vue +++ b/pkg_join/views/shop.vue @@ -520,16 +520,27 @@ export default { } if (data.hotelInfo) { - this.pics = []; - this.form = data.hotelInfo; - let temp = this.form.pics.split(","); - if (temp.length > 0) { - temp.map(item => { - if (item.length > 0) { + // 店铺图片 + this.pics = [] + this.form = data.hotelInfo + const picsTemp = this.form.pics.split(",") + if (picsTemp.length > 0) { + picsTemp.map(item => { + if (item) { this.pics.push({url: item}) } }) } + // 商家资质 + this.quaPics = [] + const quaPicsTemp = this.form.qualification.split(",") + if (quaPicsTemp.length > 0) { + quaPicsTemp.map(item => { + if (item) { + this.quaPics.push({url: item}) + } + }) + } this.indexType = this.columnsType.findIndex(item => item.id === this.form.type) if (this.indexType !== -1) { this.form.typeText = this.columnsType[this.indexType].name @@ -673,17 +684,25 @@ export default { }, save() { - this.form.pics = ""; - this.pics.map(item => { - this.form.pics += (item.url + ","); - }) - this.form.pics = this.form.pics.substring(0, this.form.pics.length - 1); + this.form.pics = '' + const picsLength = this.pics.length + if (picsLength > 0) { + const tempArr = [] + this.pics.map(item => { + item.url && tempArr.push(item.url) + }) + this.form.pics = tempArr.join(',') + } - this.form.qualification = ""; - this.quaPics.map(item => { - this.form.qualification += (item.url + ","); - }) - this.form.qualification = this.form.qualification.substring(0, this.form.qualification.length - 1); + this.form.qualification = '' + const quaPicsLength = this.quaPics.length + if (quaPicsLength > 0) { + const tempArr = [] + this.quaPics.map(item => { + item.url && tempArr.push(item.url) + }) + this.form.qualification = tempArr.join(',') + } const postData = Object.assign({}, this.form) if (postData.coverType === 2) { postData.cover = postData.coverVideo diff --git a/pkg_join/views/supplier.vue b/pkg_join/views/supplier.vue index 8a3980f..fcf671f 100644 --- a/pkg_join/views/supplier.vue +++ b/pkg_join/views/supplier.vue @@ -711,17 +711,27 @@ export default { } if (data.hotelInfo) { - this.pics = []; - this.form = data.hotelInfo; - let temp = this.form.pics.split(","); - if (temp.length > 0) { - this.pics = []; - temp.map(item => { - if (item.length > 0) { + // 店铺图片 + this.pics = [] + this.form = data.hotelInfo + const picsTemp = this.form.pics.split(",") + if (picsTemp.length > 0) { + picsTemp.map(item => { + if (item) { this.pics.push({url: item}) } }) } + // 商家资质 + this.quaPics = [] + const quaPicsTemp = this.form.qualification.split(",") + if (quaPicsTemp.length > 0) { + quaPicsTemp.map(item => { + if (item) { + this.quaPics.push({url: item}) + } + }) + } this.indexType = this.columnsType.findIndex(item => item.id === this.form.type); this.form.typeText = this.columnsType[this.indexType].name; this.form.position = this.$forceToDecimal(this.form.longitude, 6) + ',' + this.$forceToDecimal(this.form.latitude, 6); @@ -925,15 +935,25 @@ export default { }, save() { - this.form.pics = ""; - this.pics.map(item => { - this.form.pics += (item.url + ","); - }) + this.form.pics = '' + const picsLength = this.pics.length + if (picsLength > 0) { + const tempArr = [] + this.pics.map(item => { + item.url && tempArr.push(item.url) + }) + this.form.pics = tempArr.join(',') + } - this.formSupplier.qualification = ""; - this.quaPics.map(item => { - this.formSupplier.qualification += (item.url + ","); - }) + this.formSupplier.qualification = '' + const quaPicsLength = this.quaPics.length + if (quaPicsLength > 0) { + const tempArr = [] + this.quaPics.map(item => { + item.url && tempArr.push(item.url) + }) + this.formSupplier.qualification = tempArr.join(',') + } const postData = Object.assign({}, this.form) if (postData.coverType === 2) { postData.cover = postData.coverVideo