Browse Source

有限取压缩图

xiaohaizhao 1 năm trước cách đây
mục cha
commit
bb0e82ac0e
2 tập tin đã thay đổi với 14 bổ sung2 xóa
  1. 7 1
      packageA/activity/detail.js
  2. 7 1
      packageA/activity/selectProduct/index.js

+ 7 - 1
packageA/activity/detail.js

@@ -77,7 +77,13 @@ Page({
 				if (value.attinfos.length != 0) {
 					value.attinfos = fileList(value.attinfos)
 					let image = value.attinfos.find(v => v.fileType == "image");
-					value.cover = image ? image.cover : "";
+					if (image) {
+						try {
+							value.cover = image.subfiles.find(v => v.type == "thumbnail").url;
+						} catch (error) {
+							value.cover = image.url;
+						}
+					}
 				}
 				if (value.islimit == 0) value.groupqty = 0;
 				if (value.gradeprice) value.gradeprice = (value.gradeprice - 0).toFixed(2)

+ 7 - 1
packageA/activity/selectProduct/index.js

@@ -76,7 +76,13 @@ Page({
         if (value.attinfos.length != 0) {
           value.attinfos = file.fileList(value.attinfos)
           let image = value.attinfos.find(v => v.fileType == "image");
-          value.cover = image ? image.cover : "";
+          if (image) {
+            try {
+              value.cover = image.subfiles.find(v => v.type == "thumbnail").url;
+            } catch (error) {
+              value.cover = image.url;
+            }
+          }
         }
         if (value.islimit == 0) value.groupqty = 0;
         if (newPrice) value.newPrice = CNY(value[newPrice] || 0);