浏览代码

优化店铺详情页和店铺编辑也定位功能和图片批量上传

zhujindu 1 年之前
父节点
当前提交
d951919614
共有 1 个文件被更改,包括 5 次插入2 次删除
  1. 5 2
      src/components/uploadImgVStore.vue

+ 5 - 2
src/components/uploadImgVStore.vue

@@ -142,11 +142,14 @@ export default {
       });
       uploadImagev(form).then((res) => {
         if (res.code == 200) {
-          console.log(JSON.stringify(res.data));
           // that.imgArr = res.data.url;
+          let imgArr = [];
+          res.data.forEach((item) => {
+            imgArr.push(item.url);
+          });
           loind1.clear();
           that.$toast('上传成功!');
-          that.$emit('newimgarr', { fileUrl: res.data.url, type: that.type });
+          that.$emit('newimgarr', { fileUrl: imgArr.join(','), type: that.type });
         } else {
           that.$toast('上传失败!');
         }