From d8cac655a4dd9c53485f9a749f265efc401f43fd Mon Sep 17 00:00:00 2001 From: duan <1004387497@qq.com> Date: Fri, 2 Aug 2024 15:06:35 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9B=BE=E5=BA=93=E9=80=89=E6=8B=A950%?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/product/add_shop.vue | 33 +++++++----- src/views/product/components/addImages.vue | 61 ++++++++++++++-------- 2 files changed, 57 insertions(+), 37 deletions(-) diff --git a/src/views/product/add_shop.vue b/src/views/product/add_shop.vue index 62c109d..723c2ef 100644 --- a/src/views/product/add_shop.vue +++ b/src/views/product/add_shop.vue @@ -47,7 +47,7 @@ 注:第一张图为商品封面图,图片尺寸为750×750 - 从图库中选取 + @@ -394,7 +394,7 @@ export default { uploadImg, shopList, groupTypeList, - Editor,addImg + Editor, addImg }, data() { const validatordateUsed = (rule, value, callback) => { @@ -551,19 +551,24 @@ export default { } }, methods: { - successEvent(d){ - console.log(d,'拿到数据') - // this.$refs.uploadImg.fileList.push(d) - console.log(this.$refs.uploadImg.fileList,'调试111111') - console.log(this.$refs.uploadImg.files,'调试111111') + successEvent(d) { + d.forEach(item => { + item.uid = item.id + item.url = item.src + this.form.images.push(item.src); + }) + this.$refs.uploadImg.fileList.push(...d) + // this.form.images.push(res[0]); + // console.log(this.$refs.uploadImg.fileList, '调试111111') + // console.log(this.$refs.uploadImg.files, '调试222') }, - priceFormat(item,key){ - const messageheight=48; - const offset=window.innerHeight/2-(messageheight/2) -100 - this.$nextTick(()=>{ - const min=0; - const max=100000000; - const newval=formatPrice(item[key],min,max,true) + priceFormat(item, key) { + const messageheight = 48; + const offset = window.innerHeight / 2 - (messageheight / 2) - 100 + this.$nextTick(() => { + const min = 0; + const max = 100000000; + const newval = formatPrice(item[key], min, max, true) console.log(newval) if (typeof newval !== 'number') { item[key] = newval.value diff --git a/src/views/product/components/addImages.vue b/src/views/product/components/addImages.vue index cafdd04..cfc7e0a 100644 --- a/src/views/product/components/addImages.vue +++ b/src/views/product/components/addImages.vue @@ -1,7 +1,14 @@ - + + + + + + + 取 消 @@ -13,7 +20,7 @@