소스 검색

图片放大

谢杰标 2 년 전
부모
커밋
ff019223c5
2개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 1 1
      common/compressPhoto.js
  2. 1 1
      pages3/polyv/detail.vue

+ 1 - 1
common/compressPhoto.js

@@ -76,12 +76,12 @@ function myCompressImage(url, limitSize = 2048) {
       // #endif
     }
     const size = url.size;
-    console.log(size, "压缩前");
     if (size < limitSize) {
       return _resolve(url);
     }
     num++;
     const quality = limitSize / size;
+    console.log(size, quality, "压缩前");
     // #ifdef MP-WEIXIN
     getLessLimitSizeImage(url.path, quality);
     // #endif

+ 1 - 1
pages3/polyv/detail.vue

@@ -3071,7 +3071,7 @@ export default {
     imageInfos() {
       var self = this;
       return new Promise(async (resolve, reject) => {
-        let resPath = await myCompressImage(this.avatarUrl || this.faceUrl, 50);
+        let resPath = await myCompressImage(this.avatarUrl || this.faceUrl, 100);
         const waitUpload = await self.uploadFile(resPath, 0);
         resolve(waitUpload);
       });