From d10a26ccaee9c83fc759f3b1234668c704296185 Mon Sep 17 00:00:00 2001 From: java110 <928255095@qq.com> Date: Wed, 14 Sep 2022 19:28:00 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/frame/uploadImage/uploadImage.html | 14 +++++--------- public/components/frame/uploadImage/uploadImage.js | 9 +++++---- .../components/property/editAdvert/editAdvert.js | 2 +- 3 files changed, 11 insertions(+), 14 deletions(-) diff --git a/public/components/frame/uploadImage/uploadImage.html b/public/components/frame/uploadImage/uploadImage.html index d15b698b2..725b43660 100755 --- a/public/components/frame/uploadImage/uploadImage.html +++ b/public/components/frame/uploadImage/uploadImage.html @@ -1,14 +1,10 @@
- - + +
-
+
- -
+ +
\ No newline at end of file diff --git a/public/components/frame/uploadImage/uploadImage.js b/public/components/frame/uploadImage/uploadImage.js index d0a556dc8..5618b1529 100755 --- a/public/components/frame/uploadImage/uploadImage.js +++ b/public/components/frame/uploadImage/uploadImage.js @@ -19,7 +19,7 @@ uploadImageInfo: { deep: true, handler: function() { - //vc.emit($props.callBackListener, $props.callBackFunction, this.uploadImageInfo.photos); + vc.emit($props.callBackListener, $props.callBackFunction, this.uploadImageInfo.photos); } } }, @@ -89,7 +89,7 @@ var reader = new FileReader(); //新建FileReader对象 reader.readAsDataURL(file); //读取为base64 reader.onloadend = function(e) { - this.uploadImageInfo.photos.push(reader.result); + //this.uploadImageInfo.photos.push(reader.result); } this.uploadImageInfo.fileName = file.name; this._doUploadImage(file); @@ -124,13 +124,14 @@ vc.toast("上传文件失败"); return; } - var data = JSON.parse(json); + let data = JSON.parse(json); //关闭model //$summernote.summernote('insertImage', "/callComponent/download/getFile/file?fileId=" + data.fileId + "&communityId=" + vc.getCurrentCommunity().communityId); //$summernote.summernote('insertImage', data.url); this.uploadImageInfo.fileName = data.fileName; this.uploadImageInfo.realFileName = data.realFileName; - vc.emit($props.callBackListener, $props.callBackFunction, data); + this.uploadImageInfo.photos.push(data); + vc.emit($props.callBackListener, $props.callBackFunction, this.uploadImageInfo.photos); }, function(errInfo, error) { console.log('请求失败处理'); diff --git a/public/components/property/editAdvert/editAdvert.js b/public/components/property/editAdvert/editAdvert.js index f1b5cfdc5..6f2e9b916 100755 --- a/public/components/property/editAdvert/editAdvert.js +++ b/public/components/property/editAdvert/editAdvert.js @@ -276,4 +276,4 @@ } } }); -})(window.vc, window.vc.component); +})(window.vc, window.vc.component); \ No newline at end of file